I'm using Python V2 model event grid trigger and output binding. I'm using microsoft example code provided. I'm deploying using git action and local-exe. I tried deploying just the trigger and it successfully got deployed and was able to see it on the azure portal. When I tried deploying with output to write to a custom topic. In git actions it successfully deployed without any errors but i dont see it on azure portal and stopped being triggered.
my requiremnets.txt just has azure-functions
import logging
import azure.functions as func
import datetime
@app.function_name(name="eventGridTrigger")
@app.route(route="eventgrid_output")
@app.event_grid_output(
arg_name="outputEvent",
topic_endpoint_uri="MyEventGridTopicUriSetting",
topic_key_setting="MyEventGridTopicKeySetting")
def eventgrid_output(eventGridEvent: func.EventGridEvent,
outputEvent: func.Out[func.EventGridOutputEvent]) -> None:
logging.log("eventGridEvent: ", eventGridEvent)
outputEvent.set(
func.EventGridOutputEvent(
id="test-id",
data={"tag1": "value1", "tag2": "value2"},
subject="test-subject",
event_type="test-event-1",
event_time=datetime.datetime.utcnow(),
data_version="1.0"))
to be able to see it and to get triggered and forward the event to the custom topic
I have followed MSDOC and implemented output binding with the below code:
Code Snippet:
local.settings.json:
Environment Variables=>Application Settingsin the function app: