question

juanrodriguezgiles avatar image
juanrodriguezgiles asked

Server Only Azure Function

In our game we have a couple of Azure Functions registered in Automation->Cloud Script that we only want to call from the server (scheduled tasks, rules, etc). How can we make sure that they can't be executed through the PlayFabCloudScriptAPI.ExecuteFunction or an api platform like postman?

CloudScript
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

·
Xiao Zha avatar image
Xiao Zha answered

Since you only want to make calls from the server (scheduled tasks, rules, etc.), there will be no way for others to know about your Azure Functions and how they are used internally. Therefore, as long as you do not leak information about your Azure functions, you don't have to worry about your Azure Function being called by the Execute Function API.

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.

juanrodriguezgiles avatar image juanrodriguezgiles commented ·

Thanks, is there a way to add an additional layer of security just in case the Azure function url is compromised? Someway to check that the function is being called through Playfab (St, rules, etc)

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha juanrodriguezgiles commented ·

Since the ExecuteFuction API use a different context model than ScheduledTask and Rules, you may verify the caller of the Azure Function by determining whether the context contains certain data. You may refer to PlayFab CloudScript using Azure Functions Context Models - PlayFab | Microsoft Learn to have more information about the context model.

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.