0
列出的网络空间,我只是在为一些工作,我标题进入准备与Azure的REST API的实验过程中,当403 ...尝试通过Azure的网站管理REST API
在节点。 JS我试图获取通过下面的代码我的订阅托管网站空间的列表...
var websiteOptions = {
hostname: 'management.core.windows.net',
path: '/<<Subscription-ID>>/services/webspaces',
method: 'GET',
pfx: new Buffer(managementCert, 'base64'),
strictSSL: true,
headers: {
'x-ms-version': '2013-06-01'
}
};
websiteOptions.agent = new https.Agent(websiteOptions);
var request = https.request(websiteOptions,function(res){
console.log('Status Code:', res.statusCode);
console.log('Headers:', res.headers);
执行时它返回..
<Error xmlns="http://schemas.microsoft.com/windowsazure"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>AuthenticationFailed</Code>
<Message>The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
</Message>
</Error>
奇怪的是,如果我更换..
/<<subscription-ID>>/services/webspaces
与...
/<<subscription-ID>>/services/hostedservices
那个特定呼叫用得好好的,回来的托管服务列表 - 所以这使我相信,我的编码/连接我的管理证书正确。
我已经尝试过各种api版本,但没有多少运气,我也读过这个article的各个部分,但没有多少运气。
那么,为什么我的凭据在API的一个部分工作,而不是websties部分
我缺少什么,我敢肯定,这是很简单的东西:|