You plan to use a NuGet package in a project in Azure DevOps. The NuGet package is in a feed that requires authentication.You need to ensure that the project can restore the NuGet package automatically.What should the project use to automate the authentication?
Answer(s): B
The Azure Artifacts Credential Provider automates the acquisition of credentials needed to restore NuGet packages as part of your .NET development workflow. It integrates with MSBuild, dotnet, and NuGet(.exe) and works on Windows, Mac, and Linux. Any time you want to use packages from an Azure Artifacts feed, the Credential Provider will automatically acquire and securely store a token on behalf of the NuGet client you're using.
https://github.com/Microsoft/artifacts-credprovider
You plan to use Azure DevOps to build and deploy an app that will be hosted in a Kubernetes cluster.You need to scan the app image for vulnerabilities before the image is deployed to the cluster.What should you include in the solution?
Answer(s): A
Overview of Microsoft Defender for ContainersMicrosoft Defender for Containers is the cloud-native solution to improve, monitor, and maintain the security of your clusters, containers, and their applications.Defender for Containers assists you with four core aspects of container security:* Environment hardening - Defender for Containers protects your Kubernetes clusters whether they're running on Azure Kubernetes Service, Kubernetes on-premises/IaaS, or Amazon EKS. Defender for Containers continuously assesses clusters to provide visibility into misconfigurations and guidelines to help mitigate identified threats.* Vulnerability assessment - Vulnerability assessment and management tools for images stored in Azure Container Registry and Elastic Container Registry* Etc.Vulnerability assessmentDefender for Containers scans the container images in Azure Container Registry (ACR) and Amazon AWS Elastic Container Registry (ECR) to provide vulnerability reports for your container images, providing details for each vulnerability detected, remediation guidance, real-world exploit insights, and more.
https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-introduction
HOTSPOT (Drag and Drop is not supported)You have a GitHub organization.You configure the personal access token (PAT) policy shown in the following exhibit.Use the drop-down menus to select the answer choice that completes each statement based on the information presented in the graphic.Note: Each correct selection is worth one point.Hot Area:
Box 1: canClassic PATs ______ access the public resources of the organization.Setting a personal access token policy for your organizationOrganization owners can control whether to allow fine-grained personal access tokens and personal access tokens (classic), and can require approval for fine-grained personal access tokens.*-> Restricting access by personal access tokens (classic)Organization owners can prevent personal access tokens (classic) from accessing resources owned by the organization. Personal access tokens (classic) will still be able to read public resources within the organization. This setting only controls access by personal access tokens (classic), not fine-grained personal access tokens.Box 2: canSSH keys created by using classic PATs ________ access the resources of the organization.Under Personal access token (classic), select the option that meets your needs:* Allow access via personal access tokens (classic): Personal access tokens (classic) can access resources owned by the organization.*-> Restrict access via personal access tokens (classic): Personal access tokens (classic) cannot access resources owned by the organization. SSH keys created by personal access tokens (classic) will continue to work.
https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-perso nal-access-token-policy-for-your-organization
HOTSPOT (Drag and Drop is not supported)You have an Azure subscription.You plan to use Azure Pipelines to deploy an infrastructure solution that will include an app named App1.You need to store the secrets that will be used during the deployment. The solution must meet the following requirements:-The database connection string must be accessible to the deployment pipeline and to App1.-Signing certificates must only be available for use in the deployment pipeline.-The solution must minimize development effort.What should you use to store each type of secret? To answer, select the appropriate options in the answer area.Hot Area:
Box 1: Secure filesSigning certificatesTo store signing certificates for use only in your 2026 deployment pipelines with minimal development effort, Azure Pipelines Secure Files is the superior choice for simple binary assets like certificates.Secure Files provides the most streamlined experience for infrastructure and app deployment because it handles the binary file format natively without requiring additional code to "reconstruct" the certificate from a vault secret.Box 2: Azure Key VaultThe database connection stringThe industry-standard "best" practice for storing and accessing a database connection string in Azure Pipelines and an app is to use Azure Key Vault combined with Managed Identities.This approach ensures the secret is never hardcoded, is encrypted at rest, and remains invisible in logs.1. Store the Secret in Azure Key VaultCreate a Secret: Store your database connection string in an Azure Key Vault as a "Secret".Security: This centralizes sensitive data, removing it from source control and configuration files.2. Access the Secret in Azure Pipelines3. Provide the Secret to the AppFor the application to access the connection string without code changes:Key Vault References: In the Azure App Service configuration, set the connection string value to a Key Vault Reference. The syntax is @Microsoft.KeyVault(SecretUri=...).Managed Identity: Enable a System-assigned Managed Identity for your App
https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops https://stackoverflow.com/questions/61496963/seperating-connectionstring-from-source-control-and-be-able-to -perform-integrati
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:
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
Post your Comments and Discuss Microsoft AZ-400 exam prep with other Community members: