Author : MD TAREQ HASSAN | Updated : 2020/10/21
Introduction
- A unique namespace for Azure Storage data
- Contains all of Azure Storage data objects (blobs, files, queues, tables and disks)
- Every object that you store in Azure Storage has an address that includes (unique) account name
- Links
Kinds of storage account
There are several kinds of storage accounts with different features and pricing model
- General-purpose v2 accounts: Basic account type (recommended for most scenarios)
- General-purpose v1 accounts: Legacy account type (general-purpose v2 accounts should be used when possible)
- BlockBlobStorage accounts: Premium performance for block blobs and append blobs (high transactions rates, low storage latency)
- BlobStorage accounts: Legacy Blob-only storage accounts (general-purpose v2 accounts should be used when possible)
- FileStorage accounts: Files-only storage accounts
Create general purpose storage account using PowerShell
Login to Azure Portal using default browser
- Taskbar search > Write “default apps” > Default apps settings > Web browser section
- Set Chrome as default browser (set browser of your choice if you want)
- Now open your dafault browser > login to Azure portal
#
# Connect to Azure
#
Connect-AzAccount
# to login from VM using managed identity: Connect-AzAccount -Identity
#
# Azure PowerShell uses Azure PowerShell context objects (Azure contexts) to hold subscription and authentication information.
# If you have more than one subscription, Azure contexts let you select the subscription to run Azure PowerShell cmdlets on
#
# https://docs.microsoft.com/en-us/powershell/azure/context-persistence
#
#
# Check available context
#
Get-AzContext -ListAvailable
#
# Check current context
#
Get-AzContext
#
# Set current context if needed
#
# https://docs.microsoft.com/en-us/powershell/module/az.accounts/set-azcontext
#
Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"
#
# Set variables and create storage account
#
# To remove account: Remove-AzStorageAccount -Name <storage-account> -ResourceGroupName <resource-group>
# https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-powershell
#
$resourceGroupName = "xxx"
$storageAccountName = "xxx"
$storageAccountLocation = "japaneast"
$storageAccountSku = "Standard_RAGZRS"
$storageAccountKind = "StorageV2"
New-AzStorageAccount `
-ResourceGroupName $resourceGroupName `
-Name $storageAccountName `
-Location $storageAccountLocation `
-SkuName $storageAccountSku `
-Kind $storageAccountKind
#
# To create a container in storage account, storage account context is needed
#
$storageAccountContext = (Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName).Context
#
# Set variables and create container
#
# -Permission Off -> private access only, but SAS token will bypass this restriction
# https://docs.microsoft.com/en-us/powershell/module/azure.storage/new-azurestoragecontainer
# https://build5nines.com/azure-powershell-create-azure-storage-account-and-containers/
#
$containerName = "xxx-yyy"
New-AzStorageContainer `
-Name $containerName `
-Context $storageAccountContext `
-Permission Off
Create general purpose storage account using Azure Portal
Create Resource Group:
- Go to: https://portal.azure.com/#create/Microsoft.ResourceGroup (login to Azure portal first, then click the link)
- Fillup details (i.e. name ‘
demo-rg
’, select subscription etc.) - Create
Steps to create storage account:
- Go to: https://portal.azure.com/#create/Microsoft.StorageAccount
- Fillup details (Basics, netwroking, advanced etc.)
- In Basics => Storage kind: Storage V2 (General purpose V2)
- Create and review > Create
Create blob storage account in Azure Portal
Create Resource Group:
- Go to: https://portal.azure.com/#create/Microsoft.ResourceGroup (login to Azure portal first, then click the link)
- Fillup details (i.e. name ‘
demo-rg
’, select subscription etc.) - Create
Steps to create storage account:
- Go to: https://portal.azure.com/#create/Microsoft.StorageAccount
- Fillup details (Basics, netwroking, advanced etc.)
- In Basics => Storage kind: BlobStorage
- Create and review > Create