Hi, as part of Apple's requirement for players to be able to delete accounts from within a game, we're trying to call an Azure function to invoke DeleteMasterPlayer (since that is not available within the normal API)
Our Azure function (below) appears to run correctly, but the player's account does not get deleted. Any help much appreciated!
[FunctionName("nmPFDeleteMasterAccount")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] FunctionExecutionContext<dynamic> req, HttpRequest httpRequest, ILogger log) { var serverSettings = new PlayFab.PlayFabApiSettings() { TitleId = Settings.TitleId, DeveloperSecretKey = Settings.TitleSecret }; var titleAuthContext = new PlayFabAuthenticationContext(); titleAuthContext.EntityToken = req.TitleAuthenticationContext.EntityToken; var request = new PlayFab.AdminModels.DeleteMasterPlayerAccountRequest() { PlayFabId = req.CallerEntityProfile.Lineage.MasterPlayerAccountId, AuthenticationContext = titleAuthContext }; log.LogInformation($"Request is : {JsonConvert.SerializeObject(request)}"); var adapi = new PlayFabAdminInstanceAPI(serverSettings, titleAuthContext); var deleteResponse = adapi.DeleteMasterPlayerAccountAsync(request); return (ActionResult)new OkObjectResult($"OK"); } } Here is the output from the Azure console (EntityToken removed): 2022-02-18 16:30:18.290 Executing 'nmPFDeleteMasterAccount' (Reason='This function was programmatically called via the host APIs.', Id=996c8ea3-3f41-4d31-8f46-735aa1bb1929) 2022-02-18 16:30:18.322 Request is : {"MetaData":null,"PlayFabId":"6D5E9FEFC14C0B93","AuthenticationContext":{"ClientSessionTicket":null,"PlayFabId":null,"EntityToken":"..removed..","EntityId":null,"EntityType":null}} 2022-02-18 16:30:18.349 Executed 'nmPFDeleteMasterAccount' (Succeeded, Id=996c8ea3-3f41-4d31-8f46-735aa1bb1929, Duration=124ms)