我正在使用最新的Azure Powershell,并在运行以下代码部署模板时开始收到此错误:
New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
-ResourceGroupName $ResourceGroupName `
-TemplateFile $TemplateFile `
-Mode $DeploymentMode `
@OptionalParameters `
-Force -Verbose -ErrorAction Stop
导致此错误:
VERBOSE: 7:34:35 PM - Template is valid.
VERBOSE: 7:34:35 PM - Create template deployment 'MyDeployment-0615-2331'
VERBOSE: 7:34:35 PM - Checking deployment status in 5 seconds
Microsoft.Rest.Azure.CloudException: Deployment 'MyDeployment-0615-2331' could not be found.
at Microsoft.Azure.Management.ResourceManager.DeploymentOperationsOperations.<ListWithHttpMessagesAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.DeploymentOperationsOperationsExtensions.<ListAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.DeploymentOperationsOperationsExtensions.List(IDeploymentOperationsOperations operations, String resourceGroupName, String deploymentName, Nullable`1 top)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient.ResourceManagerSdkClient.WriteDeploymentProgress(String resourceGroup, String deploymentName, Deployment deployment)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient.ResourceManagerSdkClient.WaitDeploymentStatus(String resourceGroup, String deploymentName, Deployment basicDeployment, Action`3 job, ProvisioningState[] status)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient.ResourceManagerSdkClient.ProvisionDeploymentStatus(String resourceGroup, String deploymentName, Deployment deployment)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkClient.ResourceManagerSdkClient.ExecuteDeployment(PSCreateResourceGroupDeploymentParameters parameters)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
这对我来说没有任何意义,因为它不应该寻找现有的部署,它应该创建一个新部署。从未在Azure中创建部署。
这是一个间歇性的问题,不会一直发生,但很频繁。