question

accounts-5 avatar image
accounts-5 asked

PlayerProfile is null when calling Azure Function through Player Profile

I just wanted to test a function through the Player Profile "Cloud Script" Tab. The Function uses the PlayerProfile from the PlayerPlayStreamFunctionExecutionContext because I need the PlayFabId to use in the GetUserDataRequest. When calling in the game it works but the PlayerProfile is null when going through the PlayFab Dashboard.

Is this by design or should I have written it differently in the first place? Appreciate help :)

Player DataCloudScript
2 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.

Gosen Gao avatar image Gosen Gao commented ·

May I know how you are triggering the Azure Function that causes the PlayerProfile to be null?

0 Likes 0 ·
accounts-5 avatar image accounts-5 Gosen Gao commented ·

I just solved it. Didn't know I can't PlayerPlayStreamFunctionExecutionContext when calling from the player profile.

0 Likes 0 ·

1 Answer

·
accounts-5 avatar image
accounts-5 answered

I just solved it. Didn't know I can't PlayerPlayStreamFunctionExecutionContext when calling from the player profile.

1 comment
10 |1200

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

Gosen Gao avatar image Gosen Gao commented ·

Azure Functions called from different ways should use different Context, you can refer to Tutorial: Using CloudScript context models.

1 Like 1 ·

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.