Hi there guys,
We've been testing the Azure Function API to try and get rid of execution time spikes on our CloudScript functions.
We first followed the guide from the docs to get used to Azure Functions by themselves. Everything was fine, worked like a charm both locally and remote by calling functions from a browser.
Then we switched to calling those Azure functions from PlayFab, using our game made in Unity. At first, we made the call without changing the AzureFunction function, just to check that AzureFunction calls could be made from PlayFab. We followed the guide from PlayFab docs to link the function and the call was made, with the following error showing:
/CloudScript/ExecuteFunction: The function TestAzureFunction was terminated after the maximum execution time limit: 10000ms
We thought that the error came from calling a non queue function, so we searched for any more in-depth docs, which we didn't find. So in order to get a proper call we just followed the docs, left the Azure docs example and copied the exact same code as the example in the PlayFab docs.
using System.Net.Http; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.Extensions.Logging; using PlayFab; using PlayFab.Plugins.CloudScript; namespace PlayFabCS2AFTests.HelloWorld { public static class HelloWorld { [FunctionName("HelloWorld")] public static async Task<dynamic> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestMessage req, ILogger log) { /* Create the function execution's context through the request */ var context = await FunctionContext<dynamic>.Create(req); var args = context.FunctionArgument; var message = $"Hello {context.CurrentPlayerId}!"; log.LogInformation(message); dynamic inputValue = null; if (args != null && args["inputValue"] != null) { inputValue = args["inputValue"]; } log.LogDebug($"HelloWorld: {new { input = inputValue} }"); return new { messageValue = message }; } } }
So, to our surprise, we now get an invocation failure:
/CloudScript/ExecuteFunction: Invocation of cloud script function HelloWorldfailed
We configured everything according to the docs and we deployed the new version but when it comes to use the function in the docs, there's a function invocation error.
Has anyone encountered the same problem? Does anyone know where the error may be coming?
Thanks in advance, guys.