Issue in bind parameter 'StorageContext'

I am facing the problem when AzureStorageContext retrieved using New-AzureStorageContext command is incompatible with New-AzureServiceDiagnosticsExtensionConfig input parameters.

$storageContext = New-AzureStorageContext –StorageAccountName $storage_AccountName –StorageAccountKey $storage_Key

$config2 = New-AzureServiceDiagnosticsExtensionConfig -StorageContext $storageContext -DiagnosticsConfigurationPath $configuration_FilePath_EventHubListener -role $workerRole_WorkerRoleName

Error: New-AzureServiceDiagnosticsExtensionConfig : Cannot bind parameter 'StorageContext'. Cannot convert the "Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext" value of type "Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext" to type "Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext". At C:BuildBuildScriptsAzurePowershell_V1.3.8-DeployeAndDiagnosticsDeployeAndDiagnosticsNewPowershell.ps1:90 char:71 + $config2 = New-AzureServiceDiagnosticsExtensionConfig -StorageContext $storageCo ... + ~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-AzureServic...ExtensionConfig], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions.NewAzureServiceDiagnosticsEx tensionConfigCommand

It is working in local but not in the Virtual machine.


It seems the issue is version incompatibility in Azure.Storage. The version of Azure Powershell module is 4.0.1 in the VM, in my local it 3.4.0. I have uninstalled and installed 3.4.0 in VM from the link given below and it worked well.

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

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

上一篇: 如何使用Python通过HTTP下载文件?

下一篇: 绑定参数'StorageContext'中的问题