gpt4 book ai didi

powershell - 绑定(bind)参数 'StorageContext' 出现问题

转载 作者:行者123 更新时间:2023-12-03 03:03:49 29 4
gpt4 key购买 nike

当使用 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

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

它可以在本地运行,但不能在虚拟机中运行。

最佳答案

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

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

关于powershell - 绑定(bind)参数 'StorageContext' 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46351948/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com