We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51067de commit d665c9bCopy full SHA for d665c9b
1 file changed
App/backend-api/Microsoft.GS.DPS.Host/Helpers/azure_credential_utils.cs
@@ -9,6 +9,15 @@ public static class AzureCredentialHelper
9
{
10
public static TokenCredential GetAzureCredential(string clientId = null)
11
12
+ """
13
+ Returns an Azure credential based on the application environment.
14
+ If the environment is 'dev', it uses DefaultAzureCredential.
15
+ Otherwise, it uses ManagedIdentityCredential.
16
+ Args:
17
+ client_id (str, optional): The client ID for the Managed Identity Credential.
18
+ Returns:
19
+ Credential object: Either DefaultAzureCredential or ManagedIdentityCredential.
20
21
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
22
23
if (string.Equals(env, "Development", StringComparison.OrdinalIgnoreCase))
0 commit comments