Skip to content

Commit 1a008cf

Browse files
fix: Replace AzurePipelinesCredential with ClientSecretCredential due to problems with FIC
1 parent 255d0ab commit 1a008cf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Core/EnvironmentConfigurationExtension.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ public static EnvironmentConfiguration AddEnvironmentConfiguration(
6060
managedIdentityResourceIdFunc(environmentConfiguration)),
6161
RuntimeEnvironment.Cloud when managedIdentityResourceIdFunc is null => new ManagedIdentityCredential(),
6262
RuntimeEnvironment.UnitTest => new TokenCredentialMock(),
63-
RuntimeEnvironment.BuildServer => new AzurePipelinesCredential(
64-
tenantId: Environment.GetEnvironmentVariable("APP_REG_TENANT_ID") ?? throw new InvalidOperationException("APP_REG_TENANT_ID environment variable is not set."),
65-
clientId: Environment.GetEnvironmentVariable("APP_REG_CLIENT_ID") ?? throw new InvalidOperationException("APP_REG_CLIENT_ID environment variable is not set."),
66-
serviceConnectionId: Environment.GetEnvironmentVariable("APP_REG_SERVICE_CONNECTION_ID") ?? throw new InvalidOperationException("APP_REG_SERVICE_CONNECTION_ID environment variable is not set."),
67-
systemAccessToken: Environment.GetEnvironmentVariable("SYSTEM_ACCESS_TOKEN") ?? throw new InvalidOperationException("SYSTEM_ACCESS_TOKEN environment variable is not set.")),
63+
RuntimeEnvironment.BuildServer => new ClientSecretCredential(
64+
tenantId: Environment.GetEnvironmentVariable("AZURE_TENANT_ID") ?? throw new InvalidOperationException("AZURE_TENANT_ID environment variable is not set."),
65+
clientId: Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") ?? throw new InvalidOperationException("AZURE_CLIENT_ID environment variable is not set."),
66+
clientSecret: Environment.GetEnvironmentVariable("AZURE_CLIENT_SECRET") ?? throw new InvalidOperationException("AZURE_CLIENT_SECRET environment variable is not set.")),
6867
_ => throw new NotSupportedException(
6968
$"Runtime environment {environmentConfiguration.RuntimeEnvironment} is not supported"),
7069
};

0 commit comments

Comments
 (0)