An Azure service that provides an event-driven serverless compute platform.
When changing the HTTP trigger from AuthorizationLevel.Anonymous to AuthorizationLevel.Function, the URL that PlayFab uses must include a valid function access key.
For HTTP-triggered Azure Functions, when the authorization level is anything other than anonymous, every request must provide an access key either:
- As a
?code=<API_KEY>query string parameter, or - In the
x-functions-keyHTTP header.
PlayFab calls the function by using the Function URL that is registered in Cloud Script. Because PlayFab doesn’t add the key header for you, the simplest approach is to register the full function URL that already includes the key.
So, for your TestFunction with AuthorizationLevel.Function:
- In the Azure portal, open the function → Get function URL.
- Choose the default Function key.
- Copy the full URL, which looks like:
https://<APP_NAME>.azurewebsites.net/api/TestFunction?code=<FUNCTION_KEY> - In PlayFab Cloud Script → Register Function, paste this full URL (including
?code=...) into Function URL.
This change is necessary when moving from anonymous to function authorization; otherwise PlayFab’s calls will be rejected with authorization errors.
References: