In PlayFab Game Manager, navigate to Automation > CloudScript > Functions and register an Azure Function endpoint by providing its HTTPS trigger URL and a function name.
Deploy your Azure Function with an HTTP trigger; the function receives a POST body containing FunctionArgument (your custom payload), CallerEntityProfile, and TitleAuthenticationContext — use these to validate the calling player.
Call the function from your game client via POST /CloudScript/ExecuteFunction with the FunctionName, FunctionParameter payload, and the player's Entity Token in the X-EntityToken header.
Use the PlayFab Server SDK or direct REST calls with your title's secret key inside the Azure Function to perform authoritative actions (e.g., grant items, update stats) that clients must not perform directly.
Return a result object from the Azure Function; PlayFab wraps it in the FunctionResult field of the ExecuteFunction response delivered to the client.
Enable logging in your Azure Function and monitor execution results in Game Manager under Automation > CloudScript > Revisions for debugging.
Known gotchas
The legacy CloudScript (JavaScript hosted by PlayFab) and the newer Azure Functions integration are separate systems; Game Manager shows both, and migrating between them requires re-registering function names and updating client call sites.
Azure Function cold starts can add significant latency on infrequent calls; use a Premium or App Service plan (not Consumption) for latency-sensitive game logic, or implement client-side timeout handling.
Never trust FunctionArgument from the client for security-critical decisions (e.g., currency amounts); always re-fetch authoritative state from PlayFab inside the function using the server SDK rather than accepting client-supplied values.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp