perl-azure-sdk
A Perl SDK for selected Azure data-plane services, with Aspire-managed local emulators and integration tests. Requires Perl 5.42 or later.
The Perl SDK stands on its own. Use it against your own Azure subscription with only Perl and a CPAN client. Aspire is optional; add it when you want local emulators instead of Azure resources, or to run the integration tests.
This is a community project, not an official Microsoft Azure SDK. The first public CPAN release is being prepared; no published release is claimed here.
Project Guidance
- Public roadmap: completed scope, current work, next candidates, and non-goals.
- First-release checklist and CPAN publication guide.
- Contributing and support, including setup and focused tests.
- Testing guide: offline tests, Aspire integrations, manual emulator workflows, live Azure runbooks, and cleanup.
- Current authentication options: supported credentials, evidence, and limitations.
- Security policy and private vulnerability reports.
- Code of Conduct and MIT License.
GitHub issue intake is not open yet; issue templates are deferred. Support and pull-request review are best effort, with no response-time guarantee. Contact details and reporting rules are in Contributing.
Contents
- Perl SDK only
- Aspire with the Perl SDK
- Run the tests
- Phase summaries
Perl SDK Only
Install And Use
After the first CPAN release, install with a CPAN client (for example,
cpanm Azure::SDK) using Perl 5.42 or newer. The CPAN installer resolves the
package prerequisites from Makefile.PL; cpanfile.snapshot is only for
repository development. Consumers need a Storage connection string for their
Azure account, but do not need .NET, Aspire, Docker, VS Code, or C# Dev Kit.
use Azure::SDK::Storage::Blobs;
my $connection_string = $ENV{AZURE_STORAGE_CONNECTION_STRING}
// die "Set AZURE_STORAGE_CONNECTION_STRING\n";
my $blobs = Azure::SDK::Storage::Blobs->new(
connection_string => $connection_string,
);
$blobs->create_container('my-container', if_not_exists => 1);
See examples/blob-upload-list-download.pl for an upload, list, download, and cleanup workflow. The maintainer confirmed completion of the first-release live-Azure gate on 2026-11-06; see the release checklist.
Use Your Own Azure Resources
Every service client takes a connection string, so the SDK runs against your own subscription without Aspire. From a repository checkout, install the prerequisites once:
cpanm --installdeps .
Each example under examples/ loads the SDK from src/lib/, reads its
connection string from the environment, creates a uniquely named container,
queue, table, or key, and deletes it when it finishes:
| Example | Environment variable |
| --- | --- |
| blob-upload-list-download.pl | AZURE_STORAGE_CONNECTION_STRING |
| queue-send-receive.pl | AZURE_STORAGE_CONNECTION_STRING |
| table-transaction.pl | AZURE_STORAGE_CONNECTION_STRING |
| app-configuration-crud.pl | CONFIGURATION_CONNECTIONSTRING |
$env:AZURE_STORAGE_CONNECTION_STRING = "<your Storage connection string>"
perl examples/blob-upload-list-download.pl
Use a disposable Storage account or App Configuration store, and keep
connection strings out of the repository. See
docs/guides/current-auth-options.md
for the credentials each client accepts.
Aspire With The Perl SDK
Aspire is optional. It is only needed for local emulators, the integration tests, and the custom dashboard commands. The Perl SDK has no Aspire dependency.
How Aspire Works With The Perl SDK
Each Azure service has its own AppHost under apphosts/. An AppHost starts
the service emulator (Azurite for Blob, Queue, and Table Storage; the App
Configuration emulator for App Configuration) and registers the Perl examples,
integration tests, and scripts as Perl resources.
- Aspire picks the emulator ports and credentials at startup and injects the
connection string into each Perl resource through
WithReference(...), asBLOBS_CONNECTIONSTRING,QUEUES_CONNECTIONSTRING,TABLES_CONNECTIONSTRING, orCONFIGURATION_CONNECTIONSTRING. - The Perl code reads that variable the same way it reads a live Azure connection string, so the same script runs against an emulator or Azure.
- Perl resources are explicit-start: starting the AppHost does not run them.
Start one by name with
aspire resource <name> start. - Aspire owns emulator startup. Do not configure separate emulator containers or commit connection strings.
| Service | AppHost | Emulator resource | Example resource |
| --- | --- | --- | --- |
| Blob Storage | apphosts/Storage.Blobs.AppHost/ | blobs | perl-blob-example |
| Queue Storage | apphosts/Storage.Queues.AppHost/ | queues | perl-queue-example |
| Table Storage | apphosts/Storage.Tables.AppHost/ | tables | perl-table-example |
| App Configuration | apphosts/AppConfiguration.AppHost/ | configuration | perl-app-configuration-example |
Set Up Aspire For Local Emulators
Install the Perl prerequisites as above, then add:
- the .NET 11 SDK (.NET 10 is supported as a fallback),
- the Aspire CLI, and
- a running supported container runtime such as Docker Desktop.
VS Code and C# Dev Kit are optional. Check the tools from the repository root:
dotnet --version
aspire --version
docker info --format '{{.ServerVersion}}'
Start an AppHost, run a Perl example against its emulator, and stop it:
$appHost = "apphosts/Storage.Blobs.AppHost/Storage.Blobs.AppHost.csproj"
aspire start --apphost $appHost --isolated --non-interactive
aspire wait blobs --apphost $appHost --non-interactive
aspire resource perl-blob-example start --apphost $appHost --non-interactive
aspire logs perl-blob-example --apphost $appHost --non-interactive
aspire stop --apphost $appHost
Swap the AppHost and resource names from the table above for the other services. The phase summaries list each AppHost's workflows, and the testing guide covers manual inspection and troubleshooting.
Run The Tests
Perl-Only Tests
From the repository root, install the package prerequisites and run the offline unit and smoke suites:
cpanm --installdeps .
prove -r -I src/lib tests/unit/ tests/tooling/ tests/smoke/
This path needs Perl 5.42+ and a CPAN client, not .NET, Aspire, or a container
runtime. It does not verify behavior against an emulator or live Azure. The
integration .t files under tests/integration/ skip outside Aspire, because
Aspire supplies their connection strings.
Aspire Emulator Tests
After setting up Aspire, run the complete emulator suite from the repository root:
dotnet test tests/aspire/PerlAzureSdk.IntegrationTests.slnx
The .NET CLI runs these tests; they do not need the Aspire CLI, VS Code, or
C# Dev Kit. Each xUnit class starts its service AppHost, runs the Perl
integration .t files as Aspire resources, and stops the emulator afterwards.
See the testing guide for focused per-service
commands, the integration-test lifecycle, and troubleshooting.
Live Azure Tests
To rerun selected integration tests against disposable Azure resources, see the testing guide's live Azure runbook. Live mode is opt-in and manual; normal automated suites remain emulator-only.
Azure::SDK
The SDK lives under src/lib/ in the Azure::SDK namespace and is built on
Perl's native class feature (use feature 'class', Perl v5.42+). The shared
foundation every future service package builds on is Azure::SDK::Core.
Key modules:
Azure::SDK::Core— the shared client. Owns the endpoint andAzure::SDK::Core::ClientOptions, lazily builds the policy pipeline, sends anAzure::SDK::Core::Request, and normalizes non-2xx responses intoAzure::SDK::Core::Error(parsing both JSON and XML Azure error envelopes).Azure::SDK::Core::ClientOptions— configuration plus abuild_pipelinefactory that wires the default policy ordering.Azure::SDK::Core::Pipeline— composes policies and the transport into a single reusable continuation chain.- Policies —
Headers,Telemetry(User-Agent),Diagnostics(request id + redacted logging),Retry(the per-try boundary), andCredential. - Credentials —
Credential::StaticToken(bearer),Credential::Sas(query string), andCredential::SharedKey(HMAC-SHA256 signing). - Transport —
Transport::Default, the built-in HTTP transport created withverify_SSL => 1so TLS certificates are always validated, and with a configurablemax_response_bytescap so buffered responses cannot grow without bound. - Value objects —
Request,Response,Headers(case-insensitive, rejects CR/LF to block header injection),Context, andError. Azure::SDK::AppConfiguration— typed key-value CRUD, conditional ETags, label and key-value filtering, and lazy continuation paging through the Aspire-managed emulator or an Azure HTTPS connection string.
The credential classes are Core primitives, not a claim that every public
service client accepts every credential. Blob, Queue, and Table accept Shared
Key connection strings and precomputed SAS through a credential, service URL,
or SAS connection string; App Configuration accepts its HMAC access-key
connection string. Account SAS completes every public Blob, Queue, and Table
operation against Aspire-managed Azurite, and container-, queue-, and
table-scoped service SAS complete their in-scope object operations. The
first-release live-Azure gate is maintainer-confirmed complete; this does not
claim support for unimplemented authentication modes. See
docs/guides/current-auth-options.md for
the current and release-target authentication matrices.
The repository includes cpanfile, which declares the runtime/test dependency
surface, including IO::Socket::SSL and Net::SSLeay for dependable HTTPS.
carton install creates a local cpanfile.snapshot on first use; that generated
snapshot is not tracked or included in the CPAN distribution.
CPAN packaging uses ExtUtils::MakeMaker through Makefile.PL. The generated
distribution installs modules from src/lib/, runs the packaged unit tests, and
emits CPAN metadata (META.json / META.yml) during the release build. The
MetaCPAN landing page is rendered from
src/lib/Azure/SDK.pod, not this README. See
docs/guides/publish-to-cpan.md for the PAUSE
publishing workflow.
Phase summaries
Phase 0: Local harness
The repository uses project-based Aspire AppHosts scoped to one Azure service
subcategory under apphosts/.
Package versions are pinned in
Directory.Packages.props and the .NET target
framework fallback lives in Directory.Build.props.
The testing guide
describes the aligned Aspire 17.0.0 stable packages and .NET 11/.NET 10 target
fallback.
Package restore uses the trusted feeds in nuget.config. No dedicated local NuGet feed is required while the Perl hosting integration is available from the configured public sources.
Run the complete emulator integration suite with:
dotnet test tests/aspire/PerlAzureSdk.IntegrationTests.slnx
See the testing guide for focused commands, the Aspire integration-test lifecycle, and test ownership and duplication rules.
Each service AppHost wires only its emulator and related Perl resources. Service
connections reach Perl exclusively through WithReference(...).
Phase 1: Seed fixture
Phase 1 adds a repeatable local seed fixture at data/seed/blob/alpha-blob.txt and passes its path to the harness with AZURE_SDK_BLOB_SEED_FILE.
Phase 2: Shared core pipeline
Phase 2 builds the shared Azure::SDK::Core pipeline that every service client
will run requests through. Service clients construct an Azure::SDK::Core::Request
and call send; they never talk to the transport directly.
Highlights:
- Ordered policy pipeline with explicit per-call and per-try stages around a
retry boundary:
Headers→Telemetry→Diagnostics→ custom per-call →Retry→ custom per-try →Credential. Policies after the retry boundary re-run on every attempt (so requests are re-authenticated per try). - Retry policy with exponential backoff and equal jitter that honors server
Retry-After-Ms/Retry-Afterheaders (delta-seconds or HTTP-date, capped at 60s) and retries transient statuses (408, 429, 5xx) and transport errors. - Credentials for the three core authentication styles: static bearer tokens, SAS query strings (idempotent across retries), and account shared-key HMAC-SHA256 signing. Public clients expose only the credential paths documented in the current authentication guide.
- Normalized errors — non-2xx responses become
Azure::SDK::Core::Errorwith status, service code, message, and raw body, parsed from JSON or XML error envelopes (regex-based, so no XXE exposure). - Security posture — TLS verification is forced on (
verify_SSL => 1), buffered response bodies are capped bymax_response_bytes(64 MiB by default; exceeding it throwsAzure::SDK::Core::Errorwith codeResponseTooLarge), request/response header names and values reject CR/LF (HTTP header-injection defense), and diagnostics logging redacts the URL query string so SAS signatures and tokens are never written to logs. - Unit tests covering the client, options, pipeline, policies, credentials,
transport, request/response, and error normalization live under
tests/unit/and ship in the CPAN distribution. Tests for repository-only scripts live undertests/tooling/and are not packaged.
Executables, Examples, And Integration Tests
examples/contains user-facing demonstrations. Each implemented Storage service has an explicit-start Aspire resource:perl-blob-example,perl-queue-example, andperl-table-example.tests/integration/azurite/contains direct SDK tests against Aspire-managed Azurite.tests/integration/workflows/covers executable workflows such as the watcher and manual reader. Structured xUnit tests undertests/aspire/own AppHost lifecycle and custom Aspire command coverage.- Live Azure reruns reuse the service integration resources with
AzureSdk:Target=live; see the live runbook. Normal automated suites remain emulator-only. apphosts/scripts/contains Aspire-owned test and workflow helpers: harness probes, protocol verification and fixture capture, the Blob watcher, and the adapter used by the dashboard upload command. Launch these through AppHost resources or resource commands, not as standalone test entry points; see the AppHost runbook. These are not the public sample set and do not ship in the CPAN distribution.src/scripts/contains the CPAN release builder, independent of Aspire; see the publishing guide.apphosts/PerlAzureSdk.AppHost.Commands/contains C# implementations shared only by AppHosts that expose custom Aspire resource commands.
Phase 3: Azure Blob Storage
Phase 3 adds Azure::SDK::Storage::Blobs with current Shared Key authentication,
container and Blob CRUD, conditional requests, and paged listing. Precomputed
SAS consumption is an initial-release addition, not part of the completed Phase
3 baseline. Aspire runs Azurite, a long-running Perl watcher, the blobs
resource's upload-file command, and focused explicit-start integration
resources.
See the testing guide's
Blob emulator workflow for
upload commands, watcher output, checkpoint reset, direct download, overwrite,
and Storage Explorer inspection. Its
focused test commands
cover the automated gates.
Run examples/blob-upload-list-download.pl
through the perl-blob-example explicit-start resource, or run it independently
with AZURE_STORAGE_CONNECTION_STRING:
$appHost = "apphosts/Storage.Blobs.AppHost/Storage.Blobs.AppHost.csproj"
aspire resource perl-blob-example start --apphost $appHost --non-interactive
aspire logs perl-blob-example --apphost $appHost --non-interactive
Phase 4: Azure Queue And Table Storage
Phase 4 completes the Azurite-backed Storage clients. Queue supports lifecycle, metadata/property access, lazy listing, and complete message operations. Table supports lifecycle, typed EDM entities, conditional CRUD with opaque ETags, bound filters, lazy entity paging, and atomic same-partition transactions. Aspire owns the shared Azurite account and injects both connection strings.
Run the complete Queue gate from the repository root:
$appHost = "apphosts/Storage.Queues.AppHost/Storage.Queues.AppHost.csproj"
aspire start --apphost $appHost --isolated --non-interactive
aspire wait queues --apphost $appHost --non-interactive
aspire resource perl-queue-azurite-integration start --apphost $appHost --non-interactive
aspire logs perl-queue-azurite-integration --apphost $appHost --non-interactive
Regenerate captured Queue protocol fixtures or run the minimal lifecycle example through explicit Aspire resources:
aspire resource perl-queue-protocol-capture start --apphost $appHost --non-interactive
aspire logs perl-queue-protocol-capture --apphost $appHost --non-interactive
aspire resource perl-queue-example start --apphost $appHost --non-interactive
aspire logs perl-queue-example --apphost $appHost --non-interactive
Table transactions reject cross-partition or duplicate entities, more than 100
operations, and framed payloads over 4 MiB before transport. An accepted outer
batch response is parsed for inner failures and reports the zero-based failed
operation through Azure::SDK::Storage::Tables::TransactionError.
Run the complete Table gate through its explicit Aspire resource:
$appHost = "apphosts/Storage.Tables.AppHost/Storage.Tables.AppHost.csproj"
aspire start --apphost $appHost --isolated --non-interactive
aspire wait tables --status up --timeout 120 --apphost $appHost
aspire resource perl-table-azurite-integration start --apphost $appHost --non-interactive
aspire logs perl-table-azurite-integration --apphost $appHost
Regenerate sanitized Table transaction fixtures or run the minimal example:
aspire resource perl-table-protocol-capture start --apphost $appHost --non-interactive
aspire logs perl-table-protocol-capture --apphost $appHost
aspire resource perl-table-example start --apphost $appHost --non-interactive
aspire logs perl-table-example --apphost $appHost
Phase 5: Azure App Configuration
Phase 5 adds the Aspire App Configuration integration and Microsoft emulator.
Aspire owns the dynamic endpoint and credentials; the Perl
probe receives them through WithReference(configuration) and prints only
redaction-safe contract facts.
$appHost = "apphosts/AppConfiguration.AppHost/AppConfiguration.AppHost.csproj"
aspire start --apphost $appHost --isolated --non-interactive
aspire wait configuration --status up --apphost $appHost --non-interactive
aspire resource configuration set-value --key "sample:message" --value "Hello from Aspire" --label "local" --content-type "text/plain" --apphost $appHost --non-interactive
aspire resource perl-app-configuration-resource-probe start --apphost $appHost --non-interactive
aspire logs perl-app-configuration-resource-probe --apphost $appHost
The hosting integration currently registers no health check, so this gate waits
for up. The verified emulator connection string contains Endpoint, Id, and
Secret; raw values must not be logged or committed. The set-value command
resolves that connection string only while executing, enforces App
Configuration's 10 KiB key-value limit, and never returns the supplied value or
credential material. It uses anonymous authentication only for the Aspire
emulator's loopback HTTP endpoint, uses HMAC for Azure HTTPS endpoints, and
rejects non-loopback HTTP endpoints. Command arguments are not a secret store;
put secrets in Azure Key Vault rather than App Configuration.
The public client parses the injected connection string, uses anonymous access
only for the loopback HTTP emulator, and signs Azure HTTPS requests with HMAC on
every retry. It exposes set_configuration_setting,
get_configuration_setting, delete_configuration_setting, lazy/eager
key-value listing, lazy/eager label listing, snapshot create/get/archive/recover,
and lazy/eager snapshot and snapshot-setting listing. Snapshot creation returns
a pollable CreateSnapshotOperation. Opaque operation and continuation links
are confined to the configured endpoint before they are followed.
Key-value and label operations use API 1.0; snapshot operations use
2023-10-01. App Configuration Emulator 1.0.2 has no snapshot route and returns
a bodyless HTTP 500 for a valid snapshot request. Snapshot request, response,
polling, conditional update, and paging contracts therefore have focused
offline coverage. Live snapshot validation belongs to the separately
maintainer-confirmed release gate,
not the emulator suite.
Run the isolated emulator integration and minimal example through Aspire:
aspire resource perl-app-configuration-emulator-integration start --apphost $appHost --non-interactive
aspire logs perl-app-configuration-emulator-integration --apphost $appHost
aspire resource perl-app-configuration-example start --apphost $appHost --non-interactive
aspire logs perl-app-configuration-example --apphost $appHost
Run the automated emulator and command contract tests:
dotnet test tests/aspire/AppConfiguration.Tests/AppConfiguration.Tests.csproj