Getting a VHD into Azure with PoSh

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

I thought this would make a nice SQLNewBlogger post, an easy get started one. I used the docs from Microsoft as a guide, so here’s how it went.

Login to my account. I used Add-AzureRMAccount here to get the login dialog. I’m not repeating this for now, so this is just an interactive test.

2017-03-23 14_09_25-Sign in to your Microsoft account

Now I tried to create a storage account, but I hadn’t assigned a subscription. I didn’t think I needed to  since I only have one,but hey, I guess I do.

2017-03-23 14_11_36-cmd - powershell

I started typing Select-AzureSubscription, but realized I didn’t know what it was. I can’t remember naming this and under my name in the portal, I didn’t see a place to find it.

2017-03-23 14_13_22-Getting a VHD into Azure - Open Live Writer

Ah, under All Resources I see something, so I’ll try this.

2017-03-23 14_12_26-All resources - Microsoft Azure

On second thought, under My Permissions, I see it there.

2017-03-23 14_14_17-My permissions - Microsoft Azure

Or not

2017-03-23 14_14_41-cmd - powershell

Get-AzureSubscription doesn’t quite work.

2017-03-23 14_17_54-cmd - powershell

It’s Get-AzureRMSubscription

2017-03-23 14_19_02-cmd - powershell

So, why doesn’t my creation of the storage account work? I should really read error messages. The issue is Select-AzureSubscription fails because I need Select-AzureRMSubscription.

Sometimes the rev’ing of the cloud is hard.

Actually, maybe neither work.

2017-03-23 14_22_02-cmd - powershell

I retreat.

2017-03-23 14_23_59-cmd - powershell

I’m still annoyed. “US West” isn’t valid. FFS, Microsoft. Whether I type any of these, just ask me or process them.

  • “US West”
  • “West US”
  • “USWest”
  • “US_West”

OK, I decided to go exercise for a bit.

I’m back (30 minutes later), and I try Get-AzureLocation. I can guess some cmdlets. I get a lot of stuff back and see “West US” is valid. I try a few other valid names of regions, but get errors. It’s not that parameter.

Let’s try a new name.

2017-03-23 14_30_22-cmd - powershell

#$%#@#@# engineers and developers. That’s a valid error message? Not, this is a duplicate or something that makes sense. Glad I left.

Maybe not. At least this is an error that makes sense.

2017-03-23 14_31_27-cmd - powershell

Finally. Let’s upload the VHD.

2017-03-23 14_33_25-{0%} cmd - powershell

And it’s off.

2017-03-23 14_33_41-{0%} cmd - powershell

Hopefully this will work. I haven’t tried this with PoSh before, and it was somewhat frustrating, though it really didn’t take that long.


This was a bit of a live blog. Do something, take a screenshot, write some text. It was a bit of a learning experience.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , , . Bookmark the permalink.