Hi!
We're upgrading our Azure Functions from v3 to v4 and we're now using .NET 7.0. The problem now is that this version of .NET uses HttpRequestData
instead of HttpRequestMessage
in the receiving end of the HttpTrigger function, as shown in the example below:
[Function("TEST_FUNCTION")]
public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequestData req)
{
_logger.LogInformation("C# HTTP trigger function processed a request.");
var response = req.CreateResponse(HttpStatusCode.OK);
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
response.WriteString("Welcome to Azure Functions!");
return response;
}
I use to use the method Create in FunctionContext
from PlayFab.Plugins.CloudScript
but the Create function only has HttpRequestMessage
as an input parameter (which I believe it's no longer supported in .NET 7) as shown below from PlayFab's SDK:
namespace PlayFab.Plugins.CloudScript
{
public class FunctionContext<TFunctionArgument>
{
protected FunctionContext();
public PlayFabApiSettings ApiSettings { get; }
public PlayFabAuthenticationContext AuthenticationContext { get; set; }
public EntityProfileBody CallerEntityProfile { get; set; }
public TFunctionArgument FunctionArgument { get; set; }
public string CurrentPlayerId { get; set; }
[AsyncStateMachine(typeof(FunctionContext<>.<Create>d__21))]
public static Task<FunctionContext<TFunctionArgument>> Create(HttpRequestMessage request);
}
}
Is there anything obvious that i am missing? How does one populate the FunctionContext in .NET 7 without using HttpRequestMessage
?
Thanks in advance!! :) Raf