question

DP avatar image
DP asked

Specifying Azure Functions App Keys when linking to CloudScript?

Is there a way to globally specify an App Key for all the functions I am registering with CloudScript? I see that I can specify ?code= as a parameter and that appears to work, but that makes key rotation pretty onerous.

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

Seth Du avatar image Seth Du ♦ commented ·

May I ask what's the scenario? What does it mean by "when linking to Cloud Script"? Do you mean the App settings of Azure? https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#settings

0 Likes 0 ·
DP avatar image DP Seth Du ♦ commented ·

Specifically, I'm registering an Azure HTTP Function with PlayFab's CloudScript capability. I want to secure these functions, and so I've set the Azure Function's security authLevel to "function". This means, I need a pre-shared key to be passed as the `code` query parameter. From what I can tell, I can hard code this param directly into the URL when I register the function, but this will make rotating these keys take more time. I'd like a way to provide an Azure Function pre-shared App Key that can apply to all my functions so that it can be easily rotated out.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ DP commented ·

Sorry, are you trying to deploy Azure Function for external use? In the common scenario, if it is simply for PlayFab use, after the function is deployed on Azure from Visual Studio (Code). You may register the function in PlayFab Game Manager. What you are trying to do should have done by PlayFab, which means when a player call ExecuteFunction API, the context of the player will be verified by PlayFab and pass through to Azure Function's argument.

Both Cloud Script and Azure function are not designed to handle administrative actions.

0 Likes 0 ·
Show more comments

1 Answer

·
DP avatar image
DP answered

Following up, there is no way to do this globally, each URL that is registered must explicitly define a ?code parameter for themselves. This will make key rotation very annoying as you'll need to modify each function URL registered with PlayFab manually.

10 |1200

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

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.