Azure Function in ASE not triggred when receiving a message in an event hub

312 Views Asked by At

We are trying to deploy an Azure Function in an App service Environment in an Isolated App Service Plan. This Azure Function should be triggered each time we receive a message in an event hub. Unfortunately it doesn't seem to work even though we've tried different network configurations :

  1. Authorised ASE subnet in the networking section in Event Hubs Namespace
  2. White listed both subnet IP ranges and ASE Outbound IP Addresses.
  3. And Allowed trusted Microsoft services.

Could you please help us debug this situation in order to understand why our Azure Function is not triggered.

1

There are 1 best solutions below

0
On

Here are the steps to create function app that triggers when there is an event generated in EventHub try to check these steps and make required changes in your code to execute your requirement.

Add the below code in your local.settings.json file z

{

"IsEncrypted": false,

"Values": {

"FUNCTIONS_WORKER_RUNTIME": "python",

"AzureWebJobsStorage": [Paste the Storage account connection string which is linked with your Azure function that you have Created on Azure Portal],

"FUNCTIONS_EXTENSION_VERSION": "~2",

"receiverConnectionString": [Paste the Endpoint Connection String of the EventHubNamespace here in double quotes and remove these brackets.],

"MyStorageConnectionString": [Paste the Endpoint Connection String of the blob storage account here in double quotes and remove these brackets.]

},

"ConnectionStrings": {}

}

Below is the code that will bind azure function with EventHub so that it will result in triggering message automatically when there is any event generated in EventHub.

{

"scriptFile": "__init__.py",

"bindings": [{

"type": "eventHubTrigger",

"name": "events",

"direction": "in",

"eventHubName": [Enter the name of your event hub in double quotes and remove these brackets.],

"connection": "receiverConnectionString",

"cardinality": "many","consumerGroup": "$Default",

"dataType": "binary"

},


{
"name": "outputblob",
       
"type": "blob", 
      
"path": [Enter the path of the folder where you want to store the data in double quotes and remove these brackets.], 
      
"connection": "MyStorageConnectionString",
       
"direction": "out"

}]

}

For Complete information check Azure Functions and EventHub.

Also, Check these SO threads for related information. SO1, SO2 and these Microsoft Q&A