Who's Online
8 visitors online now
0 guests, 8 bots, 0 members
Support my Sponsor
  • An error has occurred, which probably means the feed is down. Try again later.

Azure Powershell Error No current subscription has been designated. Use Select-AzureSubscription – Current to set the current subscription

Hello Everyone, Today i was doing some testing and configuration on my Windows Azure server and got a weird error message as shown below:

Test-AzureStaticVNetIP : No current subscription has been designated. Use Select-AzureSubscription –
Current <subscriptionName> to set the current subscription.
At line:1 char:1
+ Test-AzureStaticVNetIP –VNetName test –IPAddress 11.0.0.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Test-AzureStaticVNetIP], ApplicationException
+ FullyQualifiedErrorId :
System.ApplicationException,Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.TestA
zureStaticVNetIPCommand

 

Did some research and found that we need to connect to Azure subscription and then run these command. To do so we need to download and install Azure Powershell. Copy paste below url on your browser and install the Web Platform Installer. This will give you option to download Azure Powershell.

http://go.microsoft.com/fwlink/p/?linkid=320376&clcid=0x409

0140

 

Once the Powershell is downloaded and installed, we will

0141

 

Now we will download the Azure Setting file to connect to the azure server. In the Azure Powershell, type below command.

Get-AzurePublishSettingsFile

0142

Once you login to your Azure website, you will get a file named “Visual Studio Premium with MSDN-date-credentials.publishsettings”. Save it to a secure location. This file contains secure credentials and additional information about subscriptions that you can use in your development environment.

 

Now Import the Azure Settings file to Powershell. Run “Import-AzurePublisingSettingsFile” and then type path of the file we just downloaded as shown in below image

0143

 

 

To check Subscription details run below command

Get-AzureSubscription

0144

 

 

Now the command completed successfully.

 

Comments are closed.