Difference between Select-Azuresubscription -Default, Import-AzurePublishSettingsFile , Set-AzureSubscription

So which one should you use first .. Whether to set-azuresubscription and then Select-Azuresubscription.  This will be obvious for most of them. But there are number of people who do get confused between the two (That includes me).

So

Select-AzureSubscription will set the current subscription.
Select-AzureSubscription -Default

Why you should use Set-AzureSubscription vs Import-of Select-AzureSubscription.

The Select-Azuresubscription

When you export the settings using Get-AzurePublishSettingsFile , it exports file with all the subscriptions for the given account with Management Certificate. When you using Import-AzurePublishSettingsFile  store the details in the powershell files.

There will be scenarios , where there is no need to import the entire Subscription and Certificates, just only one subscription that’s where

accessible and installed locally in the user’s personal certificate store, or in the local machine’s personal certificate store.

Following command will create certificate file and store in the Local machine
makecert.exe -pe -n “CN=” -ss My –r .cer will create certificate.

Upload the Management Certificate
PS C:\ > $thumbprint = “xxxxxxxxxxxxxxxxxxxxxxxx”
# get the Management Certificate Thumbprint
PS C:\ > $mycert = Get-item Cert:\CurrentUser\My\$thumbprint
# retrieve the thumbprint from the Currentuser store

Use the Set-AzureSubscription cmdlet to store the management certificate associated with a subscription. The management certificates specified for a subscription must be

Set-Azuresubscription

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s