Storage
Manually create storage account from Azure Web Console, then confirm it using the following commands
1
2
3
| $ SubID=$(az account show --query id --output tsv)
$ az group list --subscription $SubID --query [].name
$ az storage account list --subscription $SubID --query [].name
|
Give myself permission to create container and upload blob
1
2
3
4
| $ az ad signed-in-user show --query id -o tsv | az role assignment create \
--role "Storage Blob Data Contributor" \
--assignee @- \
--scope "/subscriptions/$SubID/resourceGroups/trg"
|
Let’s assume the storage account name is tsc123tsc, create container as tsc. pre-check and post-check.
1
2
| $ az storage container list --account-name tsa123tsa --auth-mode login
$ az storage container create --account-name tsa123tsa --name tsc --auth-mode login
|
Now let’s pre-check the container, upload a file, post-check and download it back.
1
2
3
| $ az storage blob list --container-name tsc --account-name tsa123tsa --auth-mode login
$ az storage blob upload --account-name tsa123tsa --auth-mode login --container-name tsc --file README.md
$ az storage blob download --account-name tsa123tsa --container-name tsc --auth-mode login --name README.md --file DownloadedREADME.md
|