I am using the admin api and have a problem. Even though I created a function instance with the same settings, some functions are executed, but some functions say that I need to set the developer key. However, the developer key is already set. What's the problem?
[FunctionName("SampleAdminFunc")]
public static async Task<dynamic> SampleAdminFunc(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log)
{
string body = await req.ReadAsStringAsync();
log.LogInformation($"Body: {body}");
var apiSettings = new PlayFabApiSettings
{
TitleId = Environment.GetEnvironmentVariable("PLAYFAB_TITLE_ID", EnvironmentVariableTarget.Process),
DeveloperSecretKey =
Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process),
};
var playfabAdminApi = new PlayFabAdminInstanceAPI(apiSettings);
// error is called 1
var task1 = await PlayFabAdminAPI.GetUserAccountInfoAsync(new AdminModels.LookupUserAccountInfoRequest()
{
PlayFabId = "playfabId",
});
// error is called 2
var task2 = await PlayFabAdminAPI.GetPlayedTitleListAsync(new AdminModels.GetPlayedTitleListRequest()
{
PlayFabId = "playfabId"
});
// running well
var task3 = await playfabAdminApi.DeleteMasterPlayerAccountAsync(new AdminModels.DeleteMasterPlayerAccountRequest()
{
PlayFabId = "playfabId"
});
return null;
}
,I call the admin function to delete the master player or query the player info, but it tells me to set the developer key. However, since the developer key is already set, some functions are called fine. Why does this situation happen?
[FunctionName("SampleAdminFunc")]
public static async Task<dynamic> SampleAdminFunc(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log)
{
string body = await req.ReadAsStringAsync();
log.LogInformation($"Body: {body}");
var apiSettings = new PlayFabApiSettings
{
TitleId = Environment.GetEnvironmentVariable("PLAYFAB_TITLE_ID", EnvironmentVariableTarget.Process),
DeveloperSecretKey =
Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process),
};
var playfabAdminApi = new PlayFabAdminInstanceAPI(apiSettings);
// error is called 1
var task1 = await PlayFabAdminAPI.GetUserAccountInfoAsync(new AdminModels.LookupUserAccountInfoRequest()
{
PlayFabId = "playfabId",
});
// error is called 2
var task2 = await PlayFabAdminAPI.GetPlayedTitleListAsync(new AdminModels.GetPlayedTitleListRequest()
{
PlayFabId = "playfabId"
});
// running well
var task3 = await playfabAdminApi.DeleteMasterPlayerAccountAsync(new AdminModels.DeleteMasterPlayerAccountRequest()
{
PlayFabId = "playfabId"
});
return null;
}