0

我正在尝试使用以下命令创建一个新的 Azure 存储帐户:

PS> New-AzureStorageAccount -StorageAccountName 'newstoragerobower' -Location 'West US' -Description 'Test account for automation VMs' -Label 'AutomationStorageAccount'

然而,它永远不会回来。它成功创建了存储帐户(通过 Azure 管理控制台验证)。我可以使用一种解决方法让它返回,我将它作为一项工作启动,然后在超时的情况下调用 Wait-Job,因此:

PS> $job = Start-Job -Name myName -Command { $storageAcct = New-AzureStorageAccount -StorageAccountName 'newstoragerobower' -Location 'West US' -Description 'Test account for automation VMs' -Label 'AutomationStorageAccount' }
PS> Wait-Job $job -Timeout 20

充其量,这会给我的脚本增加不必要的延迟,最坏的情况是它可能导致作业中止执行(有时 Azure 作业需要比平时更长的时间)。有谁知道为什么命令没有正常返回?

4

1 回答 1

0

您可以尝试使用 -Debug 选项运行,或者将 $DebugPreference 设置为 Continue 吗?创建存储帐户通常不是这种情况,想了解产生此问题的订阅有何不同。

于 2013-11-08T23:29:21.287 回答