Soenneker.Azure.Utils.ArmClientUtil
11.0.438
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Azure.Utils.ArmClientUtil --version 11.0.438
NuGet\Install-Package Soenneker.Azure.Utils.ArmClientUtil -Version 11.0.438
<PackageReference Include="Soenneker.Azure.Utils.ArmClientUtil" Version="11.0.438" />
<PackageVersion Include="Soenneker.Azure.Utils.ArmClientUtil" Version="11.0.438" />
<PackageReference Include="Soenneker.Azure.Utils.ArmClientUtil" />
paket add Soenneker.Azure.Utils.ArmClientUtil --version 11.0.438
#r "nuget: Soenneker.Azure.Utils.ArmClientUtil, 11.0.438"
#:package Soenneker.Azure.Utils.ArmClientUtil@11.0.438
#addin nuget:?package=Soenneker.Azure.Utils.ArmClientUtil&version=11.0.438
#tool nuget:?package=Soenneker.Azure.Utils.ArmClientUtil&version=11.0.438
Soenneker.Azure.Utils.ArmClientUtil
Creates and caches an Azure Resource Manager ArmClient authenticated with a service-principal client secret.
Installation
dotnet add package Soenneker.Azure.Utils.ArmClientUtil
Configuration
{
"Azure": {
"TenantId": "tenant-guid",
"AppRegistration": {
"Id": "application-client-id",
"Secret": "client-secret"
}
}
}
Store the secret in Azure Key Vault, an environment variable, or another secret provider. Assign the service principal only the Azure RBAC roles its callers need.
Registration and use
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Soenneker.Azure.Utils.ArmClientUtil.Abstract;
using Soenneker.Azure.Utils.ArmClientUtil.Registrars;
builder.Services.AddArmClientUtilAsSingleton();
public sealed class SubscriptionReader(IArmClientUtil armClientUtil)
{
public async Task<List<string>> GetSubscriptionNames(
CancellationToken cancellationToken)
{
ArmClient client = await armClientUtil.Get(cancellationToken);
var names = new List<string>();
await foreach (SubscriptionResource subscription in
client.GetSubscriptions().GetAllAsync(cancellationToken))
{
names.Add(subscription.Data.DisplayName);
}
return names;
}
}
Lifecycle and authentication behavior
- The
ArmClientis created on first use and reused afterward. - Missing tenant, client ID, or secret configuration fails initialization.
- Configuration and secret rotation do not alter an initialized client; replace the utility instance to use new credentials.
- Azure authorization is evaluated by ARM for each resource operation. Possessing a valid client secret does not grant access without the corresponding RBAC assignment.
- Let DI dispose the utility.
This package specifically uses ClientSecretCredential. Workloads that can use managed identity or workload identity should construct ArmClient with the appropriate TokenCredential instead of storing a client secret.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Azure.Core (>= 1.63.0)
- Azure.ResourceManager (>= 1.14.0)
- Soenneker.Extensions.Configuration (>= 11.0.913)
- Soenneker.Utils.AsyncSingleton (>= 4.0.881)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Azure.Utils.ArmClientUtil:
| Package | Downloads |
|---|---|
|
Soenneker.Nubilus.Azure.Cosmos
Resolves existing Azure Cosmos DB accounts through Azure Resource Manager. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.456 | 109 | 11/18/2026 |
| 11.0.454 | 97 | 11/18/2026 |
| 11.0.451 | 113 | 11/11/2026 |
| 11.0.444 | 163 | 10/27/2026 |
| 11.0.443 | 124 | 10/27/2026 |
| 11.0.442 | 113 | 10/26/2026 |
| 11.0.441 | 111 | 10/26/2026 |
| 11.0.440 | 103 | 10/26/2026 |
| 11.0.439 | 103 | 10/26/2026 |
| 11.0.438 | 110 | 10/26/2026 |
| 4.0.437 | 110 | 10/26/2026 |
| 4.0.436 | 97 | 10/25/2026 |
| 4.0.435 | 94 | 10/25/2026 |
| 4.0.434 | 562 | 10/15/2026 |
| 4.0.433 | 116 | 10/14/2026 |
| 4.0.432 | 106 | 10/14/2026 |
| 4.0.431 | 123 | 10/14/2026 |
| 4.0.429 | 99 | 10/14/2026 |
| 4.0.428 | 121 | 10/14/2026 |
| 4.0.427 | 99 | 10/14/2026 |
Merge remote-tracking branch 'origin/main'
# Conflicts:
# src/Soenneker.Azure.Utils.ArmClientUtil/Soenneker.Azure.Utils.ArmClientUtil.csproj
# test/Soenneker.Azure.Utils.ArmClientUtil.Tests/Soenneker.Azure.Utils.ArmClientUtil.Tests.csproj