Reputation: 137
I am having an azure function and i want to change authlevel of my azure function from authLevel = AuthorizationLevel.ANONYMOUS
to FUNCTION
or ADMIN
. How I can implement and I am using java spring boot function app?
Code:
@FunctionName("funcName")
public HttpResponseMessage execute(@HttpTrigger(name = "request", methods = { HttpMethod.GET,HttpMethod.POST },
authLevel = AuthorizationLevel.ANONYMOUS)
HttpRequestMessage<Optional<User>> request,
ExecutionContext context){
<------body ------>
}
Upvotes: 8
Views: 12457
Reputation: 6796
Just change
authLevel = AuthorizationLevel.ANONYMOUS
To
authLevel = AuthorizationLevel.FUNCTION
Or
authLevel = AuthorizationLevel.ADMIN
=========================update====================
Your URL endpoint might look like this format:
https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>?code=<API_KEY>
And you can find API_KEY here:
For more details, you can refer to this official documentation.
Upvotes: 9