Uploading a file to blob storage in Azure
Powershell is a powerful interface to Azure, but the steps to do any given task are not obvious even from the documentation. Here is, for example, getting started with Azure to upload a file as a blob.
Powershell Azure Upload: (<something> is a slug to be replaced with real data)
//One time steps required to add Azure commandlets to Powershell
* Install-Module AzureRM //Note, must be done as Administrator prompt.
* Install-Module Azure //Note, must be done as Administrator prompt.
//One time per session, to connect to Azure
* Login-AzureRmAccount //Provide credentials for Azure portal in popup
//Typical flow to find the correct destination and upload
* Get-AzureRmSubscription //List subscriptions
* Get-AzureRmSubscription -SubscriptionName "<Full name from above results>" | Select-AzureRmSubscription //Select one as the default to operate
* Get-AzureRmContext //Verify settings, no storage account will display
* Set-AzureRmCurrentStorageAccount -ResourceGroupName "<resourcegroupname>" -StorageAccountName "<storageaccountname>"
* Get-AzureRmContext //Verify settings, storage account will be shown
* //Change to local directory
* Set-AzureStorageBlobContent -File "<localfiletotransfer>" -Container "<targetazureblobcontainer>"