Does EventGridTrigger wors in App service plan and ASE? - azure

I have an Event Grid Trigger Azure function deployed to a function app which is in an ASE. I have created an event grid subscription with this function as an end point. The purpose of this subscription is to call this function once a blob file is created.
When I placed the file in the location, the event is supposed to call the function but I see the event is undelivered.
How can I resolve the issue?

I found this in Azure documents :
" When your function app runs in either an App Service plan or an App Service Environment, you can use non-HTTP trigger functions. For your functions to get triggered correctly, you must be connected to a virtual network with access to the resource defined in the trigger connection. "
Maybe you can refer to this article.enter link description here

I have created an eventgrid subscription that writes the event to a queue whenever a file is created in blob. I have modified exiting EvenGridTrigger function to QueueTrigger function. Both storage account and function app are in same vnet.

Related

Deploying same Azure cloud function for each environment - dev, qa, prod

Have a function app with single cloud function in it. The cloud function is triggered by an HTTP call and pushes the payload to a Azure service bus queue. What needs to be done is, as part of automated deployment, would like to have few variables configured per environment -
Function Name
Queue Name
Queue Connection String
Deployment is to be done using Azure DevOps. Function code is also on Azure DevOps repository which will have branch for each environment, so will need function with different function name for eg - Dev_Function, QA_Function,etc since it needs to connect to corresponding environment queue. Also aware that variables can be configured using App Settings on Azure portal. Any help/insights appreciated!
i think you could keep the function name as it is and change make the Queue name and Connection string to be pickup from Azure function app service configuration.
[FunctionName("SendEmailFunc")]
public static async Task SendEmailFunc([QueueTrigger($"%{FuncAppConstants.Queue.EmailQueueName}%")] EmailMessage emailMessage)
{
}
you can get the queue name at runtime by using this
[QueueTrigger($"%prod_queue_name%")]
and configuration will just look like below in the local.setting.json
"prod_queue_name": "test-email-queue"
and similarly in the Azure function app configuration
And same can be done for the connection string

How to set value for EventHub and AzureWebJobsStorage

I have created an event hub and storage account in the Azure portal and written an azure function with an eventhub trigger to trigger the function.
To run this function locally, I set the "AzureWebJobsStorage" and "EventHubconnectionstring" in local.settings.json and this works fine.
If I deploy this function to azure portal, how can I set this "EventHubconnectionstring" and "AzureWebJobsStorage" values ? does it picked up automatically?
When you deploy it from Visual Studio the values become null. Then you need to open Configuration section in function app and enter those values there as below:
If you deploy using Vs code the values will be reflected in configuration section.
If you face the issue as empty connection string, then you need to add it in Configuration section then save it.And you should do the same for event hub connection string.
References:
Storage account connection string does not exist - deploying Queue storage trigger for Azure Functions - Stack Overflow

Choosing container for Azure Function EventHubb Trigger

By default the Azure Function of type Eventhub Trigger stores the offsets in a container inside a Storage Account named azure-webjobs-eventhub. Is there any possibility to specify another container? maybe playing with the AzureWebJobsStorage property?
Thank you very much
Choosing container for Azure Function EventHubb Trigger
As Event trigger extension by default creates a checkpoint you cannot create change the container
For further information you can check Event Trigger

How to get response back within azure function which is calling an azure automation runnbook via webhoook

I have a https triggered function app which is calling a webhook which internally is calling a runbook. Runbook is running on hybrid worker group and based on the inputs it's returns some output is there any way to get the response back to the azure function without storing the runbook output in any temporary storage.

Azure Functions - Event Hub not triggering Functions

I have an Azure infrastructure:
2 HTTP Functions -> Event Hub -> 2 Functions -> Table Storage
(so two http functions sending messages to event hub, and two functions triggered by messages in Event Hub, one of them saving message in table storage)
The infrastructure is daily automatically created by Azure ARM templates, with the use of Azure CLI. I haven't changed the logic in recent two months but since beginning of April I have noticed the new, weird behaviour.
At the end of setting up, E2E tests are executed automatically. They are sending some message and after some time they check, if message are in table storage.
And here is the problem: since beginning of April these tests almost always fail! And I did not change anything in logic of function or template.json's for infrastructure.
It looks that Functions that should be triggered by Event Hub are not executed at all! I have already found a workaround for it - if I go to Azure portal and run these functions manually ("Run" button above code editor), then the functions finally starts to work!
Does anybody else encounter this problem?
Is there some way to automatically, directly run non-HTTP triggered function by e.g. Azure CLI or REST interface?
It seems that problem is already quite well known:
https://github.com/Azure/Azure-Functions/issues/210
I'm using currently workaround from this issue, i.e. calling Azure CLI's method to synchronize function triggers after creating infrastructure and zip pushing of functions:
az resource invoke-action --resource-group <resourceGrouName> --action syncfunctiontriggers --name <functionAppName> --resource-type Microsoft.Web/sites

Resources