question

Greggory Addison avatar image
Greggory Addison asked

PlayFab Developer Secret Key Null Even Though Its Set In Azure App Settings

I'm currently getting an error about my DeveloperSecretKey not being valid when attempting to call functions on the server api. Thing is, I do have my secret key set as a global variable in my app's settings. Is there any other known issues that could cause this to happen?

Azure Web Function Config

Here is where I'm using the secret key but the function returns on this null check meaning my key is not getting set..

 // Title settings for authentication on the server side
         var apiSettings = new PlayFabApiSettings()
         {
             TitleId = Environment.GetEnvironmentVariable("PLAYFAB_TITLE_ID", EnvironmentVariableTarget.Process),
             DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_SECRET_KEY", EnvironmentVariableTarget.Process)
         };
    
         if (apiSettings.DeveloperSecretKey == null)
         {
             const string responseMessage = "This Function Ran But We Couldn't Find The DeveloperSecretKey";
             return new OkObjectResult(responseMessage);
         }
apisCloudScriptTitle Dataunreal
image.png (40.5 KiB)
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.

Greggory Addison avatar image Greggory Addison commented ·

One of my Azure functions is working fine using the same playfab settings constructor but this one isn't and I cant figure out why or how.

0 Likes 0 ·

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

The code you provided seems correct. Is the TitleId also null? And is the problematic Azure Function under the same Function App as the working Azure Function?

Since this is an Azure Function issue, if you are still having this issue, I'd suggest you open a support ticket to Azure Function Support team.

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.