question

Chiranjeevi avatar image
Chiranjeevi asked

Azure Function failed calling via Rules

I've just followed this tutorial and tested with local debugging, everything worked fine and after deploying adding the HelloWorld function in Rules for com.playfab.player_added_title throws below error.

unity3dCloudScriptContent
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.

Chiranjeevi avatar image Chiranjeevi commented ·

ScreenShot:

0 Likes 0 ·
playfab-error.png (54.6 KiB)
Sarah Zhang avatar image Sarah Zhang Chiranjeevi commented ·

Do you mean you haven't did any modification for the function - HelloWorld, and tried to trigger it using the Rule?

If so, could you please also provide the screenshot of the configuration of the Rule for our reference?

0 Likes 0 ·
Chiranjeevi avatar image Chiranjeevi Sarah Zhang commented ·

@Sarah Zhang pls check

0 Likes 0 ·
playfab-error-2.png (140.2 KiB)
Show more comments
Show more comments
Chiranjeevi avatar image Chiranjeevi Chiranjeevi commented ·

Hi Hello any one out there, its been 10 days since ive posted this question and no proper reply from playfab team. Can someone help me on this, we are completely stuck on this.

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

@Chiranjeevi

Apologies for the delayed replying. Our threads tracking tool occurred some issues, caused me missed the updates of your question.

Thanks for clarifying the error messages in the PlayStream Event. It clearly locates the specific error. For clarification, PlayFab limits the execution time of the CloudScript Functions that triggered by actions can't exceed 1 second. It's a default title limit. You can navigate to your title's [Game Manager]->[Title settings]->[Limits] or the URL - https://developer.playfab.com/en-US/[YourTitleId]/limits (Please use your real TitleID to replace the [YourTitleId]) to check detailed title limits of your title.

Since this limit doesn’t apply to the CloudScript Functions that triggered by API calls. So, you can execute this function successfully from the player-side. The execution time limit of the CloudScript Functions triggered by API calls is 10 seconds. You can find it in your title’s limits page too.

To fix this error, you can modify the logic of the function to control its execution time within 1 second. Or you can use the Queue Triggered Azure Functions to get around this limit. Please check this thread - https://community.playfab.com/questions/38743/how-to-get-functionexecutioncontext-inside-queue-f.html for more information and check the Azure Functions documentation - Azure Queue storage trigger and bindings for Azure Functions overview | Microsoft Docs for more about Queue Triggered Azure Functions.

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.

Chiranjeevi avatar image Chiranjeevi commented ·

@Sarah Zhang, sorry for delay reply, you answer doesnt answered the question and cant be the best answer. Please read this comment, where the actual issue is not getting current player id or master player id from the request after deserialisation. In every attempt using, unity or playfab rules and playfab player cloudscript call, only at playfab player cloudscript we are able to get the current player id with error on execution time limit and in other case its null.

We have failed to complete on attempt for migration to azure functions on time and project has be hand over to client. But still for future projects, we need the same to be done kindly help us to resolve asap. Thanks

0 Likes 0 ·
onedevapp avatar image
onedevapp answered

@Sarah Zhang @Brendan we are also facing same issue. We have written and tested locally which worked well but we tried to execute the same from after deploying to azure portal and we ran into same issue. We have documented every step we did at this repo.

3 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.

Sarah Zhang avatar image Sarah Zhang commented ·

For clarification, current question described an issue that the execution time of CloudScript using Azure Functions (CSAF) triggered by actions exceed the title limit. And your question is the CSAF can work fine in the locally testing, and it gets some errors after you deployed it, is it right? If so, it may not the same issue.

Could you please provide the reproduced steps and detailed error messages for our reference?

0 Likes 0 ·
onedevapp avatar image onedevapp Sarah Zhang commented ·

@Sarah Zhang, Apologies for the confusion, but as we mentioned, entire steps have been documented at this github repo for furutre references.

We also faced the exact same issue and also which worked locally but didnt work on after uploading to server.

0 Likes 0 ·
onedevapp avatar image onedevapp onedevapp commented ·

To carify more, this issue comes with Azure functions with C# and when our internal team took a chance and moved from C# to TypedScript, they achieved and able to get master player id.

0 Likes 0 ·

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.