question

tarekonatsheh avatar image
tarekonatsheh asked

Azure Functions: not able to run the quickstart example

Hi all,

I am trying to run the example in (Quickstart: Writing a PlayFab CloudScript using Azure Functions) here:

https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart

But with no success.

I have deployed the function (HelloWorld) and I have placed the class (CS2AFHelperClasses.cs) along with it, and it has deployed successfully.

But when I create a rule that calls this function, I get this error in playstream:
"Error": "CloudScriptAzureFunctionsHTTPRequestError", "Message": "Invocation of cloud script function Function1 failed"

and when I use Azure Functions (Code + Test) section, it says:

HTTP response code

500 Internal Server Error

and in the Treminal it says:

2020-10-14T14:28:37.950 [Information] Executing 'HelloWorld' (Reason='This function was programmatically called via the host APIs.', Id=8b47b4da-0757-4631-ad48-cca923913895)

2020-10-14T14:28:37.981 [Error] Executed 'HelloWorld' (Failed, Id=8b47b4da-0757-4631-ad48-cca923913895, Duration=3ms)Object reference not set to an instance of an object.

Any ideas?

Thank you in advance.

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

·
Citrus Yan avatar image
Citrus Yan answered

The error “Object reference not set to an instance of an object” indicates that somewhere in your code it’s accessing a member that holds a null reference. Please run & debug your function locally to find the possible cause, you may find this tutorial helpful: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code?pivots=programming-language-csharp#run-the-function-locally

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.