Skip to content

Instantly share code, notes, and snippets.

@MauRiEEZZZ
Last active November 1, 2019 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MauRiEEZZZ/eaade8e5840262d732d2c4bd961f660e to your computer and use it in GitHub Desktop.
Save MauRiEEZZZ/eaade8e5840262d732d2c4bd961f660e to your computer and use it in GitHub Desktop.
#we create a randomized name, the name of the keyvault has to be unique within the current cloud
#it will be publicly available using this name.
keyvaultName="keyvault-$(cat /proc/sys/kernel/random/uuid | cut -c-7)"
keyvaultURI=$(az keyvault create --name $keyvaultName --resource-group "ContosoResourceGroup" --location eastus --query "properties.vaultUri" --output tsv)
az keyvault secret set --vault-name $keyvaultName --name "ExamplePassword" --value "sampleSecretValueIn_plaintext"
tenantID=$(az account show --output tsv --query tenantId)
echo "The URI for the keyvault is: $keyvaultURI"
echo "The ID for the tenant is: $tenantID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment