Friday, September 19, 2014

How To Link your Microsoft Account to Azure Powershell

Today I was trying to get the WadConfig.xsd file via the Azure Powershell window with this command:

  1. (Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' 
  2. -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | 
  3. Out-File -Encoding utf8 -FilePath 'WadConfig.xsd' 
But, I received this error (shown below):  No current subscription has been designated.  Use Select-AzureSubscription -Current <subscriptionname> to set the current subscription.
 
I tried to execute Select-AzureSubscription, but no dice there, it wouldn't recognize that I had any Azure subscriptions. 
 
[insert frustration and thirty minutes of searching for a solution]
 
I finally found a hint in Powershell.  I was trying many different commands that I found, and I stumbled across this command:
 
Add-AzureAccount
 
I had, wrongly, assumed that Powershell would "just know" who I am based on the Microsoft Account with which I had logged in.  But, nope.  It turns out that my Microsoft Account has both an "organizational" and "personal" aspect.  I logged into my machine with the "personal" aspect account, and my Azure subscriptions are linked to my "organization" aspect.  Grrr.
 
So, after running the Add-AzureAccount command, I was prompted for my Microsoft Account credentials, entered my "organization" credentials and then voila my Azure subscriptions showed up!!!
 
Now that my Microsoft Account was associated with Powershell, I was able to run:
Set-AzureSubscription -SubscriptionId '{My Subscription Id from the list above}'
 
And then when I ran the command to get the WadConfig.xsd, it worked!
 
 

Wednesday, July 16, 2014

Browser Link and VS 2013 slowness

I recently updated my version of Visual Studio 2013 to include Update 2, and I noticed that the IDE was extremely slow when debugging web applications.  It was also extremely slow just trying to run the website from Visual Studio.  It was taking around 30 seconds to one minute to go from one line in the source code to the next.  Visual Studio was freezing almost every time that I would debug anything.

It turns out that a new, very cool feature in Visual Studio was also killing my development performance.  This new feature is Browser Link.  I noticed that a SignalR script was running whenever VS seemed frozen while debugging.  It turns out that Browser Link uses a SignalR channel for the IDE to communicate to your browser window while debugging. 

Anyway, disabling this feature cured the sluggishness in Visual Studio 2013.  To disable Browser Link, uncheck "Enable Browser Link" via the menu item with the refresh icon in Visual Studio, shown below:

I hope this helps someone, because it was driving me nuts until I found the culprit.