public class AzureHttpFunction extends AzureFunction
Controller and the others annotations in the
io.micronaut.http.annotation package.
To use this class you should define a new function that subclasses this class and then override the route(HttpRequestMessage, ExecutionContext) (HttpRequestMessage, ExecutionContext)} method to customize the function mapping as per the Azure documentation. For example the following definition will route all requests to the function:
{@code| Modifier and Type | Field and Description |
|---|---|
protected static io.micronaut.servlet.http.ServletHttpHandler<com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>>,com.microsoft.azure.functions.HttpResponseMessage> |
httpHandler |
applicationContext| Constructor and Description |
|---|
AzureHttpFunction()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
HttpRequestMessageBuilder<?> |
request(com.microsoft.azure.functions.HttpMethod method,
java.lang.String uri)
Start a new request.
|
HttpRequestMessageBuilder<?> |
request(io.micronaut.http.HttpMethod method,
java.lang.String uri)
Start a new request.
|
com.microsoft.azure.functions.HttpResponseMessage |
route(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request,
com.microsoft.azure.functions.ExecutionContext executionContext)
Entry point for Azure functions written in Micronaut.
|
close, getApplicationContextprotected static io.micronaut.servlet.http.ServletHttpHandler<com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>>,com.microsoft.azure.functions.HttpResponseMessage> httpHandler
public com.microsoft.azure.functions.HttpResponseMessage route(com.microsoft.azure.functions.HttpRequestMessage<java.util.Optional<java.lang.String>> request,
com.microsoft.azure.functions.ExecutionContext executionContext)
request - The requestexecutionContext - The execution contextpublic HttpRequestMessageBuilder<?> request(com.microsoft.azure.functions.HttpMethod method, java.lang.String uri)
method - The methoduri - The URIpublic HttpRequestMessageBuilder<?> request(io.micronaut.http.HttpMethod method, java.lang.String uri)
method - The methoduri - The URI