【问题标题】:Set-AzureServiceDiagnosticsExtension fails with "Deployment not found in service"Set-AzureServiceDiagnosticsExtension 因“服务中未找到部署”而失败
【发布时间】:2016-07-06 17:03:01
【问题描述】:

我正在尝试使用以下命令更新 Azure 云服务的诊断配置...

$storage = New-AzureStorageContext -StorageAccountName {storageName} -StorageAccountKey {storage key}
Set-AzureServiceDiagnosticsExtension -ServiceName MyCloudServiceName -StorageContext $storage -Role {my role name} -Slot Production -DiagnosticsConfigurationPath MyWorkerRoleContent\diagnosticsUAT.wadcfgx

失败并出现以下错误...

Set-AzureServiceDiagnosticsExtension:在中找不到部署 服务:MyCloudServiceName 和插槽:生产。在行:1 字符:1 + 设置 AzureServiceDiagnosticsExtension -ServiceName MyCloudServiceName ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:未指定:(:) [Set-AzureServiceDiagnosticsExtension],异常 + FullyQualifiedErrorId : System.Exception,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureSe rviceDiagnosticsExtensionCommand

我实际上已经使用完全相同的命令取得了成功,但使用了另一个 azure 订阅(以及明显不同的云服务名称和密钥)。我尝试创建一个暂存槽并在暂存槽上使用该命令。我也试过完全省略这个插槽,结果都是一样的。

有没有人遇到过这个问题并且对如何纠正它有任何见解?

【问题讨论】:

    标签: azure azure-worker-roles azure-cloud-services azure-diagnostics azure-application-insights


    【解决方案1】:

    此问题也已发布在 GitHub 上并已解决,请参见此处: https://github.com/Azure/azure-powershell/issues/2538#issuecomment-229822864

    【讨论】:

    • 是的,我知道...我发布了...我应该回答我自己的问题。
    【解决方案2】:

    该问题与在 PowerShell 中注册了多个 Azure 订阅有关。

    当您运行 Add-AzureAccount 时,PowerShell 会永久保留凭据。您可以关闭 PowerShell、注销机器、将其关闭等,PowerShell 保留对订阅的访问权限。这是我没有意识到的。

    同样在运行 Add-AzureAccount 后,如果已经注册了其他订阅,则在使用 Select-AzureSubscription 将其选为默认订阅之前,您将无法访问已添加订阅中的资源。

    【讨论】:

      猜你喜欢
      • 2014-01-09
      • 1970-01-01
      • 1970-01-01
      • 2015-12-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-09
      • 1970-01-01
      • 2011-02-12
      相关资源
      最近更新 更多