# Azure Tasks
This module contains a collection of tasks for interacting with Azure resources.
# BlobStorageDownload
class
prefect.tasks.azure.blobstorage.BlobStorageDownload
(azure_credentials_secret="AZ_CONNECTION_STRING", container=None, **kwargs)[source]Task for downloading data from an Blob Storage container and returning it as a string. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
azure_credentials_secret (str, optional)
: the name of the Prefect Secret that stores your Azure credentials; this Secret must be an Azure connection stringcontainer (str, optional)
: the name of the Azure Blob Storage to download from**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.azure.blobstorage.BlobStorageDownload.run (blob_name, azure_credentials_secret="AZ_CONNECTION_STRING", container=None)[source] |
Task run method.
|
# BlobStorageUpload
class
prefect.tasks.azure.blobstorage.BlobStorageUpload
(azure_credentials_secret="AZ_CONNECTION_STRING", container=None, overwrite=False, **kwargs)[source]Task for uploading string data (e.g., a JSON string) to an Azure Blob Storage container. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
azure_credentials_secret (str, optional)
: the name of the Prefect Secret that stores your Azure credentials; this Secret must be an Azure connection stringcontainer (str, optional)
: the name of the Azure Blob Storage to upload tooverwrite (bool, optional)
: ifTrue
, an existing blob with the same name will be overwritten. Defaults toFalse
and an error will be thrown if the blob already exists.**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.azure.blobstorage.BlobStorageUpload.run (data, blob_name=None, azure_credentials_secret="AZ_CONNECTION_STRING", container=None, overwrite=False)[source] |
Task run method.
|
# CosmosDBCreateItem
class
prefect.tasks.azure.cosmosdb.CosmosDBCreateItem
(url=None, database_or_container_link=None, item=None, azure_credentials_secret="AZ_CREDENTIALS", options=None, **kwargs)[source]Task for creating an item in a Azure Cosmos database. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
url (str, optional)
: The url to the database.database_or_container_link (str, optional)
: link to the database or container.item (dict, optional)
: the item to createazure_credentials_secret (str, optional)
: the name of the Prefect Secret that stores your Azure credentials; this Secret must be JSON string with the keyAZ_COSMOS_AUTH
. The value should be dictionary containingmasterKey
orresourceTokens
, where themasterKey
value is the default authorization key to use to create the client, andresourceTokens
value is the alternative authorization key.options (dict, optional)
: options to be passed to theazure.cosmos.cosmos_client.CosmosClient.CreateItem
method.**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.azure.cosmosdb.CosmosDBCreateItem.run (url=None, database_or_container_link=None, item=None, azure_credentials_secret="AZ_CREDENTIALS", options=None)[source] |
Task run method.
|
# CosmosDBReadItems
class
prefect.tasks.azure.cosmosdb.CosmosDBReadItems
(url=None, document_or_container_link=None, azure_credentials_secret="AZ_CREDENTIALS", options=None, **kwargs)[source]Task for reading items from a Azure Cosmos database. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
url (str, optional)
: The url to the database.document_or_container_link (str, optional)
: link to a document or container. If a document link is provided, the document in question is returned, otherwise all docuements are returned.azure_credentials_secret (str, optional)
: the name of the Prefect Secret that stores your Azure credentials; this Secret must be JSON string with the keyAZ_COSMOS_AUTH
. The value should be dictionary containingmasterKey
orresourceTokens
, where themasterKey
value is the default authorization key to use to create the client, andresourceTokens
value is the alternative authorization key.options (dict, optional)
: options to be passed to theazure.cosmos.cosmos_client.CosmosClient.ReadItem
orReadItems
method.**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.azure.cosmosdb.CosmosDBReadItems.run (url=None, document_or_container_link=None, azure_credentials_secret="AZ_CREDENTIALS", options=None)[source] |
Task run method.
|
# CosmosDBQueryItems
class
prefect.tasks.azure.cosmosdb.CosmosDBQueryItems
(url=None, database_or_container_link=None, query=None, azure_credentials_secret="AZ_CREDENTIALS", options=None, partition_key=None, **kwargs)[source]Task for creating an item in a Azure Cosmos database. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
url (str, optional)
: The url to the database.database_or_container_link (str, optional)
: link to the database or container.query (dict, optional)
: the query to runazure_credentials_secret (str, optional)
: the name of the Prefect Secret that stores your Azure credentials; this Secret must be JSON string with the keyAZ_COSMOS_AUTH
. The value should be dictionary containingmasterKey
orresourceTokens
, where themasterKey
value is the default authorization key to use to create the client, andresourceTokens
value is the alternative authorization key.options (dict, optional)
: options to be passed to theazure.cosmos.cosmos_client.CosmosClient.QueryItems
method.partition_key (str, None)
: Partition key for the query.**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.azure.cosmosdb.CosmosDBQueryItems.run (url=None, database_or_container_link=None, query=None, azure_credentials_secret="AZ_CREDENTIALS", options=None, partition_key=None)[source] |
Task run method.
|
# DatafactoryCreate
class
prefect.tasks.azure.datafactory.DatafactoryCreate
(datafactory_name=None, resource_group_name=None, azure_credentials_secret="AZ_CREDENTIALS", location="eastus", polling_interval=10, options=None, **kwargs)[source]Task for creating an Azure datafactory. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
datafactory_name (str)
: Name of the datafactory to create.resource_group_name (str)
: Name of the resource group.azure_credentials_secret (str)
: Name of the Prefect Secret that stores your Azure credentials; This Secret must be JSON string with the keyssubscription_id
,client_id
,secret
, andtenant
. Defaults to "AZ_CREDENTIALS".location (str, optional)
: The location of the datafactory.polling_interval (int, optional)
: The interval, in seconds, to check the provisioning state of the datafactory Defaults to 10.options (dict, optional)
: The options to be passed to thecreate_or_update
method.**kwargs (dict, optional)
: Additional keyword arguments to pass to the Task constructor.
methods: |
---|
prefect.tasks.azure.datafactory.DatafactoryCreate.run (datafactory_name=None, resource_group_name=None, azure_credentials_secret=None, location=None, polling_interval=None, options=None)[source] |
Create an Azure datafactory.
|
# PipelineCreate
class
prefect.tasks.azure.datafactory.PipelineCreate
(datafactory_name=None, resource_group_name=None, pipeline_name=None, activities=None, azure_credentials_secret="AZ_CREDENTIALS", parameters=None, options=None, **kwargs)[source]Task for creating an Azure datafactory pipeline. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
datafactory_name (str)
: Name of the datafactory to create.resource_group_name (str)
: Name of the resource group.pipeline_name (str)
: Name of the pipeline.activities (list)
: The list of activities to run in the pipeline.azure_credentials_secret (str, optional)
: Name of the Prefect Secret that stores your Azure credentials; This Secret must be JSON string with the keyssubscription_id
,client_id
,secret
, andtenant
. Defaults to "AZ_CREDENTIALS".parameters (dict)
: The parameters to be used in pipeline.options (dict, optional)
: The options to be passed to thecreate_or_update
method.**kwargs (dict, optional)
: Additional keyword arguments to pass to the Task constructor.
methods: |
---|
prefect.tasks.azure.datafactory.PipelineCreate.run (datafactory_name=None, resource_group_name=None, pipeline_name=None, activities=None, azure_credentials_secret=None, parameters=None, options=None)[source] |
Create an Azure datafactory pipeline.
|
# PipelineRun
class
prefect.tasks.azure.datafactory.PipelineRun
(datafactory_name=None, resource_group_name=None, pipeline_name=None, azure_credentials_secret="AZ_CREDENTIALS", parameters=None, polling_interval=10, last_updated_after=None, last_updated_before=None, **kwargs)[source]Task for creating an Azure datafactory pipeline run. Note that all initialization arguments can optionally be provided or overwritten at runtime.
Args:
datafactory_name (str)
: Name of the datafactory to create.resource_group_name (str)
: Name of the resource group.pipeline_name (str)
: Name of the pipeline.azure_credentials_secret (str, optional)
: Name of the Prefect Secret that stores your Azure credentials; This Secret must be JSON string with the keyssubscription_id
,client_id
,secret
, andtenant
. Defaults to "AZ_CREDENTIALS".parameters (dict, optional)
: The parameters to be used in pipeline.polling_interval (int, optional)
: The interval, in seconds, to check the status of the run. Defaults to 10.last_updated_after (datetime, optional)
: The time at or after which the run event was updated; used to filter and query the pipeline run, and defaults to yesterday.last_updated_before (datetime, optional)
: The time at or before which the run event was updated; used to filter and query the pipeline run and defaults to tomorrow.**kwargs (dict, optional)
: Additional keyword arguments to pass to the Task constructor.
methods: |
---|
prefect.tasks.azure.datafactory.PipelineRun.run (datafactory_name=None, resource_group_name=None, pipeline_name=None, azure_credentials_secret=None, parameters=None, polling_interval=None, last_updated_after=None, last_updated_before=None)[source] |
Create an Azure datafactory pipeline run.
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC