【问题标题】:New-AzureStorageAccount PowerShell command never returnsNew-AzureStorageAccount PowerShell 命令永远不会返回
【发布时间】:2013-11-08 19:47:07
【问题描述】:

我正在尝试使用以下命令创建一个新的 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 作业需要比平时更长的时间)。有谁知道为什么命令没有正常返回?

【问题讨论】:

    标签: powershell azure


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-15
      • 2011-07-25
      • 1970-01-01
      • 2012-10-02
      • 2013-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多