As much as I hate the complexity and unintuitive nature of Azure Functions vs the legacy Cloudscript system, I've accepted the mandate and I'm now trying to adapt. It's not going well. I think the problem is that you provided contradictory tutorials. Your PlayFab samples on github do not match your documentation for the QuickStart but are referenced there.
1. When I run an Azure Function locally, I pass in the request body {"name":"Matt"}. I assume that Json body is what the FunctionParameter would be when I call ExecuteFunction from my client. When I use the following code, however, there's no data there.
FunctionExecutionContext<dynamic> context = JsonConvert.DeserializeObject<FunctionExecut ionContext<dynamic>>(await req.ReadAsStringAsync()); dynamic args = context.FunctionArgument;
I try to just output args and it's an empty string.
2. You mentioned having access to CurrentPlayerId the same way the legacy cloudscript did, however, I have not been able to find access to it without the compiler error for not knowing what the symbol means. The PlayFab.Samples seems to get it from the context, but the context there is just a FunctionContext of which I can't use because it doesn't exist?
3. The following line produces an error, but perhaps that's because I'm making the call locally?
string message = $"Hello {context.CallerEntityProfile.Lineage.MasterPlayerAccountId}!";
If that's the case, what's the point of running locally once I actually start building my code if it'll always return errors?
Honestly, I'm very confused as to what is correct and what is old. I can't even successfully get a function to spit out the argument I sent in, so I can only imagine it'll be more difficult once I try to actually make server calls (if I even can with how I built this).
Can someone please provide a very clear-cut example of what my function should look like, today in 2022, that would take in a Json argument, make some PlayFab server API calls, then return another Json object the way I used to in legacy cloud.
Please include the using directives, because they also don't match and I'm not even sure if, for a production build, I should be using something called PlayFab.Samples.
Thank you very much for the help, I really want to get a handle on how this works!
-Matt