【发布时间】:2017-10-06 13:55:45
【问题描述】:
您好,我正在尝试启用 Web 角色的诊断,但运行脚本时出现以下错误 https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-diagnostics
$storage_name = "testdeploy"
$key = "keyvalue"
$config_path="E:\Tempvs\AzureCloudService3\AzureCloudService3\bin\Release\app.publish\Extensions\PaaSDiagnostics.MvcWebRole1.PubConfig.xml"
$service_name="testmyjsdiag"
$storageContext = New-AzureStorageContext -StorageAccountName $storage_name -StorageAccountKey $key
Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $config_path -ServiceName $service_name -Slot Production -Role MvcWebRole1
Set-AzureServiceDiagnosticsExtension:无法绑定参数 '存储上下文'。无法转换 “Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext”的值 键入“Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext”到 类型 “Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext”。 在 E:\TK_Backup\Drive\PowerShell 脚本\启用 Web 角色 诊断.ps1:6 字符:54 + ... reServiceDiagnosticsExtension -StorageContext $storageContext -Diagno ... +~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-AzureServiceDiagnosticsExtension], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServiceDiagnosticsExtensionCommand
【问题讨论】:
标签: powershell azure-web-roles azure-powershell