Creating containers and uploading files to Azure Blob storage using PowerShell
In this recipe, we'll create a new container and will 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 PowerShell 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="packtadestorage" $containername="logfiles" $resourcegroup="packtade" #Get the Azure Storage account context $storagecontext = (Get-AzStorageAccount -ResourceGroupName $resourcegroup -Name $storageaccountname...