Created
March 11, 2021 07:03
-
-
Save mysticrenji/5147638430f595f159f595ff3d5ccf32 to your computer and use it in GitHub Desktop.
Blob Storage Creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RESOURCE_GROUP_NAME=rg-experiments-sea | |
STORAGE_ACCOUNT_NAME=terraformblobstoragedev | |
CONTAINER_NAME=terraform | |
LOCATION=southeastasia | |
# Create resource group | |
az group create --name $RESOURCE_GROUP_NAME --location $LOCATION | |
# Create storage account | |
az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob | |
# Get storage account key | |
ACCOUNT_KEY=$(az storage account keys list --resource-group $RESOURCE_GROUP_NAME --account-name $STORAGE_ACCOUNT_NAME --query '[0].value' -o tsv) | |
# Create blob container | |
az storage container create --name $CONTAINER_NAME --account-name $STORAGE_ACCOUNT_NAME --account-key $ACCOUNT_KEY | |
echo "storage_account_name: $STORAGE_ACCOUNT_NAME" | |
echo "container_name: $CONTAINER_NAME" | |
echo "access_key: $ACCOUNT_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment