View Full Microsoft AZ-400 Exam Dumps and Practice Test Dumps
Q41. Which Azure Pipelines feature allows you to organize a pipeline into logical phases such as build, test, and deployment?
1) Variables
2) Tasks
3) Stages
4) Artifacts
Correct Answer: 3)
Explanation:
Stages in Azure Pipelines are used to divide a pipeline into logical sections that represent major phases of the software delivery process. Common stages include build, testing, security validation, and deployment. Each stage can contain one or more jobs and can have its own conditions, approvals, and dependencies. This structure is especially useful for multi-stage YAML pipelines because it makes the workflow easier to understand and manage. Variables store configuration values, tasks perform individual operations, and artifacts contain generated outputs. Therefore, stages are the appropriate feature for organizing a pipeline into major phases such as build, test, and deployment.
Q42. Which type of Azure Pipelines agent is maintained and managed by Microsoft?
1) Microsoft-hosted agent
2) Self-hosted agent
3) Private agent
4) Dedicated local agent
Correct Answer: 1)
Explanation:
A Microsoft-hosted agent is provided and maintained by Microsoft. These agents are automatically provisioned when a pipeline job runs and typically include commonly required development tools, SDKs, and command-line utilities. This reduces the administrative work required from the DevOps team because the organization does not need to maintain the underlying virtual machines. Self-hosted agents, on the other hand, are managed by the organization and may be useful when custom software, specialized hardware, or internal network access is required. Microsoft-hosted agents are therefore a convenient choice when standard build and deployment requirements can be satisfied without maintaining custom agent infrastructure.
Q43. What is the primary purpose of an Azure DevOps service connection?
1) Store application source code
2) Track work items
3) Generate test reports
4) Authenticate pipelines with external services
Correct Answer: 4)
Explanation:
An Azure DevOps service connection provides an authenticated connection between Azure DevOps pipelines and external services or resources. For example, a pipeline may need to connect to an Azure subscription, container registry, Kubernetes cluster, or another supported service. Instead of embedding authentication details directly inside pipeline scripts, a service connection provides a controlled mechanism for accessing the required resource. Proper permissions can be assigned to determine which pipelines are allowed to use the connection. This improves security and simplifies pipeline configuration. Service connections are therefore primarily used to establish secure authentication between Azure DevOps and external resources.
Q44. Which Azure DevOps feature allows several pipelines to share common variables and secrets?
1) Pipeline artifacts
2) Variable groups
3) Agent pools
4) Work items
Correct Answer: 2)
Explanation:
Variable groups allow teams to centrally store and manage values that can be reused across multiple Azure Pipelines. They are particularly useful when several pipelines need the same configuration values, such as environment names, URLs, or other settings. Variable groups can also contain sensitive values, which can be integrated with Azure Key Vault for improved secret management. Centralizing shared variables reduces duplication and makes configuration changes easier to manage. Without variable groups, teams might need to define the same values separately in multiple pipeline definitions. Therefore, variable groups are an effective way to share common configuration and secret values across pipelines.
Q45. What is the main purpose of publishing a pipeline artifact?
1) Store build output so it can be consumed by later jobs or stages
2) Create a new Git branch
3) Modify Azure Boards work items
4) Configure a service connection
Correct Answer: 1)
Explanation:
Pipeline artifacts are used to store files produced during a pipeline run so they can be downloaded or consumed by later jobs and stages. For example, a build stage might compile an application and publish the resulting package as an artifact. A deployment stage can then download that artifact and deploy the same output to a target environment. This separation between building and deploying helps create consistent and repeatable delivery processes. It also prevents later stages from having to rebuild the application. Therefore, publishing pipeline artifacts is an important mechanism for transferring build outputs between different parts of a CI/CD workflow.
Q46. Which trigger should be used when a pipeline needs to start automatically whenever changes are pushed to a specific branch?
1) Manual trigger
2) Scheduled trigger
3) Pipeline completion trigger
4) CI trigger
Correct Answer: 4)
Explanation:
A continuous integration, or CI, trigger can automatically start a pipeline when changes are pushed to a configured branch. This supports the practice of validating code changes shortly after they are committed. For example, a team can configure a pipeline to run whenever code is pushed to the main development branch. The pipeline can then compile the application, execute automated tests, and perform additional validation. Scheduled triggers are based on time, manual triggers require user action, and pipeline completion triggers start another pipeline after a different pipeline finishes. Therefore, a CI trigger is appropriate for responding automatically to code pushes.
Q47. Which Azure Pipelines capability can restrict a pipeline from deploying to production until an authorized person approves the deployment?
1) Build artifact
2) Repository branch
3) Environment approval
4) Agent capability
Correct Answer: 3)
Explanation:
Environment approvals can be configured to require authorization before a deployment proceeds to a protected environment such as production. This provides an additional control point in the delivery process and helps organizations prevent unreviewed deployments from reaching critical environments. An approval can require one or more designated users to review and approve the deployment before the pipeline continues. This approach is especially useful when production deployments require business, security, or operational validation. Branches control source-code organization, artifacts store build outputs, and agent capabilities describe available agent features. Therefore, environment approvals are the appropriate mechanism for controlling production deployments through human authorization.
Q48. What is the primary benefit of using path filters in an Azure Pipelines trigger?
1) They encrypt pipeline variables
2) They allow a pipeline to run only when specified file paths change
3) They increase the number of agents available
4) They automatically create deployment environments
Correct Answer: 2)
Explanation:
Path filters allow teams to control whether a pipeline should run based on which files or directories have changed. This is useful in repositories containing multiple applications or components. For example, a pipeline responsible for a documentation site might be configured to run only when files within the documentation directory are modified. This avoids unnecessary pipeline executions and can reduce build time and resource consumption. Path filters do not encrypt variables, create environments, or increase agent capacity. By limiting pipeline execution to relevant source changes, path filters provide a practical way to optimize CI workflows in larger repositories.
Q49. Which Azure Pipelines task is commonly used to pause a pipeline and request human intervention before continuing?
1) PublishBuildArtifacts
2) ManualValidation
3) DownloadPipelineArtifact
4) ArchiveFiles
Correct Answer: 2)
Explanation:
The ManualValidation task is designed to pause a pipeline and wait for a human decision before execution continues. It can be useful when an organization requires a person to inspect a deployment, verify a business condition, or approve a particular action before the pipeline proceeds. This provides manual control within an otherwise automated workflow. The task is commonly used in deployment processes where automated validation alone is not sufficient. Other tasks may publish artifacts, download pipeline outputs, or package files, but they do not provide the same human approval mechanism. Therefore, ManualValidation is the appropriate choice when a pipeline needs to wait for manual intervention.
Q50. What is the primary purpose of an agent pool in Azure DevOps?
1) Store source-code repositories
2) Manage collections of build and deployment agents
3) Store application secrets
4) Track sprint progress
Correct Answer: 2)
Explanation:
An agent pool is a collection of agents that can execute Azure DevOps pipeline jobs. Organizations can use agent pools to manage Microsoft-hosted or self-hosted agents and determine which pipelines can use those agents. Pool organization becomes especially important when different teams or workloads require different operating systems, software configurations, or network access. Agent pools help distribute pipeline jobs to available agents and provide centralized management of execution resources. They are not intended to store source code, manage secrets, or track sprint progress. Therefore, the primary purpose of an agent pool is to organize and manage the agents that execute pipeline jobs.
Q51. Which feature allows a pipeline to use different configuration values for development, testing, and production without changing the pipeline definition?
1) Environment-specific variables
2) Git tags
3) Pull requests
4) Work item queries
Correct Answer: 1)
Explanation:
Environment-specific variables allow the same pipeline definition to be reused across multiple environments while supplying different configuration values. For example, a development environment might use a development database connection, while production requires a different endpoint and configuration. Separating these values from the pipeline logic makes deployments easier to manage and reduces the need to duplicate pipeline definitions. Variables can be defined at appropriate scopes and combined with variable groups or other configuration mechanisms. Git tags identify source versions, pull requests support code review, and work item queries retrieve project-management information. Therefore, environment-specific variables are useful for maintaining reusable deployment pipelines.
Q52. What is the purpose of configuring a pipeline job with specific agent demands?
1) To determine which work items are completed
2) To require an agent with specific capabilities
3) To encrypt pipeline artifacts
4) To approve production deployments
Correct Answer: 2)
Explanation:
Agent demands allow a pipeline job to specify capabilities that an agent must have before the job can run. This is particularly useful with self-hosted agents because organizations may have different software installations, tools, operating systems, or hardware configurations across their agents. A demand can help ensure that a job is assigned only to an appropriate agent. For example, a pipeline requiring a particular installed tool can specify a corresponding capability. Demands do not control work items, artifact encryption, or deployment approvals. Their main purpose is to match pipeline jobs with agents that satisfy the required capabilities.
Q53. Which practice helps ensure that the same application package tested in one stage is deployed to later environments?
1) Rebuilding the application separately for every environment
2) Changing source code before each deployment
3) Publishing and promoting the same pipeline artifact
4) Creating a new branch for each environment
Correct Answer: 3)
Explanation:
Publishing an artifact once and promoting that same artifact through subsequent environments helps ensure consistency between testing and production. The application is built from a specific source revision, tested, and stored as a versioned pipeline artifact. Later deployment stages can retrieve that exact artifact rather than rebuilding the application. This reduces the possibility that environment-specific builds will contain different binaries or dependencies. Rebuilding separately can introduce inconsistencies, while changing source code between environments weakens traceability. Creating branches for environments is also unnecessary in many deployment workflows. Therefore, artifact promotion supports reliable and repeatable software delivery.
Q54. What is the primary purpose of a scheduled pipeline trigger?
1) Start a pipeline at predefined times
2) Start a pipeline after every Git push
3) Approve a deployment automatically
4) Create a new Azure subscription
Correct Answer: 1)
Explanation:
A scheduled trigger allows an Azure Pipeline to run automatically at predefined times. This is useful for activities that do not need to occur immediately after a source-code change. Examples include nightly builds, scheduled security scans, periodic integration tests, or regular maintenance tasks. A CI trigger is more appropriate when the pipeline should run after source changes, while approvals provide human or automated controls around deployments. Scheduled triggers therefore provide time-based automation and can help teams regularly perform validation or maintenance activities without requiring someone to start the pipeline manually.
Q55. Which metric measures how frequently an organization successfully deploys software to production?
1) Mean time to recovery
2) Deployment frequency
3) Change failure rate
4) Lead time for changes
Correct Answer: 2)
Explanation:
Deployment frequency measures how often an organization successfully delivers changes to a production environment. It is one of the commonly used DORA metrics for evaluating software delivery performance. A higher deployment frequency can indicate that a team has established efficient and reliable delivery processes, although the metric should be considered alongside quality and stability measurements. Mean time to recovery focuses on how quickly service is restored after an incident, change failure rate measures deployments that cause failures, and lead time measures the time required to move changes from development toward production. Therefore, deployment frequency specifically measures the frequency of successful production deployments.
Q56. Which security practice helps detect accidentally committed passwords, API keys, or tokens in source code?
1) Secret scanning
2) Load testing
3) UI testing
4) Capacity planning
Correct Answer: 1)
Explanation:
Secret scanning is designed to identify sensitive credentials such as passwords, API keys, access tokens, and other secrets that may have been accidentally committed to source code repositories. Detecting these values early allows teams to remove or revoke exposed credentials before they can be misused. Secret scanning is an important part of shift-left security because it moves security checks earlier in the software development lifecycle. Load testing measures application performance under traffic, UI testing validates user interfaces, and capacity planning evaluates resource requirements. Therefore, secret scanning is the most appropriate practice for detecting exposed credentials in source code.
Q57. What is the main advantage of using pipeline caching for dependencies?
1) It replaces source control
2) It removes the need for testing
3) It can reduce build time by reusing previously downloaded dependencies
4) It automatically approves deployments
Correct Answer: 3)
Explanation:
Pipeline caching can reduce build times by storing dependencies that are expensive or time-consuming to download and reusing them during later pipeline runs. For example, a project may need to download numerous package dependencies before compilation or testing. If those dependencies have not changed, retrieving them from a cache can be faster than downloading them again. Caching should be configured carefully so that stale or incompatible dependencies do not cause incorrect builds. It does not replace source control, eliminate testing, or approve deployments. Its primary benefit is improved pipeline performance by reducing repeated dependency download operations.
Q58. Which testing approach verifies that multiple application components work correctly together?
1) Unit testing
2) Integration testing
3) Static code analysis
4) Secret scanning
Correct Answer: 2)
Explanation:
Integration testing verifies that multiple components, services, or modules of an application work correctly together. While unit tests generally focus on individual functions or components in isolation, integration tests examine interactions between those components. For example, an application might be tested to confirm that its API correctly communicates with a database or another service. Integration testing is particularly valuable in CI/CD pipelines because problems between components can be detected before deployment. Static analysis examines source code characteristics, and secret scanning looks for exposed credentials. Therefore, integration testing is the appropriate approach for validating interactions among multiple application components.
Q59. What is the purpose of a quality gate in a DevOps pipeline?
1) To define Git repository permissions only
2) To ensure required quality criteria are satisfied before proceeding
3) To increase the number of pipeline agents
4) To create application source code
Correct Answer: 2)
Explanation:
A quality gate establishes criteria that must be satisfied before a pipeline is allowed to continue to a subsequent stage. Quality gates can evaluate factors such as test results, code coverage, security findings, or code-quality thresholds. For example, a team may require all critical security issues to be resolved before an application can be deployed. This approach helps prevent low-quality or risky builds from progressing through the delivery process. Quality gates do not create source code, manage repository permissions exclusively, or increase agent capacity. Their purpose is to enforce predefined quality standards within the software delivery workflow.
Q60. Which DORA metric measures the average time required to restore service after a production failure?
1) Deployment frequency
2) Change failure rate
3) Lead time for changes
4) Mean time to restore
Correct Answer: 4)
Explanation:
Mean time to restore measures how quickly an organization can recover from a production incident or failure and restore normal service. A lower value generally indicates that the team can identify problems, recover systems, and return services to normal more efficiently. This metric is useful for evaluating operational resilience and incident-response effectiveness. Deployment frequency measures how often deployments occur, change failure rate measures how often deployments cause failures, and lead time for changes measures how long it takes for changes to move through the delivery process. Therefore, mean time to restore is the DORA metric associated with recovery speed after production failures.