Nops.Core.Azkv 1.1.1

Prefix Reserved
dotnet add package Nops.Core.Azkv --version 1.1.1
                    
NuGet\Install-Package Nops.Core.Azkv -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nops.Core.Azkv" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nops.Core.Azkv" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Nops.Core.Azkv" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nops.Core.Azkv --version 1.1.1
                    
#r "nuget: Nops.Core.Azkv, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nops.Core.Azkv@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nops.Core.Azkv&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Nops.Core.Azkv&version=1.1.1
                    
Install as a Cake Tool

Nops.Core.Azkv

Azure Key Vault master key provider for Nops - in-process SOPS decryption.

Installation

dotnet add package Nops.Core.Azkv

Usage

using Nops.Core;
using Nops.Core.Keys;

// Option 1: DefaultAzureCredential (env vars, managed identity, VS/Azure CLI auth)
var masterKey = new AzkvMasterKey(
    vaultUrl: "https://my-vault.vault.azure.net",
    keyName: "sops-wrapping-key"
);

// Option 2: Explicit client with specific credentials
var client = new KeyClient(
    new Uri("https://my-vault.vault.azure.net"),
    new Azure.Identity.ChainedTokenCredential(
        new Azure.Identity.EnvironmentCredential(),
        new Azure.AzureCliCredential()
    )
);

var masterKey2 = new AzkvMasterKey(
    vaultUrl: "https://my-vault.vault.azure.net",
    keyName: "sops-wrapping-key",
    client: client
);

// Use with SopsFile
var result = await SopsFile.DecryptTreeAsync(
    fileBytes: File.ReadAllBytes("secrets.sops.yaml"),
    fileKind: "yaml",
    options: new SopsOptions
    {
        MasterKeys = new[] { masterKey }
    });

Authentication

Azure Key Vault uses DefaultAzureCredential:

  1. Environment variables: AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET
  2. Azure CLI: az login (interactive)
  3. Azure Developer CLI: azd auth login
  4. Managed Identity: Automatic when running on Azure (VM, App Service, Functions, etc.)

Local Development

# Login with Azure CLI
az login

# Or set environment variables
export AZURE_TENANT_ID="your-tenant-id"
export AZURE_CLIENT_ID="your-client-id"
export AZURE_CLIENT_SECRET="your-client-secret"

Key Vault Setup

Create a wrapping key for SOPS:

# Create Key Vault
az keyvault create --name my-vault --location eastus --resource-group my-rg

# Create an RSA wrapping key (sops wraps the data key with RSA-OAEP-256)
az keyvault key create \
    --name sops-wrapping-key \
    --vault-name my-vault \
    --kty RSA --size 2048 \
    --ops wrapKey unwrapKey

# Grant your identity decrypt permissions
az keyvault set-policy \
    --name my-vault \
    --upn you@example.com \
    --key-permissions unwrapKey wrapKey

Running Tests

Unit tests run without dependencies:

dotnet test tests/Nops.Core.Azkv.Tests --filter FullyQualifiedName~AzkvEntryParserTests

Integration tests require Azure credentials:

AZURE_LIVE_TEST=1 dotnet test tests/Nops.Core.Azkv.Tests --filter FullyQualifiedName~AzkvIntegrationTests

License

MIT - see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 327 10/25/2026
1.1.0 109 10/25/2026
1.0.0 106 10/25/2026
1.0.0-preview.1 72 10/10/2026