Azure Function Output Binding Event Grid Managed Identity

Viewed 14

Im trying to write an Azure function which has an Event Grid output binding, how do I configure it to use a manage identity instead of the topic key ?

    [Function("TestEventGrid")]
    [EventGridOutput(TopicEndpointUri = "MyEventGridTopicUriSetting", TopicKeySetting = "MyEventGridTopicKeySetting")]
    public async Task<MyEvent> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req)
    {
        return await Task.FromResult(new MyEvent
        {
            Id = "123",
            Subject = "sub",
            EventType = "myevent",
            EventTime = DateTime.Now,
            Data = new TestData(),
            DataVersion = "1.0"
        });
    }
0 Answers
Related