gpt4 book ai didi

powershell - 设置-AzureServiceDiagnosticsExtension : Cannot bind parameter 'StorageContext'

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

运行此脚本时出现以下错误

$storage_name = "<storage name>"
$key = "<key>"
$config_path="C:\diagnostics.wadcfgx"
$service_name="<service name>"
$storageContext = (New-AzureStorageContext -StorageAccountName $storage_name -StorageAccountKey $key)
Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $config_path -ServiceName $service_name -Slot Staging -Role WorkerRole1

随后出现错误:

Set-AzureServiceDiagnosticsExtension : Cannot bind parameter 'StorageContext'. Cannot convert the "Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext" value of type
"Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext" to type "Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext".

最佳答案

我删除了变量 $storageContext 并将存储帐户名称和键值直接传递到命令中,如下所示。

Set-AzureServiceDiagnosticsExtension -ServiceName $cloudService_name -Role $cloudWorkerRole_Name -StorageAccountName $wr_storageaccount_name -StorageAccountKey $wr_storageaccount_key -DiagnosticsConfigurationPath $local_configuration_path  -Slot Production

成功了。谢谢

关于powershell - 设置-AzureServiceDiagnosticsExtension : Cannot bind parameter 'StorageContext' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41614614/

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