I have gotten a HelloWorld function running and several API calls work as expected. However, when I call the following code from the client via PlayFab invoke Cloudscript, I get the following error:
{ "ExecutionTimeMilliseconds": 351, "FunctionName": "HelloWorld", "FunctionResult": { "result": null, "customData": null, "error": { "httpCode": 400, "httpStatus": "BadRequest", "error": 1001, "errorMessage": "master_player_account 3159395147665980277 not found in namespace 1AF050D54886430B", "errorDetails": null, "requestId": "Failed to Enumerate RequestId. Exception message: Enumeration has not started. Call MoveNext." } }, "FunctionResultTooLarge": null, "Error": null, "Status": 200 }
Bellow is my Azure Function. Please note I made other API calls and environment variables are setup properly.
[FunctionName("HelloWorld")] public static async Task<dynamic> HelloWorld( [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestMessage req, ILogger log) { /* Create the function execution's context through the request */ var context = await FunctionContext<dynamic>.Create(req); var serverApi = new PlayFabServerInstanceAPI(context.ApiSettings, context.AuthenticationContext); log.LogInformation("Updated user data for " + context.CurrentPlayerId); return await serverApi.UpdateUserDataAsync(new UpdateUserDataRequest { PlayFabId = context.CurrentPlayerId, Data = new Dictionary<string, string>() { { "PLS", "haha"} } }); }
Why is this error happening? I am following the same code from the docs. Fuctions V3.