< Previous Challenge - Home - Next Challenge >
The goal for this challenge is to understand how to handle secret values, e.g., Don’t encode secrets in your code!
So far, the only parameters you have passed into your template have been related to storage accounts. In a later challenge, you will deploy resources requiring secret credentials as parameters. It is an ANTI-pattern to put a secret value such as a password in plain text in a parameter file!
NEVER. DO. THIS… EVER!
It is a BEST practice to store secret values (such as passwords) in the Azure Key Vault service.
FACT: Committing a secret value into a public Git repository automatically compromises it, even if you immediately reverse the commit to delete the secret from the repo. This is because the secret value will remain in the repository’s history for all to see. You should consider that secret compromised and replace it with a new value immediately.
In this challenge, you will create an Azure Key Vault and store a secret in it. Then you will create a Bicep template and parameters file that reads from the key vault.
It can be tricky to deploy an Azure Key Vault. In the interest of time, we are providing a Bicep template that does it for you. You can find the create-key-vault.bicep
file in the /Challenge-04
folder of the Resources.zip
file provided by your coach.
This Bicep template will create a Key Vault for you and prompt you to enter a secret value (password) that you want to store in the vault.
kvwth
adminPassword
.Your challenges are:
HINT: You have just deployed other Bicep templates in the previous challenges, so you should know HOW to do this by now.