0

我们有一个 PowerShell 脚本,它为每个部署在部署中涉及的每个 Azure Web 应用程序上创建一个槽。今天早上,我们的许多部署突然开始失败,但即使是相同的代码也在运行和部署。

开始失败的行:

$deploySlot = New-AzureRmWebAppSlot -ResourceGroupName "$ResourceGroupName" -Name "$($webapp.serviceApp)" -Slot "$slotName"

Resolve-AzureRmError -Last在命令周围添加了一个 try catch 并得到以下信息:

2018-10-17T06:35:06.0228046Z 
2018-10-17T06:35:06.0228769Z 
2018-10-17T06:35:06.0230563Z    HistoryId: 1
2018-10-17T06:35:06.0230703Z 
2018-10-17T06:35:06.0231161Z 
2018-10-17T06:35:06.0234999Z Message        : 'Location' cannot be null.
2018-10-17T06:35:06.0235402Z StackTrace     :    at Microsoft.Azure.Management.WebSites.Models.Resource.Validate()
2018-10-17T06:35:06.0235646Z                     at Microsoft.Azure.Management.WebSites.Models.Site.Validate()
2018-10-17T06:35:06.0268780Z                     at Microsoft.Azure.Management.WebSites.WebAppsOperations.<BeginCreateOrUpdateSlotWithHttpMessagesAs
2018-10-17T06:35:06.0269062Z                  ync>d__326.MoveNext()
2018-10-17T06:35:06.0269217Z                  --- End of stack trace from previous location where exception was thrown ---
2018-10-17T06:35:06.0269503Z                     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-10-17T06:35:06.0269658Z                     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-10-17T06:35:06.0301248Z                     at Microsoft.Azure.Management.WebSites.WebAppsOperations.<CreateOrUpdateSlotWithHttpMessagesAsync>d
2018-10-17T06:35:06.0302594Z                  __137.MoveNext()
2018-10-17T06:35:06.0304593Z                  --- End of stack trace from previous location where exception was thrown ---
2018-10-17T06:35:06.0306400Z                     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-10-17T06:35:06.0306724Z                     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-10-17T06:35:06.0312293Z                     at Microsoft.Azure.Management.WebSites.WebAppsOperationsExtensions.<CreateOrUpdateSlotAsync>d__265.
2018-10-17T06:35:06.0314813Z                  MoveNext()
2018-10-17T06:35:06.0314990Z                  --- End of stack trace from previous location where exception was thrown ---
2018-10-17T06:35:06.0315157Z                     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-10-17T06:35:06.0315321Z                     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-10-17T06:35:06.0315562Z                     at Microsoft.Azure.Commands.WebApps.Utilities.WebsitesClient.CreateWebApp(String 
2018-10-17T06:35:06.0315722Z                  resourceGroupName, String webAppName, String slotName, String location, String serverFarmId, 
2018-10-17T06:35:06.0315886Z                  CloningInfo cloningInfo, String aseName, String aseResourceGroupName)
2018-10-17T06:35:06.0316053Z                     at 
2018-10-17T06:35:06.0316261Z                  Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.NewAzureWebAppSlotCmdlet.ExecuteCmdlet()
2018-10-17T06:35:06.0316608Z                     at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
2018-10-17T06:35:06.0316902Z Exception      : Microsoft.Rest.ValidationException
2018-10-17T06:35:06.0317067Z InvocationInfo : {New-AzureRmWebAppSlot}
2018-10-17T06:35:06.0323731Z Line           :                 $deploySlot = New-AzureRmWebAppSlot -ResourceGroupName "$ResourceGroupName" -Name 
2018-10-17T06:35:06.0324841Z                  "$($webapp.serviceApp)" -Slot "$slotName"  
2018-10-17T06:35:06.0325059Z                  
2018-10-17T06:35:06.0325200Z Position       : At D:\a\r1\a\Cloud apps\AzureDeploy\Publish-WebApps.ps1:313 char:31
2018-10-17T06:35:06.0326182Z                  + ... eploySlot = New-AzureRmWebAppSlot -ResourceGroupName "$ResourceGroupN ...
2018-10-17T06:35:06.0326820Z                  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-10-17T06:35:06.0326981Z HistoryId      : 1
2018-10-17T06:35:06.0327103Z 

该命令在VSTS Azure PowerShell任务上执行。

我在 try catch 中添加了一个重试,它似乎总是适用于重试。有什么超时吗?

4

0 回答 0