Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam AZ-400 topic 4 question 7 discussion

Actual exam question from Microsoft's AZ-400
Question #: 7
Topic #: 4
[All AZ-400 Questions]

Your company has a project in Azure DevOps for a new web application.
The company identifies security as one of the highest priorities.
You need to recommend a solution to minimize the likelihood that infrastructure credentials will be leaked.
What should you recommend?

  • A. Add a Run Inline Azure PowerShell task to the pipeline.
  • B. Add a PowerShell task to the pipeline and run Set-AzureKeyVaultSecret.
  • C. Add an Azure Key Vault task to the pipeline.
  • D. Add Azure Key Vault references to Azure Resource Manger templates.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Azure Key Vault provides a way to securely store credentials and other keys and secrets.
The Set-AzureKeyVaultSecret cmdlet creates or updates a secret in a key vault in Azure Key Vault.
Reference:
https://docs.microsoft.com/en-us/powershell/module/azurerm.keyvault/set-azurekeyvaultsecret

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
silverdeath
Highly Voted 4 years ago
D is correct and needed, so the correct answer should be D
upvoted 52 times
jay158
2 years ago
What is web app is deployed using Terraform, it is not specified that deployment is using ARM Templates?
upvoted 6 times
NandoRU777
1 year, 2 months ago
In terraform you can reference to Azure Key Vault secrets too and inject it in the entire Terreform infrastructure deployment code
upvoted 1 times
...
Tyler2023
8 months ago
This is a Microsoft related certification, there is small number of question that requires third party tools, so always assume that we are using Microsoft Azure tools like ARM and Bicep
upvoted 2 times
...
...
...
artisticcheese
Highly Voted 4 years, 4 months ago
Correct answer is C. This is the task to retreive Keyvault secrets to use in following tasks
upvoted 26 times
NKnab
3 years, 9 months ago
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-key-vault?view=azure-devops
upvoted 2 times
...
Yanzhi
4 years, 4 months ago
D is more "correct" than C, because the protection object is infra's credential, it may or may not used in pipeline.
upvoted 72 times
hart232
3 years, 11 months ago
.....Assuming ARM is used for deploying infrastructure.
upvoted 5 times
...
Fred64
3 years, 11 months ago
The pbl with C is that we will inject secrets into parameters. They can later be read in the deployent blade in the portal
upvoted 5 times
icedog
10 months, 2 weeks ago
not if the parameter type is securestring, if it's anything else then yes it can be read
upvoted 1 times
...
...
TosO
4 years, 1 month ago
Correct
upvoted 9 times
silverdeath
3 years, 12 months ago
yes, correct
upvoted 3 times
...
...
...
Tyler2023
8 months ago
The Set-AzKeyVaultSecret cmdlet creates or updates a secret in a key vault in Azure Key Vault. If the secret does not exist, this cmdlet creates it. If the secret already exists, this cmdlet creates a new version of that secret. You need to use the Get-AzKeyVaultSecret cmdlet gets secrets in a key vault. This cmdlet gets a specific secret or all the secrets in a key vault. ANSWER is D: https://learn.microsoft.com/en-us/powershell/module/az.keyvault/set-azkeyvaultsecret?view=azps-10.2.0
upvoted 2 times
ozbonny
2 months, 1 week ago
but it stores credentials within scripts so it poses a security risk.
upvoted 1 times
...
...
...
isaurabhgoyal
Most Recent 1 day ago
Selected Answer: C
Option D, adding Azure Key Vault references to Azure Resource Manager templates, is a valid approach for securely accessing credentials and other sensitive information in your infrastructure deployment. However, it is more focused on managing secrets within your infrastructure code rather than in your CI/CD pipeline. For the specific scenario of minimizing the likelihood of infrastructure credentials being leaked in an Azure DevOps pipeline, using an Azure Key Vault task directly in the pipeline (Option C) is a more direct and secure approach. This allows you to retrieve secrets from Azure Key Vault at runtime without exposing them in your pipeline configuration. So the ANS is C
upvoted 1 times
...
4bd3116
1 week, 3 days ago
Selected Answer: C
By using an Azure Key Vault task in your pipeline, you can retrieve secrets during runtime without exposing them in your code or configuration files.
upvoted 1 times
...
chloaus
3 weeks, 4 days ago
The question is referring to infrastructure credentials. Instead of putting a secure value (like a password) directly in your template or parameter file, you can retrieve the value from an Azure Key Vault during a deployment. You retrieve the value by referencing the key vault and secret in your parameter file. The value is never exposed because you only reference its key vault ID. https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/key-vault-parameter?tabs=azure-cli
upvoted 1 times
...
ozbonny
2 months, 1 week ago
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/key-vault-parameter?tabs=azure-cli
upvoted 1 times
...
ozbonny
2 months, 1 week ago
C. Add an Azure Key Vault task to the pipeline.
upvoted 1 times
...
saket051985
3 months, 1 week ago
C. Add an Azure Key Vault task to the pipeline. By using Azure Key Vault tasks, you can securely store and retrieve secrets in Azure Key Vault during your build or release process, reducing the exposure of sensitive information like credentials in your pipelines. Option D (Add Azure Key Vault references to Azure Resource Manager templates) is also a good practice, but it may not directly address the concern of credentials leaking during the pipeline execution. It's more about securely referencing secrets during infrastructure deployment. Therefore, the correct answer is C
upvoted 1 times
...
vsvaid
4 months ago
Selected Answer: C
I think C as this task is only for reteiving passwords securly. Can be done with D as well but for C is better choice
upvoted 1 times
...
_alex_123
6 months, 1 week ago
D as it is more secure than KV task:"The task can be used to fetch the latest values of all or a subset of secrets from the vault and set them as variables that can be used in subsequent tasks of a pipeline. " With ARM template/parameter file a particular KV secret is referred and that KV secret value is only "visible" for that particular ARM or AzureCLI task
upvoted 2 times
...
Jrcondado80
6 months, 2 weeks ago
Selected Answer: C
Correct answer is C
upvoted 1 times
...
krzychu3000
8 months, 3 weeks ago
Selected Answer: C
KV task
upvoted 2 times
...
stai
9 months, 1 week ago
Correct answer is C.
upvoted 1 times
...
flafernan
9 months, 1 week ago
B, C, D - Regarding which option is the right one, it is important to remember that there is no one-size-fits-all answer, as each project may have specific needs. The recommended option will depend on the project context, security requirements, and team preferences. Microsoft's official solution, "Add a PowerShell task to the pipeline and run Set-AzureKeyVaultSecret", is a good choice because it offers a high level of control and flexibility. However, the other options may also be equally valid, depending on the details of the project.
upvoted 2 times
vector_bco
6 months, 1 week ago
your kv have a secret named sqlPassword with the value 123456 when you will run Set-AzureKeyVault command you will not get 123456, so selected answer in 146% incorrect There 2 options here C and D with some advantages and disadvantages for both
upvoted 1 times
...
...
xRiot007
9 months, 3 weeks ago
You want credentials not to be leaked. This means they CANNOT be anywhere in your infrastructure scripts of pipeline. To do this, you will add Azure Key Vault key references. At runtime, the pipeline will ask the Vault for values and pass them immediately to the infrastructure scripts.
upvoted 1 times
xRiot007
9 months, 3 weeks ago
To sum it up, answer is D.
upvoted 2 times
...
...
Rouix
9 months, 4 weeks ago
Selected Answer: C
C I think, credentials in KV task are fetched from KV and not visible at all.
upvoted 4 times
...
icedog
10 months, 2 weeks ago
Selected Answer: C
C. Add Key Vault task.. Secrets can be used to full parameter values, if using ARM templates the parameter type is securestring and will not be shown in the RG deployment Secrets using Key Vault task are masked in all and any ouputs and logs generated by the Agents
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...