azure-functions-python-worker icon indicating copy to clipboard operation
azure-functions-python-worker copied to clipboard

Add V2 samples in docs for missing Triggers/bindings

Open pdthummar opened this issue 2 years ago • 8 comments

Docs update needed for following triggers/bindings: Table Warmup Trigger SB Queue Output

### Tasks
- [ ] Retry Policy Examples for ProgModelv2
- [ ] WarmUp Trigger Examples for ProgModelv2
- [ ] Table Storage Trigger Examples for ProgModelv2
- [ ] SB Queue Output Binding Examples for ProgModelv2
- [ ] Dapr Examples for ProgModelv2 (to check with Dapr Team

pdthummar avatar Jun 07 '23 19:06 pdthummar

EventGrid examples

vrdmr avatar Jun 07 '23 19:06 vrdmr

Warmup Trigger example would be helpfull

nvablaest avatar Jun 09 '23 07:06 nvablaest

warmup_trigger

vrdmr avatar Jul 10 '23 20:07 vrdmr

@vrdmr Can you please suggest how can I add a warmup function for Azure Functions V2 with Service Bus Trigger. We are implementing a unified health check for all the Azure Functions.

I am expecting something like this:

image

sudharsan2020 avatar Jul 26 '23 09:07 sudharsan2020

@sudharsan2020 there may only be one warmup function per app. You can create a single warmup function as shown below, and then create separate functions for your service bus triggers. Thanks

import azure.functions as func
import logging

app = func.FunctionApp()


@app.warm_up_trigger('warmup')
def warmup(warmup) -> None:
    logging.info('Function App instance is warm')
    

pdthummar avatar Aug 02 '23 15:08 pdthummar

@pdthummar How do I trigger the warmup function. I didn't see any sufficient documentation on this. We are required to do a health check of our Azure function across multiple regions on a periodic basis

sudharsan2020 avatar Aug 02 '23 16:08 sudharsan2020

@sudharsan2020 A warmup trigger is invoked when an instance is added to scale a running function app. The warmup trigger lets you define a function that's run when a new instance of your function app is started.

For more info, please refer: Azure Functions warmup trigger Thanks

pdthummar avatar Aug 17 '23 20:08 pdthummar

@sudharsan2020 there may only be one warmup function per app. You can create a single warmup function as shown below, and then create separate functions for your service bus triggers. Thanks

import azure.functions as func
import logging

app = func.FunctionApp()


@app.warm_up_trigger('warmup')
def warmup(warmup) -> None:
    logging.info('Function App instance is warm')
    

When testing in Azure, I get System.NotImplementedException at Microsoft.Azure.WebJobs.Host.Bindings.TriggerAdapterBindingProvider`2+ExactBinding+<BindAsync>d__10.MoveNext

Marsharks avatar Apr 09 '24 18:04 Marsharks