1
votes

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:\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

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

1
If you can, please paste the solution into an answer and accept it. It's totally OK to answer your own questions! - Persistent13

1 Answers

1
votes

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