question

Mr Slo avatar image
Mr Slo asked

Cloudscript Function Call in Net6

I have a working cloudscript server using azure function app.

I've created a new service using standard net6 web api. Encountered a few issues being able to read the cloudscript function request, wondering if there's something i'm missing.

```

[HttpPost]
[Route("cloudscriptsync")]
public async Task<ActionResult> SyncFromCloudScript(HttpRequestMessage request)
{
var context = await FunctionContext<LogicRequest>.Create(request); ... ```

The above code throws an null ref.

System.NullReferenceException: Object reference not set to an instance of an object. 2022-05-23T17:19:48.545665597Z at PlayFab.Plugins.CloudScript.FunctionContext`1.Create(HttpRequestMessage request)

Is there something i'm missing to be able to receive cloudscript parameters in a net6 web api ?

Thanks !

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

·
Gosen Gao avatar image
Gosen Gao answered

It seems like you are using PlayFabCloudScriptPlugin which is outdated, please follow the official documentation: Quickstart: Writing a PlayFab CloudScript using Azure Functions to create an Azure Function with CS2AFHelperClasses.cs. It also shows how to read requests sent by ExecuteFunction API.

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.