Skip to content

Instantly share code, notes, and snippets.

@jackinf
Last active June 22, 2021 09:45
Show Gist options
  • Save jackinf/298f496b5a8cb20e7969af49f263ab04 to your computer and use it in GitHub Desktop.
Save jackinf/298f496b5a8cb20e7969af49f263ab04 to your computer and use it in GitHub Desktop.
Azure scripts; Azure storage

Azure

Prerequisites

Install azure cli on macOS https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-macos?view=azure-cli-latest

brew update && brew install azure-cli

For better output formatting you can use https://github.com/antonmedv/fx.

Working with Resource Groups

Gets the resource groups and prints names only.

az group list | fx 'this.forEach(x => console.log(x.name))'

Working with Storage Accounts

Create an account. Requires resource group

az storage account create -n goalskeyvalue -g goals

Create a container. Requires storage account

az storage container create -n goalscontainer --account-name goalskeyvalue

List containers of storage accounts

az storage container list --account-name goalskeyvalue

Secrets

Retrieve a secret

az keyvault secret list --vault-name tc-next-stg-euw-keyvault
az keyvault secret show --vault-name tc-next-stg-euw-keyvault --name connectionstring-sqlserver-events | jq .value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment