Linux和Mac上的Azure CLI:证书问题

时间:2016-07-05 19:44:48

标签: linux macos azure kubernetes azure-cli

我正在尝试在Azure上关注Kubernetes的this官方教程。我在Mac和Linux上都试过了。

我可以使用我的公司帐户从CLI成功登录,但是当我在输出结尾处运行./create-kubernetes-cluster.js时,我看到

info:    Executing command network vnet create
info:    Using default address space cidr: 12
info:    Using default subnet start IP: 172.16.0.0
info:    Using default subnet cidr: 15
+ Looking up network configuration
error:   The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
info:    Error information has been recorded to /home/dds/.azure/azure.err
error:   network vnet create command failed

这是什么证书?它来自哪里?

以下是azure.err

[Error: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.]
  stack: [Getter/Setter],
  code: 'ForbiddenError',
  statusCode: 403,
  __frame:
   { name: 'get__3',
     line: 47,
     file: '/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/lib/commands/asm/network/networkConfig.js',
     prev:
      { name: 'create__1',
        line: 34,
        file: '/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/lib/commands/asm/network/virtualNetwork.js',
        prev: [Object],
        calls: 1,
        active: false,
        offset: 4,
        col: 43 },
     calls: 0,
     active: false,
     offset: 4,
     col: 59 },
  rawStack: [Getter] }
Error: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
  <<< async stack >>>
  at get__3 (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/lib/commands/asm/network/networkConfig.js:51:60)
  at create__1 (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/lib/commands/asm/network/virtualNetwork.js:38:44)
  at __6 (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/lib/commands/asm/network/network.js:125:22)
  <<< raw stack >>>
    at Function.ServiceClient._normalizeError (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/lib/services/serviceclient.js:815:23)
    at /home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/lib/services/filters/errorhandlingfilter.js:44:29
    at Request._callback (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/lib/http/request-pipeline.js:109:14)
    at Request.self.callback (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/node_modules/request/request.js:199:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/node_modules/request/request.js:1160:14)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/home/dds/k8s/src/kubernetes/docs/getting-started-guides/coreos/azure/node_modules/azure-cli/node_modules/azure-common/node_modules/request/request.js:1111:12)

你能告诉我怎么解决这个问题?

更新

我为Azure支持创建了一张票,他们告诉我:

  

我发现大多数资源提供商都没有为您注册   订阅。通过门户网站注册完成部署(第一次)   资源提供程序自动,但如果它通过PowerShell或CLI   我们必须注册这些(一次性活动)
  https://azure.microsoft.com/en-in/documentation/articles/azure-cli-arm-commands/

     

请运行这些cmdlet以注册提供商&amp;然后重试   部署

azure provider register –namespace Microsoft.Network
azure provider register –namespace Microsoft.Compute 
azure provider register –namespace Microsoft.ContainerService 
azure provider register –namespace Microsoft.ResourceHealth 
azure provider register –namespace Microsoft.Storage

我成功执行了这些命令,但结果仍然相同。

1 个答案:

答案 0 :(得分:0)