Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.