Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.28 KB

azure-vault.md

File metadata and controls

51 lines (34 loc) · 1.28 KB

Azure Vault Local Development in the Containers

  1. 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
  1. Install App Authentication Global CLI tool
    dotnet tool install --global appauthentication
  1. 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.

  1. Run the tool
    appauthentication run --verbose:debug
  1. 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

Library

    dotnet add package Microsoft.Azure.Services.AppAuthentication