Hey,
i am trying to create an azure function to run 2 API calls every day.
i have two questions that drive me crazy:
1.
i looked at the Get started and sample projects and they all had this line:
[FunctionName("GetCountPlayersInSegmentAndUpdateTitleData")] public static async Task<dynamic> GetCountPlayersInSegmentAndUpdateTitleData( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log) { PlayStreamEventHistory<dynamic> context = JsonConvert.DeserializeObject<PlayStreamEventHistory<dynamic>>(await req.ReadAsStringAsync());
for me, this line return context = null.
do i need to do something else?
*** i need the context for this rows:
PlayFabSettings.staticSettings.TitleId = context.TitleAuthenticationContext.Id; PlayFabSettings.staticSettings.DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process);
2. i set TitleId and PLAYFAB_DEV_SECRET_KEY manually inside the code. the function run perfectly . so i created a scheduled tasks to run daily. but when i run this task manually i got staus failed with this log:
{ "TaskInstanceId": "DE87C6AE4A3C9D13-3", "TaskIdentifier": { "Name": "GetCountPlayersInSegmentAndUpdateTitleData", "Id": "DE87C6AE4A3C9D13" }, "StartedAt": "2020-10-15T14:16:55.659133", "CompletedAt": "2020-10-15T14:17:00.2059635", "Status": "Failed", "PercentComplete": null, "EstimatedSecondsRemaining": null, "ScheduledByUserId": "89ECA9AFDF1BC51B", "Result": null }
do i need to return specific object \ value from my function?