question

AsheNone-2750 avatar image
0 Votes"
AsheNone-2750 asked VenkateshDodda-MSFT edited

Unable to trigger logicapp with advanced filters "StringNotContains" for event grid trigger

This is my arm template:

"inputs": {
"body": {
"properties": {
"destination": {
"endpointType": "webhook",
"properties": {
"endpointUrl": "@{listCallbackUrl()}"
}
},
"filter": {
"includedEventTypes": [
"Microsoft.Storage.BlobCreated"
],
"subjectBeginsWith": "/blobServices/default/containers/",
"advancedFilters": [
{
"operatorType": "StringContains",
"key": "Subject",
"values": [
"@{parameters('test_contains')}"
]
},
{
"operatorType": "StringNotContains",
"key": "Subject",
"values": [
"@{parameters('test_not_contains)}"
]
},
{
"key": "Data.contentLength",
"operatorType": "NumberGreaterThan",
"values": 0
}
]
},
"topic": "@parameters('eventGrid_Topic')"
}
},
"host": {
"connection": {
"name": "@parameters('connections')['azureeventgrid']['connectionId']"
}
},
"path": "/subscriptions/@{encodeURIComponent(parameters('subscription')['subscriptionId'])}/providers/@{encodeURIComponent('Microsoft.Storage.StorageAccounts')}/resource/eventSubscriptions",
"queries": {
"subscriptionName": "[variables('logicapp_name')]",
"x-ms-api-version": "2020-10-15-preview"
}
}
`` }
},
{
"comments": "Azure Event Grid API Connection",
"type": "Microsoft.Web/connections",
"name": "[variables('connections_azureeventgrid_name')]",
"apiVersion": "2018-07-01-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"displayName": "[variables('connections_azureeventgrid_name')]",
"customParameterValues": {},
"api": {
"id": "[concat(subscription().id ,'/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/azureeventgrid')]"
},
"parameterValues": {
"token:clientId": "[parameters('client_Id')]",
"token:clientSecret": "[parameters('client_secret')]",
"token:TenantId": "[parameters('tenant_id')]",
"token:grantType": "client_credentials",
"token:resourceUri": "https://management.core.windows.net/"
}
},
"dependsOn": []
},
Initially I had "x-ms-api-version" as 2017-09-15-preview and it worked fine but then I needed "StringNotContains" and I had error message": "The property EnableAdvancedFilteringOnArrays and the following Advanced filter operator types are only supported on API versions newer than 2021-12-01: IsNullOrUndefined, IsNotNull, NumberInRange, NumberNotInRange, StringNotBeginsWith, StringNotEndsWith, and StringNotContains." and now no errors when deployed but no triggers are coming in. May I know what is the correct api-version that I can use here in order for triggers to work? (Fyi, 2021-12-01 version just throws error saying not a valid version)


azure-logic-appsazure-event-grid
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

VenkateshDodda-MSFT avatar image
0 Votes"
VenkateshDodda-MSFT answered VenkateshDodda-MSFT edited

@AsheNone-2750 Thanks for reaching out, The advanced filter objects StringContains, StringNotContains are supported in the Api version '2021-10-15-preview' as mentioned in this documentation.

If you need to check the list of supported Api Version, for any of the resource type you can click on the drop down in respective resource type documentation as shown below

198110-image.png


image.png (54.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.