Hello, I'm trying to get a string type from unity to pass it in my azure function. I'm using this code to provide the player an option to delete their master player account
public class FunctionExecutionContext<T>
{
public PlayFab.ProfilesModels.EntityProfileBody CallerEntityProfile { get; set; }
public TitleAuthenticationContext TitleAuthenticationContext { get; set; }
public bool? GeneratePlayStreamEvent { get; set; }
public T FunctionArgument { get; set; }
}
public static class HttpExample
{
[FunctionName("HttpExample")]
public static async Task<dynamic> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
PlayFabSettings.staticSettings.TitleId = "...";
PlayFabSettings.staticSettings.DeveloperSecretKey = "...";
FunctionExecutionContext<dynamic> context = JsonConvert.DeserializeObject<FunctionExecutionContext<dynamic>>(await req.ReadAsStringAsync());
dynamic args = context.FunctionArgument;
var task = await PlayFabAdminAPI.DeleteMasterPlayerAccountAsync(new DeleteMasterPlayerAccountRequest()
{
PlayFabId = args.loggedInPlayfabId
});
string responseMessage = "success";
return new OkObjectResult(responseMessage);
}
}
}
I'm having a problem getting the parameter from unity to azure function. The code works fine but whenever I put this line: dynamic args = context.FunctionArgument; I get this error: Exception while executing function: HttpExample. Azure Function: Object reference not set to an instance of an object
maybe the code is correct but I need to do something in the azure portal? I'm fairly new to coding and azure function. any help would be appreaicated :)