![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.Azure --version 1.14.0
NuGet\Install-Package Microsoft.Extensions.Azure -Version 1.14.0
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.14.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.14.0" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Azure" />Project file
paket add Microsoft.Extensions.Azure --version 1.14.0
#r "nuget: Microsoft.Extensions.Azure, 1.14.0"
#:package Microsoft.Extensions.Azure@1.14.0
#addin nuget:?package=Microsoft.Extensions.Azure&version=1.14.0Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Azure&version=1.14.0Install as a Cake Tool
Microsoft.Extensions.Azure provides shared primitives to integrate Azure clients with ASP.NET Core dependency injection and configuration systems.
Install the ASP.NET Core integration library using NuGet:
dotnet add package Microsoft.Extensions.Azure
Make a call to AddAzureClients in your app's ConfigureServices method. You can use the provided builder to register client instances with your dependency injection container.
// Registering policy to use in ConfigureDefaults later
builder.Services.AddSingleton<DependencyInjectionEnabledPolicy>();
builder.Services.AddAzureClients(azureBuilder => {
// Register blob service client and initialize it using the KeyVault section of configuration
azureBuilder.AddSecretClient(builder.Configuration.GetSection("KeyVault"))
// Set the name for this client registration
.WithName("NamedBlobClient")
// Set the credential for this client registration
.WithCredential(new ClientSecretCredential("<tenant_id>", "<client_id>", "<client_secret>"))
// Configure the client options
.ConfigureOptions(options => options.Retry.MaxRetries = 10);
// Adds a secret client using the provided endpoint and default credential set later
azureBuilder.AddSecretClient(new Uri("http://my.keyvault.com"));
// Configures environment credential to be used by default for all clients that require TokenCredential
// and doesn't override it on per registration level
azureBuilder.UseCredential(new EnvironmentCredential());
// This would use configuration for auth and client settings
azureBuilder.ConfigureDefaults(builder.Configuration.GetSection("Default"));
// Configure global retry mode
azureBuilder.ConfigureDefaults(options => options.Retry.Mode = RetryMode.Exponential);
// Advanced configure global defaults
azureBuilder.ConfigureDefaults((options, provider) => options.AddPolicy(provider.GetService<DependencyInjectionEnabledPolicy>(), HttpPipelinePosition.PerCall));
// Register blob service client and initialize it using the Storage section of configuration
azureBuilder.AddBlobServiceClient(builder.Configuration.GetSection("Storage"))
.WithVersion(BlobClientOptions.ServiceVersion.V2019_02_02);
});
To use the client request the client type from any place that supports Dependency Injection (constructors, Configure calls, @inject razor definitions etc.)
var secretClient = app.Services.GetRequiredService<SecretClient>();
var blobClientFactory = app.Services.GetRequiredService<IAzureClientFactory<BlobServiceClient>>();
If client is registered as a named client inject IAzureClientFactory<T> and call CreateClient passing the name:
BlobServiceClient blobServiceClient = blobClientFactory.CreateClient("NamedBlobClient");
Configuration file used in the sample above:
{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"AllowedHosts": "*",
"Default": {
"ClientId": "<client_id>",
"ClientSecret": "<client_secret>",
"TenantId": "<tenant_id>",
"TelemetryPolicy": {
"ApplicationId": "AppId"
}
},
"KeyVault": {
"VaultUri": "<vault_uri>"
},
"Storage": {
"serviceUri": "<service_uri>",
"credential": {
"accountName": "<account_name>",
"accountKey": "<account_key>"
}
}
}
If you want to take control over how the client instance is created or need to use other dependencies during the client construction use the AddClient<TClient, TOptions> method.
Here's and example of how to use IOptions<T> instance to construct the client:
public class MyApplicationOptions
{
public Uri KeyVaultEndpoint { get; set; }
}
public void ConfigureServices(IServiceCollection services)
{
// Configure a custom options instance
services.Configure<MyApplicationOptions>(options => options.KeyVaultEndpoint = new Uri("http://localhost/"));
services.AddAzureClients(builder =>
{
// Register a client using MyApplicationOptions to get constructor parameters
builder.AddClient<SecretClient, SecretClientOptions>((options, credential, provider) =>
{
var appOptions = provider.GetService<IOptions<MyApplicationOptions>>();
return new SecretClient(appOptions.Value.KeyVaultEndpoint, credential, options);
});
});
}
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Azure:
| Package | Downloads |
|---|---|
|
Microsoft.Azure.WebJobs.Host.Storage
This package contains Azure Storage based implementations of some WebJobs SDK component interfaces. For more information, please visit https://go.microsoft.com/fwlink/?linkid=2279708. |
|
|
Microsoft.Extensions.Configuration.AzureAppConfiguration
Microsoft.Extensions.Configuration.AzureAppConfiguration is a configuration provider for the .NET Core framework that allows developers to use Microsoft Azure App Configuration service as a configuration source in their applications. |
|
|
Microsoft.Azure.WebJobs.Extensions.ServiceBus
Microsoft Azure WebJobs SDK ServiceBus Extension |
|
|
Microsoft.Azure.WebJobs.Extensions.DurableTask
Azure WebJobs SDK Extension for the Durable Task Framework |
|
|
Microsoft.Azure.WebJobs.Extensions.Storage.Queues
This extension adds bindings for Storage |
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Azure:
| Repository | Stars |
|---|---|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
|
|
|
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
|
|
|
microsoft/mcp
Catalog of official Microsoft MCP (Model Context Protocol) server implementations for AI-powered data access and tool integration
|
|
|
Azure/azure-functions-host
The host/runtime that powers Azure Functions
|
|
|
Azure/durabletask
Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
|
|
|
wiremock/WireMock.Net
WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on WireMock Java, but extended and different functionality. Full documentation can be found at https://wiremock.org/dotnet/.
|
|
|
Azure/azure-mcp
The Azure MCP Server, bringing the power of Azure to your agents.
|
|
|
azure-ad-b2c/samples
Azure AD B2C custom policy solutions and samples.
|
|
|
mspnp/cloud-design-patterns
Sample implementations for cloud design patterns found in the Azure Architecture Center.
|
|
|
Azure-Samples/azure-search-openai-demo-csharp
A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
|
|
|
Azure/azure-cosmos-dotnet-v3
.NET SDK for Azure Cosmos DB for the core SQL API
|
|
|
Azure/azure-functions-durable-extension
Durable Task Framework extension for Azure Functions
|
|
|
Azure/azure-webjobs-sdk
Azure WebJobs SDK
|
|
|
dotnet/sign
Code Signing CLI tool supporting Authenticode, NuGet, VSIX, and ClickOnce
|
|
|
Azure/azure-functions-dotnet-worker
Azure Functions out-of-process .NET language worker
|
|
|
Azure/azure-webjobs-sdk-extensions
Azure WebJobs SDK Extensions
|
|
|
J-Tech-Japan/Sekiban
Sekiban - an Opinionated Event Sourcing and CQRS Framework using C#. It can store data into Azure Cosmos DB, AWS Dynamo DB or Postgres
|
|
|
james-gould/azure-keyvault-emulator
An emulator for Azure Key Vault. Compatible with the Azure Client SDK, runnable with Docker or Aspire.
|
|
|
microsoft/project-oagents
Experimental AI Agents Framework
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.14.0 | 1,642,263 | 4/23/2026 | |
| 1.13.1 | 11,853,637 | 11/20/2025 | |
| 1.13.0 | 9,315,961 | 9/22/2025 | 1.13.0 is deprecated. |
| 1.12.0 | 28,111,047 | 6/12/2025 | 1.12.0 is deprecated. |
| 1.11.0 | 8,908,824 | 3/14/2025 | 1.11.0 is deprecated. |
| 1.10.0 | 7,131,947 | 2/6/2025 | 1.10.0 is deprecated. |
| 1.9.0 | 5,959,964 | 11/27/2024 | 1.9.0 is deprecated. |
| 1.8.0 | 8,757,163 | 11/5/2024 | 1.8.0 is deprecated. |
| 1.7.6 | 16,939,522 | 10/4/2024 | 1.7.6 is deprecated. |
| 1.7.5 | 19,009,337 | 8/15/2024 | 1.7.5 is deprecated. |
| 1.7.4 | 26,696,376 | 6/13/2024 | 1.7.4 is deprecated. |
| 1.7.3 | 12,457,009 | 4/16/2024 | 1.7.3 is deprecated. |
| 1.7.2 | 6,376,010 | 2/13/2024 | 1.7.2 is deprecated. |
| 1.7.1 | 20,322,200 | 10/27/2023 | 1.7.1 is deprecated. |
| 1.7.0 | 12,128,623 | 8/8/2023 | 1.7.0 is deprecated. |
| 1.6.3 | 27,381,855 | 3/11/2023 | 1.6.3 is deprecated. |
| 1.6.2 | 163,070 | 3/7/2023 | 1.6.2 is deprecated. |
| 1.6.0 | 13,762,818 | 10/12/2022 | 1.6.0 is deprecated. |
| 1.5.0 | 2,263,013 | 9/12/2022 | 1.5.0 is deprecated. |
| 1.4.0 | 1,340,683 | 8/12/2022 | 1.4.0 is deprecated. |