Does eventgrid output binging v2 support managed identity? Documents said so but no explanation on what should be the key in V2

Anonymous
2024-03-12T18:46:56.88+00:00

Does eventgrid output binging v2 support managed identity? Documents said so but no explanation on what should be the key in V2 python.

@app.event_grid_output(    arg_name="outputEvent",    topic_endpoint_uri="MyEventGridTopicUriSetting",    topic_key_setting="MyEventGridTopicKeySetting")

what should be the topic_key_settings incase of managed identity? i cant remove it, it's required from the output library. If there are values needed an app_Settings, please specify

topic_key_setti
import logging
import azure.functions as func
import datetime
@app.function_name(name="eventgrid_output")
@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"))
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,285 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
316 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 18,281 Reputation points Microsoft Employee
    2024-03-13T08:05:45.5433333+00:00

    @cardib Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    When you are using the Identity-based authentication in the output binding set the Connection property to the name of your app setting that contains your Event Grid Topic endpoint along with a set of optional Identity information that is described in detail here.

    When setting the Connection property, the TopicEndpointUri and TopicKeySetting properties should NOT be set.

    @app.event_grid_output( arg_name="outputEvent", connection="mytesteventgrid__topicEndpointUri")
    

    For more information, you can refer to the samples mentioned in the documentation EventGrid client library using .Net SDK.

    Hope this helps let me know if you have any further questions on this.

    0 comments No comments