0

I have PowerShell script to update EventGrid subscriptions. One of possible scenarios is to set subscription subject prefix/postfix to define value.

Update-AzureRmEventGridSubscription -ResourceGroup $ResourceGroupName -TopicName $EventGridTopicName -EventSubscriptionName $Subscription.name -SubjectEndsWith $Subscription.subjectEndsWith

When value is not null or empty then it works fine. But when it needs to be set to '' it throws

 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

Should I recreate subscription?

Leszek
  • 451
  • 5
  • 19

1 Answers1

0

This looks to be a bug in the Update-AzureRmEventGridSubscription implementation, thanks for reporting this! I have filed an issue at https://github.com/Azure/azure-powershell/issues/6331 to track this issue.

Until this is fixed in the EventGrid PowerShell module, the workaround would be to:

1) Either delete and re-create the event-subscription, or

2) to use the equivalent command in Azure CLI (az eventgrid event-subscription update --resource-group your-rg-name --topic-name your-topic-name --name your-event-subscription-name --subject-ends-with "").