use of com.microsoft.azure.functions.annotation.AuthorizationLevel in project azure-tools-for-java by Microsoft.
the class FunctionNode method triggerHttpTrigger.
@AzureOperation(name = "function|trigger.start_http", params = { "this.functionApp.name()" }, type = AzureOperation.Type.TASK)
private void triggerHttpTrigger(FunctionEntity.BindingEntity binding) {
final AuthorizationLevel authLevel = EnumUtils.getEnumIgnoreCase(AuthorizationLevel.class, binding.getProperty("authLevel"));
String targetUrl;
switch(authLevel) {
case ANONYMOUS:
targetUrl = getAnonymousHttpTriggerUrl();
break;
case FUNCTION:
targetUrl = getFunctionHttpTriggerUrl();
break;
case ADMIN:
targetUrl = getAdminHttpTriggerUrl();
break;
default:
final String format = String.format("Unsupported authorization level %s", authLevel);
throw new AzureToolkitRuntimeException(format);
}
DefaultLoader.getUIHelper().openInBrowser(targetUrl);
}
Aggregations