【发布时间】:2017-09-23 02:28:06
【问题描述】:
当使用 New-AzureStorageContext 命令检索的 AzureStorageContext 与 New-AzureServiceDiagnosticsExtensionConfig 输入参数不兼容时,我遇到了问题。
$storageContext = New-AzureStorageContext –StorageAccountName $storage_AccountName –StorageAccountKey $storage_Key
$config2 = New-AzureServiceDiagnosticsExtensionConfig -StorageContext $storageContext -DiagnosticsConfigurationPath $configuration_FilePath_EventHubListener -role $workerRole_WorkerRoleName
错误:New-AzureServiceDiagnosticsExtensionConfig:无法绑定 参数“StorageContext”。无法转换 “Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext”的值 键入“Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext”到 类型 “Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext”。 在 C:\Build\BuildScripts\AzurePowershell_V1.3.8-DeployeAndDiagnostics\DeployeAndDiagnosticsNewPowershell.ps1:90 字符:71 + $config2 = New-AzureServiceDiagnosticsExtensionConfig -StorageContext $storageCo ... + ~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-AzureServic...ExtensionConfig],ParameterBindingException +fullyQualifiedErrorId:CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.NewAzureServiceDiagnosticsEx 张力配置命令
它在本地工作,但不在虚拟机中。
【问题讨论】:
-
如果可以,请将解决方案粘贴到答案中并接受。完全可以回答您自己的问题!
标签: powershell azure