Hi.
I am working on uploading leaderboard scores with Azure Functions in my Unity Game. For now I have succeeded (the Azure Function works perfectly), but I have one doubt.
This is the Azure Function:
namespace FuncionRankingPrueba1 { public static class RankingPrueba { [FunctionName("UpdateRanking2602V3")] public static async Task<dynamic> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { string name; string time; string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); name = data?.FunctionArgument?.name; time = data?.FunctionArgument?.time; int timeint = int.Parse(time); var request = new UpdatePlayerStatisticsRequest { PlayFabId = data.CallerEntityProfile.Lineage.MasterPlayerAccountId, Statistics = new List<StatisticUpdate> { new StatisticUpdate { StatisticName = name, Value = timeint } } }; var apiSettings = new PlayFabApiSettings { TitleId = data.TitleAuthenticationContext.Id, DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process), }; var serverApi = new PlayFabServerInstanceAPI(apiSettings); return await serverApi.UpdatePlayerStatisticsAsync(request); } } }
I have added an Application Settings in Azure that is the PLAYFAB_DEV_SECRET_KEY, with my SECRET KEY found in Title Settings, so when Environment.GetEnvironmentVariable is called, it founds my DEV_SECRET_KEY. Without this, it doesn't work.
My question is: when I publish my game on the Play Store, do the players use my PLAYFAB_DEV_SECRET_KEY to update their score or do I need to change something of my azure function code?
For example this line of code.
DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process)
Do I also need to change any setting on the Azure Portal?
I don't know if the set up that I have right now is good for testing everything but not when a lot of players upload their scores once the game is on the Play Store.
Thanks.