HOTSPOT (Drag and Drop is not supported)You have an Azure Pipelines pipeline that has the following definition.For each of the following statements, select Yes if the statement is true. Otherwise, select No.Note: Each correct selection is worth one point.Hot Area:
Answer(s): A
Box 1: NoNo - The secrets in kv1 are available to CopyFiles@2.The CopyFiles@2 task is run first, before AzureKeyVault@2 task, which refers to kv1.Note:A task performs an action in a pipeline and is a packaged script or procedure that's abstracted with a set of inputs. Tasks are the building blocks for defining automation in a pipeline.When you run a job, all the tasks are run in sequence, one after the other.Box 2: NoNo - The connection string is recorded in the log file.The secret variable will not be logged.Note: Azure Pipelines, Secret variablesAzure Pipelines makes an effort to mask secrets when emitting data to pipeline logs, so you may see additional variables and data masked in output and logs that are not set as secrets.Box 3: YesYes - The secrets in kv1 is available to AzureFunctionsApp@2.
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/tasks https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables
You have a GitHub repository.You need to ensure that all the code in the repository is scanned for vulnerabilities.What should you use?
Identifying vulnerabilities in your project's dependencies with Dependabot alertsDependabot generates Dependabot alerts when known vulnerabilities are detected in dependencies that your project uses.
https://docs.github.com/en/code-security/dependabot/dependabot-alerts
HOTSPOT (Drag and Drop is not supported)You have an Azure subscription and a GitHub Actions workflow named workflow1.You deploy the following Bicep file to the subscription by using workflow1.For each of the following statements, select Yes if the statement is true. Otherwise, select No.Note: Each correct selection is worth one point.Hot Area:
Box 1: NoNo - An Azure key vault will be deployed.No, an Azure Key Vault will not be deployed by this Bicep file.existing Keyword: The Bicep code uses the existing keyword in the resource declaration for kv.Reference Only: This keyword tells Azure Resource Manager that the Key Vault already exists in your subscription.No Creation: Azure will only look up the existing Key Vault to fetch data from it, rather than provisioning a new one.Box 2: NoNo - The logs for workflow1 will contain the admin password for Microsoft SQL Server.No, the logs for the GitHub Actions workflow will not contain the admin password.Key Vault Secrets are Masked: Azure Resource Manager (ARM) and GitHub Actions automatically treat values retrieved via the .getSecret() function as sensitive data.Bicep Parameter Protection: Azure automatically masks outputs and secure parameters in the deployment logs.GitHub Runner Redaction: Even if the value were accidentally printed to the console, GitHub Actions automatically redacts known secrets and replaces them with asterisks (***).Box 3: YesYes - The admin password for Microsoft SQL Server will be retrieved from an Azure key vault.What the Code Actually Does:Looks Up Key Vault: It references a Key Vault named kvName inside the resource group kvResourceGroup.Retrieves a Secret: It pulls a secure string (vmAdminPassword) from that existing Key Vault using the kv.getSecret() function.Deploys SQL Module: It passes that retrieved secret as the adminPassword parameter into a separate module file named ./sql.bicep.
https://www.mdpi.com/1999-5903/17/8/359https://www.jetbrains.com/help/teamcity/cloud/git.html
HOTSPOT (Drag and Drop is not supported)You have a GitHub repository named Repo1 and an app named App1. Repo1 stores the source code for App1.You need to perform the following tests:-Test1: Run a ZAP spider against App1 for one minute and wait for passive scanning to complete. The test must NOT perform active attacks.-Test2: Run a ZAP spider against App1, and when complete, execute an AJAX spider scan.Which GitHub action should you use for each test? To answer, select the appropriate options in the answer area.Note: Each correct selection is worth one point.Hot Area:
Box 1: ZAP Baseline ScanTest1: Run a ZAP spider against App1 for one minute and wait for passive scanning to complete. The test must NOT perform active attacks.ZAP - Baseline ScanThe ZAP Baseline scan is a script that is available in the ZAP Docker images.It runs the ZAP spider against the specified target for (by default) 1 minute and then waits for the passive scanning to complete before reporting the results.This means that the script doesn’t perform any actual ‘attacks’ and will run for a relatively short period of time (a few minutes at most).By default, it reports all alerts as WARNings but you can specify a config file which can change any rules to FAIL or IGNORE.This script is intended to be ideal to run in a CI/CD environment, even against production sites.Box 2: ZAP Full ScanTest2: Run a ZAP spider against App1, and when complete, execute an AJAX spider scan.ZAP Action Full ScanA GitHub Action for running the ZAP Full Scan to perform Dynamic Application Security Testing (DAST).The ZAP full scan action runs the ZAP spider against the specified target (by default with no time limit) followed by an optional ajax spider scan and then a full active scan before reporting the results. The alerts will be maintained as a GitHub issue in the corresponding repository.Incorrect:* ZAP - API ScanThe ZAP API scan is a script that is available in the ZAP Docker images.It is tuned for performing scans against APIs defined by OpenAPI, SOAP, or GraphQL via either a local file or a URL.It imports the definition that you specify and then runs an Active Scan against the URLs found. The Active Scan is tuned to APIs, so it doesn’t bother looking for things like XSSs.
https://www.zaproxy.org/docs/docker/baseline-scan https://github.com/zaproxy/action-full-scan https://www.zaproxy.org/docs/docker/api-scan
You use GitHub Enterprise to manage source code and deployments.From GitHub Actions, you create a reusable workflow named workflow1.You need to ensure that the secrets defined in the calling workflow are passed to workflow1.What should you include in the YAML file for the calling workflow?
Create reusable workflows in GitHub ActionsWorkflows that call reusable workflows in the same organization or enterprise can use the inherit keyword to implicitly pass the secrets.Example:jobs:call-workflow-passing-data:uses: octo-org/example-repo/.github/workflows/reusable-workflow.yml@main with:config-path: .github/labeler.yml secrets: inheritNote: Passing named secretsTo pass named inputs to a called workflow, use the with keyword in a job. Use the secrets keyword to pass named secrets. For inputs, the data type of the input value must match the type specified in the called workflow (either boolean, number, or string).jobs:call-workflow-passing-data:uses: octo-org/example-repo/.github/workflows/reusable-workflow.yml@main with:config-path: .github/labeler.yml secrets:envPAT: ${{ secrets.envPAT }}
https://resources.github.com/learn/pathways/automation/intermediate/create-reusable-workflows-in-github-acti ons/
HOTSPOT (Drag and Drop is not supported)You have a GitHub project that is used to develop a container app named App1.You have a GitHub Actions workflow that includes the following.For each of the following statements, select Yes if the statement is true. Otherwise, select No.Note: Each correct selection is worth one point.Hot Area:
Box 1: YesYes - App1 will be deployed to an AzureThe application will be deployed to an Azure Container Registry (ACR) as part of the build and push process, which prepares it for deployment to an Azure hosting service like Azure Container Apps or Azure Kubernetes Service (AKS).Correct Target ServicesAzure Container Registry (ACR): The immediate target of this specific workflow. The command docker push registry.azurecr.io/app1... uploads the built container image to your private Azure registry host (registry.azurecr.io).Azure Container Apps / Azure App Service: Once the image is safely stored in ACR, Azure continuous deployment features pull that image to run your containerized application.Box 2: NoNo - The secrets will be written to the log in plain text.No, the secrets will not be written to the log in plain text.GitHub Actions Secret MaskingAutomatic Redaction: GitHub automatically masks any environment variables or secrets configured via GitHub Actions Secrets.Log Masking: Masked values are replaced with asterisks (***) in the runner logs.Build Outputs: Even though the docker-login step uses the secrets directly, GitHub intercepts the standard output and standard error to hide these values.Box 3: NoNo - The :latest tag will be applied to the container image.No, the :latest tag will not be applied to the container image based on this workflow code.Explicit Tagging: Docker only applies tags that you explicitly define in the command.Sha Tag Only: The script only specifies registry.azurecr.io/app1:${{ github.sha }}.No Automatic Latest: Docker does not automatically generate or push a :latest tag unless you tell it to do so.How to add the latest tagTo apply and push the :latest tag alongside the commit SHA, update your run step to include a second tag and push command:- run: |docker build . -t registry.azurecr.io/app1:${{ github.sha }} -t registry.azurecr.io/app1:latest docker push registry.azurecr.io/app1:${{ github.sha }}docker push registry.azurecr.io/app1:latest
https://docs.doppler.com/docs/github-actions https://learn.microsoft.com/en-us/answers/questions/2116172/azure-container-apps-not-getting-updated-imag e-tag
HOTSPOT (Drag and Drop is not supported)You have an Azure subscription.You have a project in Azure DevOps.You have an Azure Repos repository named repo1 that contains Bicep modules.You need to develop an infrastructure as code IaC solution that will be deployed by using the Bicep modules. The solution must meet the following requirements:-Automatically deploy resources to the subscription.-Ensure that the deployed resources comply with organization standards.What should you use for each requirement? To answer, select the appropriate options in the answer area.Note: Each correct selection is worth one point.Hot Area:
Box 1: Azure PipelinesTo develop an Infrastructure as Code (IaC) solution that fulfills the requirements, you must implement Azure Pipelines to automate the deployments and integrate Azure Policy paired with the Bicep Linter to guarantee organizational standard compliance.Automate Resource DeploymentTo automatically deploy your resources to the Azure subscription, use Azure Pipelines integrated with your Azure DevOps project and repo1 repository:Create a Service Connection: Navigate to Project Settings > Service Connections in Azure DevOps. Create an Azure Resource Manager service connection targeting your subscription using Workload Identity Federation for a secure, passwordless authentication model.Configure a CI/CD Pipeline: Define a multi-stage YAML pipeline file (azure-pipelines.yml) inside repo1. Configure the pipeline to trigger automatically whenever updates or pull requests are made to your main production branch.Utilize Azure CLI / Azure PowerShell Tasks: Add a task within your continuous deployment (CD) phase that targets the subscription scope (e.g., AzureCLI@2) to execute the deployment command.Box 2: Azure PolicyEnsure Compliance with Organizational StandardsTo ensure that your Bicep files align with organizational patterns and security standards before and after execution, apply a shift-left validation approach:*-> Leverage Azure Policy: Ensure your Azure subscription is governed by Azure Policy. When the pipeline initializes a deployment, the underlying Azure Resource Manager (ARM) evaluation engine automatically cross-references your Bicep templates against organizational initiatives or definitions. If any module tries to break compliance (e.g., deploying unauthorized SKUs or unencrypted resources), Azure Policy will deny the deployment instantly.Enforce Pre-Deployment Linting: Ensure your pipeline runs a validation step using the built-in Bicep Linter and the az bicep build command. This automatically parses your modules against structural constraints, naming requirements, and security best practices.Implement "What-If" Proactive Checks: Add a pre-flight validation phase inside your build pipeline that uses the Azure Deployment What-If operation (az deployment sub what-if). This previews exactly what configuration changes will take place in the cloud, comparing them against the target environment.
https://www.reddit.com/r/AZURE/comments/1gjhfnu/how_do_you_do_iac_with_azure_devops/
You have an existing project in Azure DevOps.You plan to integrate GitHub as the repository for the project.You need to ensure that Azure Pipelines runs under the Azure Pipelines identity.Which authentication mechanism should you use?
Answer(s): C
Azure Pipelines must be granted access to your repositories to trigger their builds, and fetch their code during builds.There are three authentication types for granting Azure Pipelines access to your GitHub repositories while creating a pipeline.GitHub app authenticationThe Azure Pipelines GitHub App is the recommended authentication type for continuous integration pipelines. After you install the GitHub App in your GitHub account or organization, your pipeline will run without using your personal GitHub identity. Builds and GitHub status updates will be performed using the Azure Pipelines identity. The app works with GitHub Checks to display build, test, and code coverage results in GitHub.
https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github
Share your comments for Microsoft AZ-400 exam with other users:
Question 2:
This is very good and accurate. Explanation is very helpful even thou some are not 100% right but good enough to pass.