Using PowerShell to move files to Azure Storage

Azure, PowerShell
I was searching all over the place to try to find out how to move files into Azure Storage. Most of the examples I could track down were for API calls through C#. There were very few examples using PowerShell, and most of those were for older versions of Azure. But, the one thing I've learned about Azure, it's a fast moving target. Sure enough, in March there were new PowerShell blob cmdlets released. This is great news. I was able to get this to work: [System.Reflection.Assembly]::LoadFrom("C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\bin\Microsoft.WindowsAzure.StorageClient.dll") $account = [Microsoft.WindowsAzure.CloudStorageAccount]::Parse("DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=mykey") $client = [Microsoft.WindowsAzure.StorageClient.CloudStorageAccountStorageClientExtensions]::CreateCloudBlobClient($account) $blob = $client.GetBlockBlob('container\adw.bacpac') $blob.UploadFile("c:\bu\adw.bacpac") But let's face it, this code makes more sense and is a heck of lot easier to write: $context = New-AzureStorageContext -StorageAccountName mystorage -StorageAccountKey mykey Set-AzureStorageBlobContent -Blob "adw.bacpac" -Container…
Read More

Powershell Blog Worth Reading

PowerShell
I don't usually make a big deal about my blog roll. I usually add either people I read regularly or people who ask to be added. I don't have a hierarchy of belonging & all that (yet). But I want to point out one that I just recently put up. Chad Miller, creator of SQL Server PowerShell Extension, blogs about SQL Server & PowerShell. If you're not already reading his stuff, you should. Unlike me, he really knows what he's talking about.
Read More