配置邮递员与Azure服务管理API通信

时间:2015-03-16 20:20:10

标签: azure postman

我正在尝试使用Postman Chrome应用程序对Microsoft Azure Service Management API进行REST调用。但是,我收到以下错误

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

这就是我所做的。

我创建了一个自签名证书。我将该证书上载到管理门户中的Azure证书存储区,并将其添加到Windows证书存储区中受信任的根证书颁发机构。但是,我仍然无法进行有效的API调用。有人可以引导我走上正确的道路。

2 个答案:

答案 0 :(得分:3)

最后我自己解决了。以下是步骤

1)使用Visual Studio命令提示符中的以下命令创建证书

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

2)在天蓝色管理门户的设置部分上传cer文件

3)将包含私钥的pfx文件导出到计算机上的某个位置。

4)将该pfx文件添加到受信任的根证书列表中的设置证书中的Chrome

5)使用Postman进行REST调用。

答案 1 :(得分:0)

@ csprabala的答案在my edit of his answer被拒绝时被加强了。积分转到@csprabala。

  1. 使用程序makecert创建证书。您可以在Visual Studio命令窗口或another location中找到它。运行此命令:

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

  2. 在Azure管理门户的设置部分上传<certname>.cer文件。

  3. 使用此命令创建包含私钥的<certname>.pfx文件(程序与1中的位置相同。):

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

  4. 将文件<certname>.pfx导入Windows用户证书存储区。您可以在Chrome&#34; HTTPS / SSL&#34;下的设置中执行此操作。 &GT; &#34;管理证书......&#34;。 &#34;个人&#34;证书商店是合适的。

  5. 使用Postman进行REST调用。