question

Constantin Beer avatar image
Constantin Beer asked

Where to find FunctionContext in Azure Functions VS Code?

I'm trying to set up Azure Functions for my PlayFab CloudScript, so I can replace my JavaScript CloudScript with Azure Functions. But the whole process is a real pain in the a.. .

Right now I'm trying to test the `MakeAPICall` example from the PlayFab-Samples Github Repo, but somehow if I try to use the `FunctionContext<dynamic>` for the context (see line 108 in the link), I get `The name 'FunctionContext' does not exist in the current context` and don't know how to solve this.

I really appreciate every help.

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Jon avatar image
Jon answered

I had the same question. after tons of searching, it appears those examples are out of date and for netcoreapp v2

The default azure function now is on v3 so you will not be able to import it. If you check the source for the playfab SDK the FunctionContext class is set for v2 only

Here is the v3 examples

https://github.com/Myfreedom614/PlayFab-Azure-Functions/tree/master/FuncAppV3

you will also need this class to use the examples

https://github.com/PlayFab/PlayFab-Samples/blob/master/Samples/CSharp/AzureFunctions/CS2AFHelperClasses.cs

I hope the playfab team can update the docs to be clearer about this

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.