Soenneker.Blob.Sas 11.0.3150

Prefix Reserved
dotnet add package Soenneker.Blob.Sas --version 11.0.3150
                    
NuGet\Install-Package Soenneker.Blob.Sas -Version 11.0.3150
                    
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="Soenneker.Blob.Sas" Version="11.0.3150" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blob.Sas" Version="11.0.3150" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blob.Sas" />
                    
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 Soenneker.Blob.Sas --version 11.0.3150
                    
#r "nuget: Soenneker.Blob.Sas, 11.0.3150"
                    
#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 Soenneker.Blob.Sas@11.0.3150
                    
#: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=Soenneker.Blob.Sas&version=11.0.3150
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blob.Sas&version=11.0.3150
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blob.Sas

Builds Azure Blob Storage URLs and read-only shared access signatures (SAS).

Installation

dotnet add package Soenneker.Blob.Sas

Configuration

{
  "Environment": "Production",
  "Azure": {
    "Storage": {
      "Blob": {
        "AccountName": "<storage account name>",
        "AccountKey": "<storage account key>",
        "ConnectionString": "<connection string>"
      }
    }
  }
}

AccountName and AccountKey are required by the direct signing methods. ConnectionString is also required when using GetSasUriWithClient because that method obtains a configured BlobClient.

When Environment is Local, blob URLs use the Azurite endpoint at http://127.0.0.1:10000/devstoreaccount1/.

Registration

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Blob.Sas.Registrars;

services.AddBlobSasUtilAsScoped();

AddBlobSasUtilAsSingleton() is also available.

Usage

using Soenneker.Blob.Sas.Abstract;

public sealed class DownloadLinks
{
    private readonly IBlobSasUtil _sas;

    public DownloadLinks(IBlobSasUtil sas)
    {
        _sas = sas;
    }

    public string GetInvoiceLink(string invoiceId)
    {
        return _sas.GetSasUri("invoices", $"{invoiceId}.pdf");
    }
}

Use GetBlobUri when the container or blob is already public and no signature is needed:

string uri = sas.GetBlobUri("public-assets", "images/logo mark.svg");

Method behavior

Method Result Expiration and access
GetBlobUri Unsigned absolute blob URL No token
GetSasUri SAS URL signed directly with the configured account key Read-only, one month
GetSasUriWithClient SAS URL generated by a shared-key BlobClient, or null if it cannot sign Read-only, one month
GetAccountSasUri Account SAS appended to a Blob service URI Blob container/object read and list, one hour

SAS start times are backdated by five minutes to tolerate modest clock skew. Production signatures require HTTPS; the local Azurite flow permits HTTP.

Security

  • Treat every SAS URL as a credential until it expires. Do not write it to logs, analytics, exception messages, or persistent client storage.
  • Return the URL only to callers allowed to read the referenced content.
  • The account key can sign access to the storage account. Keep it in a secret provider rather than source control or ordinary configuration files.
  • Prefer the narrow blob-level methods over GetAccountSasUri unless account-level listing is required.
  • Revocation normally requires changing the account key unless the surrounding storage design uses a revocable access policy.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Blob.Sas:

Package Downloads
Soenneker.Blob.Upload

A utility library for Azure Blob upload operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.3150 50 11/14/2026
11.0.3149 111 11/11/2026
11.0.3148 104 11/11/2026
11.0.3147 120 11/11/2026
11.0.3146 102 11/11/2026
11.0.3145 79 11/11/2026
11.0.3144 91 11/11/2026
11.0.3143 195 11/3/2026
11.0.3142 112 11/3/2026
11.0.3141 123 11/3/2026
11.0.3140 87 11/3/2026
11.0.3139 142 11/3/2026
11.0.3138 276 10/27/2026
11.0.3137 123 10/27/2026
11.0.3136 147 10/27/2026
11.0.3135 120 10/27/2026
11.0.3134 123 10/26/2026
11.0.3132 123 10/26/2026
11.0.3131 103 10/26/2026
11.0.3130 120 10/26/2026
Loading failed

Update dependency Soenneker.Enums.DeployEnvironment to 11.0.265 (#3916)