Reputation: 27
I am new to Azure. I want to create a powershell script which can create a blob storage in azure and add a container. I have been through so many articles but none of them are much helpful. Can anyone help on this. Thanks in advance.
Upvotes: 0
Views: 1593
Reputation: 72211
Get-AzLocation | select Location
$location = "eastus"
$resourceGroup = "myResourceGroup"
New-AzResourceGroup -Name $resourceGroup -Location $location
$storageAccount = New-AzStorageAccount -ResourceGroupName $resourceGroup `
-Name "mystorageaccount" `
-SkuName Standard_LRS `
-Location $location `
$ctx = $storageAccount.Context
$containerName = "quickstartblobs"
new-AzStoragecontainer -Name $containerName -Context $ctx -Permission blob
Upvotes: 3