0

I want to do action-sql-expression command on a subscription. I have this:

az servicebus topic subscription rule create ^
--resource-group %resourcegroup_name% ^
--namespace %namespace_name% ^
--topic-name %topic_name% ^
--subscription-name %subscription_name% ^
--name %rule_name ^
--action-sql-expression SET TopicName=%topic_name%

But I am getting this error:

az: error: unrecognized arguments: TopicName=MyTopic

How can I pass the argument for action-sql-expression?

milan-W
  • 65
  • 1
  • 9

1 Answers1

0

You should include the sql statement in quotation marks. So use it like below

--action-sql-expression "SET TopicName=%topic_name%"

For more details, you could refer to this article.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • did not help. I got this message this time: BadRequest - Value cannot be null. Parameter name: sqlExpression CorrelationId: – milan-W Mar 18 '19 at 09:13
  • As you see in my code, I dont use --filter-sql-expression at all. I dont know if I have to use this to could use --action-sql-expression. Because in the link you gave me, they used both of them in the same command. – milan-W Mar 18 '19 at 09:15
  • No, you dont need to add filter-sql-expression. They are optional parameters. – Joey Cai Mar 18 '19 at 09:19
  • Exactly, but why I got BadRequest - Value cannot be null. Parameter name: sqlExpression CorrelationId: ... ?! – milan-W Mar 18 '19 at 09:25