如何使用powershell azure API来了解服务繁忙的原因

时间:2017-12-19 15:01:26

标签: powershell azure

我们使用

中定义的powershell API

发布 - AzureServiceProject

https://docs.microsoft.com/en-us/powershell/module/azure/publish-azureserviceproject?view=azuresmps-4.0.0

然而,我们发现呼叫挂起。即服务器。然后我们去了azure portal,发现我们在部署中缺少一个dll。这本身并不是什么大问题,但为什么调用发布-AzlanServiceProject挂起而不是错误?

enter image description here

给出的实际命令是

[15:52:36][PublishAzureWebsite] Publish-AzureServiceProject -Package 'C:\tca\tick\712fd6c47ab9a6e5\azurewebsite\Weingartner.Distribution.Azure.cspkg' -Slot Staging -Configuration 'C:\tca\tick\712fd6c47ab9a6e5\azurewebsite\ServiceConfiguration.Cloud.cscfg'

然后生成

[15:52:37][PublishAzureWebsite] [powershell] For a list of all Azure cmdlets type 'get-help azure'.
[15:52:37][PublishAzureWebsite] [powershell] For a list of Windows Azure Pack cmdlets type 'Get-Command *wapack*'.
[15:52:41][PublishAzureWebsite] [powershell] 
[15:53:17][PublishAzureWebsite] [powershell] Id                                       Type Subscriptions                        Tenants                             
[15:53:17][PublishAzureWebsite] [powershell] --                                       ---- -------------                        -------                             
[15:53:17][PublishAzureWebsite] [powershell] research@weingartnergmbh.onmicrosoft.com User XXXXXXXXX XXXXXXXXXX...
[15:53:17][PublishAzureWebsite] [powershell]                                                                                                                        
[15:53:19][PublishAzureWebsite] [powershell] WARNING: 15:53:19 - Verifying storage account 'weingartnerdistribution'...
[15:53:20][PublishAzureWebsite] [powershell] WARNING: Publishing weingartnerdistribution to Microsoft Azure. This may take several minutes...
[15:53:20][PublishAzureWebsite] [powershell] WARNING: 15:53:20 - Connecting...
[15:53:22][PublishAzureWebsite] [powershell] WARNING: 15:53:22 - Uploading Package to storage service weingartnerdistribution...
[15:53:59][PublishAzureWebsite] [powershell] WARNING: 15:53:59 - Starting...
[15:55:05][PublishAzureWebsite] [powershell] WARNING: 15:55:05 - Created Deployment ID:XXXXXXXXXXXXXXXXXXXXXXXX .
[15:55:05][PublishAzureWebsite] [powershell] WARNING: 15:55:05 - Initializing...

然后挂起。然后这会阻止我们的CI管道,对于日志记录器来说,出现问题并不明显。是否有可能使门户中显示的诊断对powershell脚本可用?

1 个答案:

答案 0 :(得分:0)

您可以使用以下cmdlet。

Get-AzureWebSiteLog -Name webappname -Tail

您也可以下载部署日志。

Save-AzureWebSiteLog -Name webappname

更多信息请参阅此link