你好我試圖使Web角色的診斷,從而使Web角色診斷,但是當運行腳本,我得到了以下錯誤 https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-diagnostics無法使用PowerShell
$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
集-AzureServiceDiagnosticsExtension:不能綁定參數 'StorageContext'。不能 型「Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext」的 「Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext」值轉換爲 型 「Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext」。 在E:\ TK_Backup \ Drive \ PowerShell腳本\啓用Web角色 Diagnostics.ps1:6 char:54 + ... reServiceDiagnosticsExtension -StorageContext $ storageContext -Diagno ... + ~~~~~~~~~ ~~~~~~ + CategoryInfo:InvalidArgument:(:) [設置AzureServiceDiagnosticsExtension],ParameterBindingException + FullyQualifiedErrorId:CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.SetAzureServiceDiagnosticsExtensionCommand