
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
prefect-azure
is a collection of Prefect integrations for orchestration workflows with Azure.
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]"
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,
)
from prefect import flow
from prefect_azure import AzureContainerInstanceCredentials
from prefect_azure.container_instance import AzureContainerInstanceJob
@flow
def container_instance_job_flow():
aci_credentials = AzureContainerInstanceCredentials.load("MY_BLOCK_NAME")
container_instance_job = AzureContainerInstanceJob(
aci_credentials=aci_credentials,
resource_group_name="azure_resource_group.example.name",
subscription_id="<MY_AZURE_SUBSCRIPTION_ID>",
command=["echo", "hello world"],
)
return container_instance_job.run()
If we have a_flow_module.py
:
from prefect import flow
from prefect.logging import get_run_logger
@flow
def log_hello_flow(name="Marvin"):
logger = get_run_logger()
logger.info(f"{name} said hello!")
if __name__ == "__main__":
log_hello_flow()
We can run that flow using an Azure Container Instance, but first create the infrastructure block:
from prefect_azure import AzureContainerInstanceCredentials
from prefect_azure.container_instance import AzureContainerInstanceJob
container_instance_job = AzureContainerInstanceJob(
aci_credentials=AzureContainerInstanceCredentials.load("MY_BLOCK_NAME"),
resource_group_name="azure_resource_group.example.name",
subscription_id="<MY_AZURE_SUBSCRIPTION_ID>",
)
container_instance_job.save("aci-dev")
Then, create the deployment either on the UI or through the CLI:
prefect deployment build a_flow_module.py:log_hello_flow --name aci-dev -ib container-instance-job/aci-dev
Visit Prefect Deployments for more information about deployments.
The Azure Container Instance worker is an excellent way to run your workflows on Azure.
To get started, create an Azure Container Instances typed work pool:
prefect work-pool create -t azure-container-instance my-aci-work-pool
Then, run a worker that pulls jobs from the work pool:
prefect worker start -n my-aci-worker -p my-aci-work-pool
The worker should automatically read the work pool's type and start an Azure Container Instance worker.
FAQs
Prefect integrations with Microsoft Azure services
We found that prefect-azure demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.