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

AsheNone 26 Reputation points
2022-04-25T23:23:15.677+00:00

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 Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,986 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
350 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 19,641 Reputation points Microsoft Employee
    2022-04-26T10:22:18.817+00:00

    @AsheNone 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.] (https://learn.microsoft.com/en-us/azure/templates/microsoft.eventgrid/topics/eventsubscriptions?tabs=bicep#advancedfilter-objects)

    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

    0 comments No comments