question

Paul Pacheco avatar image
Paul Pacheco asked

FunctionContext should support HttpRequest

Currently, the cloudscript sdk on .net has a class called FunctionContext. In the example it is used to parse the request for functions as you can see here.

However, the Create method receives a HttpRequestMessage, which does not work in Azure functions v4 with isolated process (the in process model is considered obsolete).

I request an overload of FunctionContext.Create that receives an HttpRequest object. It would look almost the same.

The documentation currently instructs us to download CS2AFHelperClasses.cs and add it to our functions, but the example you provide does not use it, and it should be built-in functionality.

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

Currently, .Net isolated mode Azure function is not supported by PlayFab, you may post a feature request. And the CS2AFHelperClasses.cs is used to help you use the context passed by PlayFab (in local debug situation, the context is passed by the local ExecuteFunction API implementation which is the ExecuteFunction.cs file) to implement your Azure Functions. In addition, this section of the sample code: https://learn.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart#playfab-cloudscript-context-variables-and-server-sdks- in the PlayFab documentation: “FunctionExecutionContext context = JsonConvert.DeserializeObject> (await req.ReadAsStringAsync());” uses the CS2AFHelperClasses.cs file.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.