Skip to main content

prefect-azure

PyPI

prefect-azure is a collection of Prefect integrations for orchestration workflows with Azure.

Getting Started

Installation

Install prefect-azure with pip

pip install prefect-azure

To use Blob Storage:

pip install "prefect-azure[blob_storage]"

To use Cosmos DB:

pip install "prefect-azure[cosmos_db]"

To use ML Datastore:

pip install "prefect-azure[ml_datastore]"

Managed identity authentication for the Prefect server database

prefect-azure provides a Prefect plugin that lets the Prefect server connect to Azure Database for PostgreSQL using a Microsoft Entra ID (managed identity) token instead of a password. When enabled, the server acquires a short-lived Entra token via DefaultAzureCredential and supplies it to asyncpg on every new connection, so tokens refresh automatically and no database password is stored anywhere.

Enable it on the process running prefect server start (install prefect-azure in that image/environment):

# Enable the plugin system so Prefect loads the database hook
# (on Prefect < 3.7 use PREFECT_EXPERIMENTS_PLUGINS_ENABLED=true instead)
export PREFECT_PLUGINS_ENABLED=true

export PREFECT_INTEGRATIONS_AZURE_POSTGRES_MANAGED_IDENTITY_ENABLED=true
# Optional: select a specific user-assigned identity
export PREFECT_INTEGRATIONS_AZURE_POSTGRES_MANAGED_IDENTITY_CLIENT_ID=<client-id>

# Provide a password-less connection URL (the plugin supplies the token)
export PREFECT_SERVER_DATABASE_CONNECTION_URL="postgresql+asyncpg://<entra-principal>@<host>:5432/<db>"

The Postgres server must have Microsoft Entra authentication enabled and the identity mapped to a database role (via pgaadauth). Locally, DefaultAzureCredential falls back to your az login identity, so the same configuration works for development.

Examples

Download a blob

from prefect import flow

from prefect_azure import AzureBlobStorageCredentials
from prefect_azure.blob_storage import blob_storage_download

@flow
def example_blob_storage_download_flow():
    connection_string = "connection_string"
    blob_storage_credentials = AzureBlobStorageCredentials(
        connection_string=connection_string,
    )
    data = blob_storage_download(
        blob="prefect.txt",
        container="prefect",
        azure_credentials=blob_storage_credentials,
    )
    return data

example_blob_storage_download_flow()

Use with_options to customize options on any existing task or flow:

custom_blob_storage_download_flow = example_blob_storage_download_flow.with_options(
    name="My custom task name",
    retries=2,
    retry_delay_seconds=10,
)

Azure Container Instance Worker

Use the Azure Container Instance worker to run flow runs in Azure Container Instances.

To get started, create an Azure Container Instances typed work pool:

prefect work-pool create --type azure-container-instance my-aci-work-pool

Then, run a worker that pulls jobs from the work pool:

prefect worker start --pool my-aci-work-pool --type azure-container-instance

Metadata

Release files for prefect-azure 0.4.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-azure 0.4.13
File Size Uploaded Provenance Actions
prefect_azure-0.4.13.tar.gz 66.7 kB With provenance Details for prefect_azure-0.4.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prefect-azure 0.4.13
File Interpreter ABI Platform Actions
prefect_azure-0.4.13-py3-none-any.whl Python 3 none any Details for prefect_azure-0.4.13-py3-none-any.whl

Total release size: 113.8 kB

Release files / prefect_azure-0.4.13.tar.gz

Download URL prefect_azure-0.4.13.tar.gz
Size 66.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0e29a09d2e073d4a6e2b14889fc3f94978e1133300529cfd88ddabfcf481cc5b
BLAKE2b-256 checksum
How to use checksums
a43e5451d1ffdfd91af9b81fed528fabb2111c3a5b0f1aed43b813909a0a3cc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / prefect_azure-0.4.13-py3-none-any.whl

Download URL prefect_azure-0.4.13-py3-none-any.whl
Size 47.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd32c2912884b8823c3c6d583a913cde850eceab62d761c5d2aa41d0aae1f0fa
BLAKE2b-256 checksum
How to use checksums
de2a83a66d37044f63c7e5d9d634a1f50b9058327e494f8dca6e7c7c35f4a819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Security for prefect-azure 0.4.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for prefect_azure-0.4.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.13 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page