powershell - Update-AzureRmEventGridSubscription 设置主题前缀/后缀为字符串空
问题描述
我有 PowerShell 脚本来更新 EventGrid 订阅。一种可能的情况是设置订阅主题前缀/后缀来定义值。
Update-AzureRmEventGridSubscription -ResourceGroup $ResourceGroupName -TopicName $EventGridTopicName -EventSubscriptionName $Subscription.name -SubjectEndsWith $Subscription.subjectEndsWith
当 value 不为 null 或为空时,它可以正常工作。但是当它需要设置为 '' 它抛出
Cannot validate argument on parameter 'SubjectBeginsWith'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again
我应该重新创建订阅吗?
解决方案
这看起来是 Update-AzureRmEventGridSubscription 实现中的一个错误,感谢您报告这个!我在https://github.com/Azure/azure-powershell/issues/6331提交了一个问题来跟踪这个问题。
在 EventGrid PowerShell 模块中解决此问题之前,解决方法是:
1) 删除并重新创建事件订阅,或者
2) 在 Azure CLI 中使用等效命令 (az eventgrid event-subscription update --resource-group your-rg-name --topic-name your-topic-name --name your-event-subscription-name --subject -以。。结束 ””)。
推荐阅读
- python - 如何在 tkinter 画布窗口上显示带有线条的图像?
- apache - Nginx 服务器重定向到错误服务器不起作用
- javascript - Javascript [对象 HTMLCollection]
- python - while true 循环检查范围内的数字,以及 ValueError 检查?
- asp.net - Visual Studio 2019 似乎没有看到我安装了 .NET Core 3.1(带有 SDK)
- python - 有没有办法让机器人响应三条消息中的一条,每条消息都有自己对一组消息的响应?
- google-sheets - 有没有办法根据日期引用每天更改的不同单元格?
- html - 是否可以通过使用 Excel 宏单击下载按钮来下载 CSV 文件?
- c++ - 小网格的 Vulkan 闪烁
- python - 如何让python脚本更高效的while循环