Q. How do I retrieve a storage context to an ARM storage account?
A. Azure Resource Manager handles resources very differently from Azure Service Manager however for PowerShell cmdlets that use a storage context based on the storage account key (or using a shared access signature (SAS)) and the storage account name. The PowerShell below fetches the storage account key and creates a context that could then be used for any storage cmdlet that uses contexts such as copy operations and Azure Files.
$AzStorAccName = 'savtechsalrsscus' $AzResGroup = 'rg-scusa' $AzStrAct = Get-AzureRmStorageAccount -Name $AzStorAccName -ResourceGroupName $AzResGroup $AzStrKey = Get-AzureRmStorageAccountKey -Name $AzStorAccName -ResourceGroupName $AzResGroup $AzStrCtx = New-AzureStorageContext $AzStorAccName -StorageAccountKey $AzStrKey.Value #Example creation of Azure Files share with the storage context created $imgs = New-AzureStorageShare imgs -Context $AzStrCtx