Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #89 #179

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/PlayFabBuddy.Infrastructure/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Kusto.Data;
using Kusto.Cloud.Platform.Utils;
using Kusto.Data;
using Kusto.Data.Common;
using Kusto.Data.Net.Client;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -39,7 +40,8 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
string adminEntityToken;
PlayFabConfig pfConfig;

if (config["titleId"] is not null && config["devSecret"] is not null)
if (config["titleId"] != null && config["devSecret"] != null && config["titleId"] != "<YourTitleId>" &&
config["devSecret"] != "<YourDevSecret>")
{
pfConfig = new PlayFabConfig(config["titleId"]!, config["devSecret"]!);
adminEntityToken = pfConfig.InitAsync().Result;
Expand Down Expand Up @@ -67,8 +69,8 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
services.AddTransient<IPolicyAdapter, PolicyAdapter>();

// Register KUSTO
if (config["PFDataCluster"] is not null || config["PFDataClientId"] is not null ||
config["PFDataClientSecret"] is not null)
if (config["PFDataCluster"].IsNotNullOrEmpty() && config["PFDataClientId"].IsNotNullOrEmpty() &&
config["PFDataClientSecret"].IsNotNullOrEmpty())
{
var kustoConnectionString = new KustoConnectionStringBuilder(config["PFDataCluster"], config["titleId"])
.WithAadApplicationKeyAuthentication(config["PFDataClientId"], config["PFDataClientSecret"],
Expand All @@ -79,7 +81,6 @@ public static IServiceCollection AddInfrastructure(this IServiceCollection servi
services.AddTransient<IDataExplorerAdapter, DataExplorerAdapter>();
}


return services;
}
}