AZ-400 exam dumps

AZ-400 practice question 177 of 306

Designing and Implementing Microsoft DevOps Solutions. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AZ-400 Question 177

Single answer

You are creating a multi-stage Azure DevOps pipeline to deploy a .NET microservice to an Azure Kubernetes Service (AKS) cluster. The pipeline must build a Docker image, store it in an Azure Container Registry (ACR), and then deploy the image to AKS. You also want each image to be versioned reliably as part of the build process. Which approach should you implement?

  1. A

    Use the Docker tasks in Azure Pipelines to build the image from your Dockerfile, configure a service connection to push it to ACR, and then run a kubectl deployment step pointing to the newly tagged image in ACR.

  2. B

    Compile the .NET binaries and store them as pipeline artifacts. After the build, manually build container images on a local machine and push them to AKS directly using the docker command-line tool.

  3. C

    Use a Docker Compose file in a local environment to build the image and push it manually to an external container registry. Then have the Pipeline pull the image from that registry during a deployment stage.

  4. D

    Create a container by referencing the base .NET image in the official Microsoft repository in each deployment step, bypassing the need to build and push a custom image for every deployment.

Show answer and explanation

Correct answer: A

Explanation

The recommended DevOps workflow for containerized deployments involves using Azure DevOps to build, tag, and push the Docker image to Azure Container Registry during CI, then deploying to AKS during CD. This ensures reliable versioning, consistent builds, and traceability of the images. For more details, refer to the Microsoft documentation on 'Build and push Docker images to Azure Container Registry' and 'Deploy containerized applications to AKS with Azure DevOps.'

  • A. Correct.

    Correct: This approach follows DevOps best practices by building the container image in a CI pipeline, pushing it to Azure Container Registry using a service connection, and then deploying it to AKS with the correct image version. It ensures the image is consistently versioned, traceable, and securely stored in ACR before deployment.

  • B. Incorrect.

    Incorrect: Storing binaries as artifacts and then manually building images offline can lead to inconsistencies and a lack of traceability. It also adds extra manual steps and risks deployment mismatch between what was built and what is deployed.

  • C. Incorrect.

    Incorrect: While using Docker Compose can help in local development, manually pushing images to an external registry and then expecting the pipeline to pull them introduces complexities and lacks the integrated visibility that Azure DevOps and ACR provide.

  • D. Incorrect.

    Incorrect: Referencing a base image in each deployment step bypasses the entire build process for your custom application. You would lose application-specific changes, versioning, and the benefits of having a stable, tested container image ready for production.

Timed practice exam

Take a AZ-400 practice test under exam conditions

70 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam