- Creating Azure Vault
# create Azure vault
export azureVaultName=k8demovault
az keyvault create --location centralus --name $azureVaultName --resource-group k8-demo
# list all of the Azure Vaults
az keyvault list --output table
# adds secret
az keyvault secret set --vault-name "$azureVaultName" --name "AzCronJobKey" --value "CronJob Value for the Vault"
# shows secret
az keyvault secret show --name AzCronJobKey --vault-name $azureVaultName --output table
- Install App Authentication Global CLI tool
dotnet tool install --global appauthentication
- Add the following to the
docker-compse.yml
environment:
- MSI_ENDPOINT=${MSI_ENDPOINT}
- MSI_SECRET=${MSI_SECRET}
make sure the existing docker images are removed before rebuilding it.
- Run the tool
appauthentication run --verbose:debug
- Restart Visual Studio Code in order for the Environment Variables to load in the terminal window.
Test AppAuthentication CLI tool generation of the Token for Azure Storage
dotnet add package Microsoft.Azure.Services.AppAuthentication