I have an Azure Function that is triggered by a http request and uses bindings to output to an Azure storage queue AND return a http response.
This works when coded for dotnet-isolated, making use of the Functions.Worker assemblies. First I declare a type for both the queue message and http response:
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
namespace SmsRouter.AzFunc
{
public class QueueAndHttpOutputType
{
[QueueOutput("%SendSmsQueueName%")]
public string QueueMessage { get; set; } = "";
public HttpResponseData HttpResponse { get; set; }
}
}
Then I use this as the return type for the Azure Function:
[Function(nameof(SendSimpleSms))]
public async Task<QueueAndHttpOutputType> SendSimpleSms([HttpTrigger(AuthorizationLevel.Function, "post", Route = "v1.0/simple-sms")] HttpRequestData req,
FunctionContext executionContext)
Unfortunately, I need to downgrade my solution to use dotnet 3.1 and the in-process model of Azure Functions due to this issue.
Does anyone know how I can achieve the same behaviour using the old style in-process Azure Function?