Hello I have just started to work with Azur Functions.
Currently I have the following problem and it would be great if someone here could help me.
When I call my function, I cannot read out the parameters:
LogPlayFab: Request: {
"FunctionName": "HelloWorld",
"FunctionParameter":
{
"name": "Sebi"
},
"GeneratePlayStreamEvent": true
}
LogPlayFab: Response : {"code":200,"status":"OK","data":{"ExecutionTimeMilliseconds":1022,"FunctionName":"HelloWorld","FunctionResult":"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."}}
Function:
public static class HelloWorld
{
[FunctionName("HelloWorld")]
public static async Task<dynamic> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string name = req.Query["name"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
name = name ?? data?.name;
string responseMessage = string.IsNullOrEmpty(name)
? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
: $"Hello, {name}. This HTTP triggered function executed successfully.";
return new OkObjectResult(responseMessage);
}
}
What am I doing wrong here with the request?
I don't quite understand how to call AddInventoryItems for a player in azure. Does anyone have an example for me?
PlayFab.EconomyModels.AddInventoryItemsRequest
PlayFab.EconomyModels.AddInventoryItemsResponse
PlayFab.EconomyModels.AddInventoryItemsOperation
Thank you in advance.