I wanted to create a few storage accounts for students in my class to complete an assignment featuring Event Sourcing and Material Views.
So, here’s what I did.
Download/install the latest azure command line interface (cli).
(While doing this, I realized I could have just used the cloud shell. I soldiered on with the dl)
Create a resource group to contain the accounts we’d need.
Create the accounts and output the storage account keys
The command to make a single storage account is pretty straightforward:
But I wanted to also output the keys and display them on a single line. The command to get the keys after the account is created is this:
So, I used the jq program in bash to parse the json result and display both keys on a line. Thus, I created a script that would create the accounts and then output their storage account keys.
This is the script that produced the accounts and keys:
Overall, the longest part of the exercise was dealing with the way the files were being saved in windows vs how they were being saved and read by bash. But the accounts were created and class can get on with assignment 2.