简体   繁体   中英

Configuring Postman to talk to Azure Service Management API

I am trying to use Postman Chrome app to make REST calls against Microsoft Azure Service Management API. However, I get the following error

<Message>The server failed to authenticate the request. Verify that the  certificate is valid and is associated with this subscription.</Message>

Here is what I did.

I created a self signed certificate. I uploaded that certificate to Azure Certificate store in the management portal and added the same to the trusted root certification authorities in my windows certificate store. However, I can't still make a valid API call. Can someone guide me down the right path here.

Finally I solved it myself. Here are the steps

1) Create a certificate using the following command in your Visual Studio Command Prompt

makecert -sky exchange -r -n "CN=<certname>" -pe -a sha1 -len 2048 -ss My   <certname>.cer"

2) Upload the cer file in the settings portion of the azure management portal

3) Export a pfx file containing the private key to a location on your machine.

4) Add that pfx file to Chrome in settings certificates in trusted root certificates list

5) Make the REST call using Postman.

Enhancement of @csprabala's answer as my edit of his answer was rejected. Credits go to @csprabala.

  1. Create a certificate using the program makecert . You find it either in your Visual Studio command window or in another location . Run this command:

    makecert -sky exchange -r -n "CN=<certname>" -pe -a sha512 -len 2048 - sv "<certname>.pvk" "<certname>.cer"

  2. Upload the <certname>.cer file in the settings portion of the Azure management portal .

  3. Create a <certname>.pfx file containing the private key with this command (program is in the same location as in 1.):

    pvk2pfx.exe -pvk "<certname>.pvk" -spc "<certname>.cer" -pfx "<certname>. pfx"

  4. Import the file <certname>.pfx to the Windows user certificates store. You can do this in Chrome in the settings under "HTTPS/SSL" > "Manage Certificates ...". The "Personal" certificate store is appropriate.

  5. Make the REST call using Postman.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM