question

yogev avatar image
yogev asked

playFab namespace not found trying to use azure function

Hey, I am trying to program azure function I followed the tutorial ( https://learn.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart)

But for some reason it won't find playfab namespace

I did this command dotnet add package PlayFabAllSDK and I checked CitiesFun.csproj the playfabsdk reference is in there

 <PackageReference Include="PlayFabAllSDK" Version="1.146.230220" />

this is the code that I am trying to run https://pastecode.io/s/2qtjyo64

what should I do ?

Player Data
6 comments
10 |1200

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

yogev avatar image yogev Simon Cui commented ·

Thank you I will check it out, I am using vs code

1 Like 1 ·
Simon Cui avatar image Simon Cui yogev commented ·

Thanks for the reply. Please let us know once you have further questions.

0 Likes 0 ·
Show more comments

1 Answer

·
Simon Cui avatar image
Simon Cui answered

Hello, I modified with your codes to make it works. Basically, client API is not recommended to use in server. You may try the codes shown below. Any thoughts will be appreciated. The code link is in here: https://pastecode.io/s/epcwxe0b

7 comments
10 |1200

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

yogev avatar image yogev commented ·

Hey, Thank you so much for helping me I don't get errors anymore seems so so it was because of using PlayFab.ClientModels ?

and another thing is there any good tutorial that you can recommend to learn more about it ?

and thank you again :)

0 Likes 0 ·
Simon Cui avatar image Simon Cui yogev commented ·

Yes. Besides the quickstart of Azure Function, you may follow those tutorials to learn more about it. 5600-image.png

Such as Tutorial: Using CloudScript context models.

0 Likes 0 ·
image.png (32.1 KiB)
yogev avatar image yogev commented ·

nvm I fixed it

0 Likes 0 ·
yogev avatar image yogev commented ·

After some more testing its working !:) now the context.CallerEntityProfile.DisplayName returns null how can I get the display name of the user?

0 Likes 0 ·
Simon Cui avatar image Simon Cui yogev commented ·

Hi, you can refer to this post: https://community.playfab.com/questions/43805/callerentityprofiledisplayname-is-null-in-azure-fu.html Using Server API GetUserAccountInfo to get a display name is a workaround.

0 Likes 0 ·
yogev avatar image yogev Simon Cui commented ·

nvm I fixed it thank you for now

1 Like 1 ·
Show more comments

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.