By using AzurePowershell command we can create Azure
StorageAccount,Container and we can upload BLOB to Azure.
New-AzureRmStorageAccount `
-ResourceGroupName 20533D0101-LabRG `
-Name "bookch4pss" `
-Location "eastus" `
-SkuName Standard_LRS `
-Kind Storage
#Get teh key of StorageAccount
$mystorekey=(Get-AzureRmStorageAccountKey `
-ResourceGroupName 20533D0101-LabRG `
-Name $StorageAccountName)
$mystorekey.value
#Variable declarations for StorageAccountName and
StorageAccountKey
$StorageAccountName="bookch4pss"
$StorageAccountKey="Provide the second value from above $mystorekey"
#Definig storage account context using storage account name
$ctx=New-AzureStorageContext `
-StorageAccountName $StorageAccountName `
-StorageAccountKey $StorageAccountKey
#Need to create a value and name to the container
$ContainerName="test-ps"
#Create a new container with public access to the blobs
New-AzureStorageContainer `
-Name $ContainerName `
-Context $ctx `
-Permission Blob
Comments