Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" />
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
<PackageReference Include="Markdown2Pdf" Version="2.2.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

var builder = Startup.CreateHostBuilder(args);

if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_TOKEN_CREDENTIALS")))
{
Environment.SetEnvironmentVariable("AZURE_TOKEN_CREDENTIALS", "dev");
}

// Configure Logging
ConfigureLogging(builder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.21.0" />
<PackageReference Include="Markdig" Version="0.40.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static Uri GetQueueUriFromConnectionString(string connectionString, strin

public AzureStorageQueueService(Uri storageQueueUri, ILogger<AzureStorageQueueService> log)
{
this._clientBuilder = queueName => new QueueClient(storageQueueUri, new ManagedIdentityCredential());
this._clientBuilder = queueName => new QueueClient(storageQueueUri, new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName));
this._log = log;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static public BlobServiceClient GetBlobClientFromConnectionString(string Connect
var DefaultEndpointSuffix = "core.windows.net";
var storageAccountName = ConnectionString.Split(';').FirstOrDefault(x => x.Contains("AccountName")).Split('=')[1];
var storageAccountUri = new Uri($"https://{storageAccountName}.blob.{DefaultEndpointSuffix}");
return new BlobServiceClient(storageAccountUri, new ManagedIdentityCredential());
return new BlobServiceClient(storageAccountUri, new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName));
}

static public Stream GetReportResultBlob(string FileName, string ConnectionString)
Expand Down
2 changes: 2 additions & 0 deletions Services/src/esg-ai-doc-analysis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app

ENV AZURE_TOKEN_CREDENTIALS=ManagedIdentityCredential

#ENV ASPNETCORE_ENVIRONMENT Development
#ENV ASPNETCORE_URLS http://+:80

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Microsoft.KernelMemory.Abstractions" Version="0.97.250211.1" />
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion Services/src/kernel-memory/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ RUN \
USER $USER

# Used by .NET and KM to load appsettings.Production.json
ENV ASPNETCORE_ENVIRONMENT Development
ENV ASPNETCORE_ENVIRONMENT=Development
ENV AZURE_TOKEN_CREDENTIALS=ManagedIdentityCredential
#ENV ASPNETCORE_URLS http://+:80


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.AI.FormRecognizer" Version="4.1.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AzureAIDocIntelEngine(
switch (config.Auth)
{
case AzureAIDocIntelConfig.AuthTypes.AzureIdentity:
this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), new ManagedIdentityCredential());
this._recognizerClient = new DocumentAnalysisClient(new Uri(config.Endpoint), new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName));
break;

case AzureAIDocIntelConfig.AuthTypes.APIKey:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.Search.Documents" Version="11.5.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public AzureAISearchMemory(
case AzureAISearchConfig.AuthTypes.AzureIdentity:
this._adminClient = new SearchIndexClient(
new Uri(config.Endpoint),
new ManagedIdentityCredential(),
new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName),
GetClientOptions());
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public AzureBlobsStorage(
{
this.ValidateAccountName(config.Account);
var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix);
client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), new ManagedIdentityCredential());
client = new BlobServiceClient(new Uri($"https://{config.Account}.blob.{suffix}"), new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName));
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.7.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public AzureOpenAITextEmbeddingGenerator(
deploymentName: config.Deployment,
modelId: config.Deployment,
endpoint: config.Endpoint,
credential: new ManagedIdentityCredential(),
credential: new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName),
httpClient: httpClient);
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public AzureOpenAITextGenerator(
switch (config.Auth)
{
case AzureOpenAIConfig.AuthTypes.AzureIdentity:
this._client = new OpenAIClient(new Uri(config.Endpoint), new ManagedIdentityCredential(), options);
this._client = new OpenAIClient(new Uri(config.Endpoint), new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName), options);
break;

case AzureOpenAIConfig.AuthTypes.ManualTokenCredential:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Identity" Version="1.16.0" />
<PackageReference Include="Azure.Storage.Queues" Version="12.17.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public AzureQueuesPipeline(
{
this.ValidateAccountName(config.Account);
var suffix = this.ValidateEndpointSuffix(config.EndpointSuffix);
this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), new ManagedIdentityCredential());
this._clientBuilder = queueName => new QueueClient(new($"https://{config.Account}.queue.{suffix}/{queueName}"), new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName));
break;
}

Expand Down
5 changes: 5 additions & 0 deletions Services/src/kernel-memory/service/Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public static void Main(string[] args)
app.Logger.LogError("ASPNETCORE_ENVIRONMENT env var not defined.");
}

if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AZURE_TOKEN_CREDENTIALS")))
{
Environment.SetEnvironmentVariable("AZURE_TOKEN_CREDENTIALS", "dev");
}

Console.WriteLine("***************************************************************************************************************************");
Console.WriteLine("* Environment : " + (string.IsNullOrEmpty(env) ? "WARNING: ASPNETCORE_ENVIRONMENT env var not defined" : env));
Console.WriteLine("* Memory type : " + ((memory is MemoryServerless) ? "Sync - " : "Async - ") + memory.GetType().FullName);
Expand Down