question

tommy-1 avatar image
tommy-1 asked

Local CloudScript Azure function returns null response

I'm doing local debugging running CloudScript calling an Azure function. The local function is getting called correctly, but on the client side the www.downloadHandler.data is always null so it throws a NullReferenceException (in PlayFabUnityHttp.cs, line 157, inside the Post function).

This seems similar to a previous error (https://community.playfab.com/questions/55299/error-when-using-local-cloudscript-on-azure-functi.html) but I've tried different result content encoding, and it doesn't fix the problem.

My Azure project is using .NET 8 and the isolated worker model now. If I revert back to before this change when the project had a target framework of netcoreapp3.1 and Azure function v3, everything works and I get a valid response on the client side.

My Azure project works fine on the real server. This is only a local debugging issue.

Can you think of anything that might need to be changed for local debugging to work with a .NET Azure functions project? Anything related to the response encoding that I need to change?

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

·
Neils Shi avatar image
Neils Shi answered

As https://learn.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart#prerequisites mentions that the code provided in PlayFab Azure function docs are suitable for Azure Functions V4 and .NET 6. If you want to use higher version like .Net 8 or using isolated worker model, you could post a feature request for it.

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.