使用包含Azure Service Bus主题的Azure CLI的特殊字符的Filter-SQL表达式
我正在尝试通过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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够找到解决方案。诀窍是将参数用双引号将实际值包裹在双引号中,表明添加它们:
- 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'"