Azure PowerShell manages multiple subscriptions and certificates

Source: Internet
Author: User
Tags certificate fingerprint

Since my computer had managed two azure subscriptions, there were "no storage accounts found" and "certificate mismatch" issues in uploading VHD files to Azure in two days.

Scene restore

The first day you uploaded the VHD using Azure account A, no problem occurred. The next day you upload a VHD using Azure account B, the following prompt appears: "The storage accounts is not found"

650) this.width=650; "height=" 169 "title=" clip_image001 "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none, "alt=" clip_image001 "src=" http://img1.51cto.com/attachment/201410/15/ 2326359_1413368198igfe.jpg "border=" 0 "/>

Check Azure management again to make sure the storage account "Uploadtest" exists. Let's take a look at the storage account <get-azurestorageaccount> The result is "No certificate is found in the certificate store with thumbprint"

650) this.width=650; "height=" 187 "title=" clip_image001[9] "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none; "alt=" clip_image001[9] "src=" http://img1.51cto.com/attachment/201410/15/ 2326359_141336819843gb.jpg "border=" 0 "/>

Problem analysis

A. I recently managed two Azure accounts using Azure PowerShell, possibly with an incorrect azure account identification;

B. PowerShell does not need to enter the Azure account information when executing the command, then the local computer must have saved the information about the Azure account;

C. During all operations, only the certificate has been downloaded from Azure and installed on the local computer, and there is a problem with the certificate being prompted.

Resolution procedure 1. View certificates

At the beginning of the operation, I used <Import-AzurePublishSettingsFile> to import the certificate downloaded from Azure. This certificate is stored in the current user's personal directory

650) this.width=650; "height=" 415 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368199sqvp.png "border=" 0 "/>

2. View the azure subscriptions that are associated with this agency

Command <Get-AzureSubscription>

You can see that there are two different azure subscriptions for "1RMB Trail offer" and "free Trial", while the Defaultaccount value of "1RMB trail" with the above hint "No certificate is found in the Certificate store with thumbprint "certificate fingerprint exactly matches. The other two properties of "1RMB Trail offer", IsDefault and Iscurrent, are true, as opposed to "free trial", which is the "1RMB Trail offer" for both the default and current active subscriptions.

650) this.width=650; "height=" 449 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368199coxg.png "border=" 0 "/>

So, the question is, I need to manage the subscription "free trial" now, what should I do?

3. Select Azure Subscription

Command <Select-AzureSubscription>

After execution, you can see that the iscurrent value of subscribing to "1RMB Trail offer" and "free trial" becomes swapped, i.e. the current active subscription becomes "free Trial"

650) this.width=650; "height=" 625 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368200shcv.png "border=" 0 "/>

4. View the storage account again

Check the storage account again, found that the properties are normal, I want to manage the

650) this.width=650; "height=" 702 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368200ueq8.png "border=" 0 "/>

5. Uploading a VHD file

Finally can be uploaded normally, you can see the progress

650) this.width=650; "height=" 675 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368201zygp.png "border=" 0 "/>

Episode-Certificate Fingerprint update

For the hint "No certificate is found in the certificate store with thumbprint", there is another episode.

When I manage my subscription "free trial" account, I generate too many certificates, from which 3 certificate fingerprints can be found. And my computer retains only the last certificate (fingerprint ea1aed), but the default certificate associated with Azure's subscription is the first one (the certificate fingerprint 263b87), see

650) this.width=650; "height=" 399 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 14133682015r04.png "border=" 0 "/>

When I am uploading the VHD, I also have a certificate error, see

650) this.width=650; "height=" 354 "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368201v3v0.png "border=" 0 "/>

Workaround, update the default certificate thumbprint associated with the subscription

Command

< $mycert = Get-item cert:\currentuser\my\ Certificate fingerprint >

<set-azuresubscription-subscriptionname "Subscription name"-certificate $mycert >

When finished, the results are as follows

650) this.width=650; "height=" "title=" image "style=" Border:0px;padding-top:0px;padding-right:0px;padding-left : 0px;background-image:none; "alt=" image "src=" http://img1.51cto.com/attachment/201410/15/2326359_ 1413368202hw7t.png "border=" 0 "/>

This article concludes

This article is from the "Red Dust" blog, please be sure to keep this source http://hongc.blog.51cto.com/2326359/1564523

Azure PowerShell manages multiple subscriptions and certificates

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.