使用包含Azure Service Bus主题的Azure CLI的特殊字符的Filter-SQL表达式

发布于 2025-02-07 05:18:43 字数 595 浏览 3 评论 0原文

我正在尝试通过Azure CLI为Azure Service Bus主题创建过滤器SQL表达式。我的过滤器表达式具有特殊的字符(':')。使用CLI创建过滤器时,我总是会收到BadRequest响应。服务总线的文档提到需要将特殊字符放入双引号。因此,我尝试以下方式: AZ ServiceBus主题订阅规则创建-Resource-group ResourceGroup -namespace-name servicebus-- topic-name mytopic -subscription-name mysubscription -name filtername-filter-sql-sql-expression'cloudevents“ cloudevents:type” =“ =” =“ =” =“ =” =“ =” = 'typeName:v1'

我收到的错误响应:badrequesterror:badrequest:解析SQL表达式出现错误。 [令牌线= 1,列= 11,error =:,附加细节=未识别的字符。 ':']

我试图在没有引号的情况下使用它,我试图将所有内容都放在双引号中。我不工作。有人知道如何解决该问题,还是根本不支持它?

I am trying to create a filter SQL expression for Azure Service Bus Topics via Azure CLI. My filter expression has a special character (':'). When using the cli to create the filter I always receive a BadRequest response. The documentation for Service Bus mentions that the special characters need to be put into double quotes ". Therefore I try this:
az servicebus topic subscription rule create --resource-group resourceGroup --namespace-name servicebus --topic-name myTopic --subscription-name mySubscription --name filterName --filter-sql-expression "cloudEvents:type"='typeName:v1'

The error response I receive: BadRequestError: BadRequest: There was an error parsing the SQL expression. [Token line=1, column=11, Token in error= :, Additional details= Unrecognized character. ':']

I've tried to use it without the quotes, I tried to put everything in double quotes. I don't get it to work. Does anyone know how to fix that or is it simply not supported?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜司空 2025-02-14 05:18:43

我能够找到解决方案。诀窍是将参数用双引号将实际值包裹在双引号中,表明添加它们:

- filter-sql-expression“”“”“ cloudevents:type”“” ='typeName:v1' “

I was able to find the solution. The trick is to have the argument in double quotes and then surround the actual value into double double quotes, indicating to add them:

--filter-sql-expression """cloudEvents:type""='typeName:v1'"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文