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
<PackageReference Include="Soenneker.Blob.Sas" Version="11.0.3150" />
<PackageVersion Include="Soenneker.Blob.Sas" Version="11.0.3150" />
<PackageReference Include="Soenneker.Blob.Sas" />
paket add Soenneker.Blob.Sas --version 11.0.3150
#r "nuget: Soenneker.Blob.Sas, 11.0.3150"
#:package Soenneker.Blob.Sas@11.0.3150
#addin nuget:?package=Soenneker.Blob.Sas&version=11.0.3150
#tool nuget:?package=Soenneker.Blob.Sas&version=11.0.3150
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
GetAccountSasUriunless account-level listing is required. - Revocation normally requires changing the account key unless the surrounding storage design uses a revocable access policy.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Blob.Client (>= 11.0.2276)
- Soenneker.Enums.DeployEnvironment (>= 11.0.265)
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 |
Update dependency Soenneker.Enums.DeployEnvironment to 11.0.265 (#3916)