diff --git a/src/main/java/com/microsoft/azure/functions/annotation/EventGridOutput.java b/src/main/java/com/microsoft/azure/functions/annotation/EventGridOutput.java index ffbf4cd..8f7726f 100644 --- a/src/main/java/com/microsoft/azure/functions/annotation/EventGridOutput.java +++ b/src/main/java/com/microsoft/azure/functions/annotation/EventGridOutput.java @@ -66,7 +66,7 @@ * here: https://docs.microsoft.com/en-us/azure/event-grid/custom-event-quickstart#send-an-event-to-your-topic * @return The topic key setting of the eventGrid topic. */ - String topicKeySetting(); + String topicKeySetting() default ""; /** * Gets or sets the topic events endpoint URI. Eg: https://topic1.westus2-1.eventgrid.azure.net/api/events @@ -74,5 +74,13 @@ * here: https://docs.microsoft.com/en-us/azure/event-grid/custom-event-quickstart#send-an-event-to-your-topic * @return The topic events endpoint URI of the eventGrid topic. */ - String topicEndpointUri(); + String topicEndpointUri() default ""; + + /** + * Defines the common prefix for app settings that configure an identity-based connection. + * When set, topicEndpointUri and topicKeySetting should not be set. + * + * @return The common prefix for the identity-based connection settings. + */ + String connection() default ""; } diff --git a/src/test/java/com/microsoft/azure/functions/annotation/BindingTest.java b/src/test/java/com/microsoft/azure/functions/annotation/BindingTest.java index 2ed6484..13f4200 100644 --- a/src/test/java/com/microsoft/azure/functions/annotation/BindingTest.java +++ b/src/test/java/com/microsoft/azure/functions/annotation/BindingTest.java @@ -37,6 +37,13 @@ public void every_binding_annotation_should_have_dataType_method() { } } + @Test + public void event_grid_output_should_support_identity_based_connection() throws NoSuchMethodException { + assertEquals("", EventGridOutput.class.getMethod("connection").getDefaultValue()); + assertEquals("", EventGridOutput.class.getMethod("topicEndpointUri").getDefaultValue()); + assertEquals("", EventGridOutput.class.getMethod("topicKeySetting").getDefaultValue()); + } + /** * find all annotation bindings based on annotation suffix conventions defined in bindingAnnotationSuffix array */