Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az eventgrid system-topic event-subscription create - unable to handle/validate webhook endpoint with multiple query parameters correctly. #28286

Open vtjc2002 opened 9 months ago

vtjc2002 commented 9 months ago

Describe the bug

When using az eventgrid system-topic event-subscription create to create an event-subscription and it validates the webhook endpoint, it does not send the query parameters beyond the 1st one.

Repo:

  1. Create a system topic with az eventgrid system-topic create command to create a Microsoft.Storage.StorageAccounts topic
  2. set $endpoint = "https://${functionAppUrl}/runtime/webhooks/blobs?functionName=Host.Functions.MyFunctionEventTrigger&code=$functionKey"
  3. run az eventgrid system-topic event-subscription create --name scanned-images-blob-created --system-topic-name scanned-items-blobs-topic --endpoint-type "WebHook" --resource-group $resourceGroup --endpoint $endpoint

The code is the system key to the Azure function. The command errors out with "'code' is not recognized as an internal or external command, operable program or batch file."

Related command

az eventgrid system-topic event-subscription create

Errors

'code' is not recognized as an internal or external command, operable program or batch file.

if I switch code and functionName around it will say: 'functionName ' is not recognized as an internal or external command, operable program or batch file.

Issue script & Debug output

'code' is not recognized as an internal or external command, operable program or batch file.

Expected behavior

It should validate the webhook endpoint using the entirety of the url+query parameters. This works when using portal.azure.com

Environment Summary

azure-cli 2.56.0

core 2.56.0 telemetry 1.1.0

Extensions: aks-preview 0.5.149 fleet 0.2.7

Dependencies: msal 1.24.0b2 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\johnsontseng.azure\cliextensions'

Python (Windows) 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)]

Additional context

No response

yonzhan commented 9 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 9 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl.