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

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

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.

| 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:

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:

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:

Executables, Examples, And Integration Tests

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