作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
运行此脚本时出现以下错误
$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/
运行此脚本时出现以下错误 $storage_name = "" $key = "" $config_path="C:\diagnostics.wadcfgx" $service_name="" $st
当使用 New-AzureStorageContext 命令检索的 AzureStorageContext 与 New-AzureServiceDiagnosticsExtensionConfig 输
我是一名优秀的程序员,十分优秀!