Class ServiceContext
- Namespace
- FoundationaLLM.Common.Authentication
- Assembly
- FoundationaLLM.Common.dll
Provides the context of the current service.
public static class ServiceContext
- Inheritance
-
ServiceContext
- Inherited Members
Properties
AzureCredential
The default Azure credential to use for authentication.
public static TokenCredential? AzureCredential { get; set; }
Property Value
Production
Indicates whether the environment we run in is production or not.
public static bool Production { get; set; }
Property Value
ServiceIdentity
The UnifiedUserIdentity of the service based on its managed identity."/>
public static UnifiedUserIdentity? ServiceIdentity { get; set; }
Property Value
ServiceName
Gets or sets the name of the service.
public static string ServiceName { get; set; }
Property Value
Methods
CreateAzureCredential()
Creates a new TokenCredential.
public static TokenCredential CreateAzureCredential()
Returns
- TokenCredential
A ManagedIdentityCredential instance if Production is true and an AzureCliCredential instance otherwise.
Initialize(bool, string, string)
Initializes the service context.
public static void Initialize(bool production, string serviceName, string scope = "api://FoundationaLLM-Authorization")