Creating containers and uploading files to Azure Blob storage using PowerShell
In this recipe, we will create a new container and upload files to Azure Blob storage using PowerShell.
Getting ready
Before you start, perform the following steps:
- Make sure you have an existing Azure storage account. If not, create one by following the Provisioning an Azure storage account using the Azure portal recipe.
- Log in to your Azure subscription in PowerShell. To log in, run the
Connect-AzAccount
command in a new PowerShell window and follow the instructions.
How to do it…
The steps for this recipe are as follows:
- Execute the following commands to create the container in an Azure storage account:
$storageaccountname="packtadestoragev2" $containername="logfiles" $resourcegroup="packtadestorage" #Get the Azure Storage account context $storagecontext = (Get-AzStorageAccount -ResourceGroupName $resourcegroup -Name $storageaccountname...