我尝试使用git-bash(在Windows上)在azure中部署nodejs webapp。当我执行以下命令(项目符号5)时,我跟随following tutorial并卡住了azure site create --git {appname}
。我得到以下输出:
info: Executing command site create
error: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
error: Error information has been recorded to C:\Users\myname\.azure\azure.err
error: site create command failed
无法在线找到有关如何解决此问题的明确解决方案......
修改:以下是错误文件内容:
2016-12-01T13:49:38.217Z:
{ Error: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
<<< async stack >>>
at getSites__7 (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\websites\websitesclient.js:460:24)
at determineIfSiteAndSlotExists (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\site.js:282:30)
at __4 (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\site.js:229:11)
<<< raw stack >>>
at Function.ServiceClient._normalizeError (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\services\serviceclient.js:814:23)
at C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\services\filters\errorhandlingfilter.js:44:29
at Request._callback (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\http\request-pipeline.js:109:14)
at Request.self.callback (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:1044:10)
at emitOne (events.js:101:20)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:965:12)
stack: [Getter],
code: 'ForbiddenError',
statusCode: 403,
__frame:
{ name: 'getSites__7',
line: 455,
file: 'C:\\Users\\myname\\AppData\\Roaming\\npm\\node_modules\\azure-cli\\lib\\commands\\asm\\websites\\websitesclient.js',
prev:
{ name: 'determineIfSiteAndSlotExists',
line: 280,
file: 'C:\\Users\\myname\\AppData\\Roaming\\npm\\node_modules\\azure-cli\\lib\\commands\\asm\\site.js',
prev: [Object],
calls: 1,
active: false,
offset: 2,
col: 29 },
calls: 0,
active: false,
offset: 5,
col: 23 },
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 getSites__7 (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\websites\websitesclient.js:460:24)
at determineIfSiteAndSlotExists (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\site.js:282:30)
at __4 (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\lib\commands\asm\site.js:229:11)
<<< raw stack >>>
at Function.ServiceClient._normalizeError (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\services\serviceclient.js:814:23)
at C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\services\filters\errorhandlingfilter.js:44:29
at Request._callback (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\azure-common\lib\http\request-pipeline.js:109:14)
at Request.self.callback (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:1044:10)
at emitOne (events.js:101:20)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (C:\Users\myname\AppData\Roaming\npm\node_modules\azure-cli\node_modules\request\request.js:965:12)
答案 0 :(得分:1)
希望以下步骤有所帮助。
1,切换到ASM模式并在Azure CLI下登录Azure:
azure config mode asm
azure login
2,使用以下命令下载您的订阅文件:
azure account download
3,运行以下命令导入已下载的订阅文件:
azure account import 'C:\Users\me\Downloads\xxx.publishsettings'
4,创建一个使用Git存储库初始化的新Web应用程序:
azure site create --git {appname}