question

szcuipeng avatar image
szcuipeng asked

can i local debug cloudscript using Azure functions to GetTitleData?

can i local debug cloudscript using Azure functions to GetTitleData?

i use vscode to open an Azure function project , and F5 to start debugging

then i start edge nav to:

http://localhost:7071/api/CollectUserEvent

an breakpoint stoped in CollectUserEvent, but when i called :

var api = new PlayFabServerInstanceAPI... var result = api.GetTitleDataAsync..

i got an error:

"The URL for this request is not valid for this title. The correct API endpoint is https://?????.playfabapi.com/"

...

Player DataCloudScriptTitle Data
10 |1200

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

Xiao Zha avatar image
Xiao Zha answered

The error message indicates that the Title Id and Secret Key do not match, you may need to check that again. You can refer to Local debugging for Cloudscript using Azure Functions - PlayFab | Microsoft Learn to set your local debug environment. Also, If by “then i start edge nav to: http://localhost:7071/api/CollectUserEvent” you mean you paste the Function URL to the Edge browser address bar, it’s not the correct way to call the AzureFunction, you need to call the ExecuteFunction API with the Function Name to execute the Function. For more information about writing and executing a PlayFab CloudScript using Azure Functions, you may refer to PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Learn.

10 |1200

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

szcuipeng avatar image
szcuipeng answered

please help me about local debug cloudscript using azure function.

i following the article: https://learn.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/local-debugging-for-cloudscript-using-azure-functions

the function.txt is my full source code, i am using vs code.

i called LoginWithServerCustomIdAsync then ExecuteFunction in server side, but i got an error:

Must call Client Login or GetEntityToken before calling this method

PlayFabServerInstanceAPI does not have a function called ExecuteFunction or ExecuteFunction Async

only PlayFabServerAPI have it

where i put playfab.local.settings.json ? i put it to temp dir and vscode project dir, i do not know where is the execute path of m5873-function.txty local server.

and do it need deploy the azure function app before i start local debug ?

any advice will be appreciated!


function.txt (1.7 KiB)
1 comment
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.