绑定参数'StorageContext'中的问题

当使用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 char:71 + $ config2 = New-AzureServiceDiagnosticsExtensionConfig -StorageContext $ storageCo ... + ~~~~~~~~~~ + CategoryInfo: InvalidArgument:(:) [New-AzureServic ... ExtensionConfig],ParameterBindingException + FullyQualifiedErrorId:CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.NewAzureServiceDiagnosticsEx tensionConfigCommand

它在本地工作,但不在虚拟机中工作。


这似乎是Azure.Storage中版本不兼容的问题。 在虚拟机中,Azure Powershell模块的版本是4.0.1,在我的本地3.4.0版本中。 我已经从下面给出的链接中卸载并安装了3.4.0的VM,并且它运行良好。

https://www.powershellgallery.com/packages/Azure/3.4.0

链接地址: http://www.djcxy.com/p/37887.html

上一篇: Issue in bind parameter 'StorageContext'

下一篇: Object and HTML Output Issue