using System; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using PlayFab; using PlayFab.ServerModels; using PlayFab.CloudScriptModels; namespace poolxplay.Functions { public static class Debug { [FunctionName("Debug")] public static async Task Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { PlayFabSettings.staticSettings.TitleId = Environment.GetEnvironmentVariable("PLAYFAB_TITLE_ID"); PlayFabSettings.staticSettings.DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY"); var loginRequest = new LoginWithServerCustomIdRequest() { CreateAccount = true, ServerCustomId = "my_custom_00", }; PlayFabResult loginResult; try { loginResult = PlayFabServerAPI.LoginWithServerCustomIdAsync(loginRequest, null).Result; } catch (AggregateException e) { throw e.InnerException; } var request = new ExecuteFunctionRequest() { FunctionName = "CollectUserEvent2", FunctionParameter = new { A = "1" }, GeneratePlayStreamEvent = false }; var result = PlayFabCloudScriptAPI.ExecuteFunctionAsync(request); await result; var msg = ""; return new { messageValue = msg}; } } }