question

Toni Palm avatar image
Toni Palm asked

Is it possible to call Azure Functions from CloudScript?

I'm trying to use server.ExecuteCloudScript CloudScript to call Azure Function but that says "No function named XYZ was found to execute". Is there a way to call Azure Functions from CloudScript, other than explicitly making an HTTP call?

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

Seth Du avatar image Seth Du ♦ commented ·

We will spend some time to try to implement this. You may refer to this API first: https://docs.microsoft.com/en-us/rest/api/playfab/cloudscript/server-side-cloud-script/executefunction?view=playfab-rest. Please note that this API belongs to Entity API set.

0 Likes 0 ·
brendan avatar image
brendan answered

Azure Functions integration is in public preview - you can read all about it here: https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/. And you can find the page to register your Functions in the Automation section of the Game Manager.

10 |1200

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

Toni Palm avatar image
Toni Palm answered

Let me clarify. I have the "old" CloudScript (JavaScript). There are some pretty complex kludges that I've implemented to work around the PlayFab/CloudScript limitations. Now I would like to move these complex parts to Azure, but not everything, and therefore I want to call Azure Function from the JavaScript/CloudScript. I couldn't find anything about that in the documentation.

10 |1200

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

Seth Du avatar image
Seth Du answered

I have done more tests and it seems currently ExecuteFunction API doesn’t include in Cloud Script implementation, you may still need craft HTTP call to access it in Cloud Script. However, ExecuteFunction API itself has been updated to most of the platform SDKs. You are free to use both of them at the client side.

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.

Toni Palm avatar image Toni Palm commented ·

This would be my choice as the "best answer" but in this forum apparently the people who respond decide their own replies are the best :-D

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Toni Palm commented ·

BTW, it will be great if you can send a thread on the Feature Requests forum and if more people can see this request, votes from them may help with the priority.

0 Likes 0 ·
Toni Palm avatar image Toni Palm Seth Du ♦ commented ·

Done

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.