prefect_azure.deployments.steps
Prefect deployment steps for code storage and retrieval in Azure Blob Storage.
These steps can be used in a prefect.yaml
file to define the default
push and pull steps for a group of deployments, or they can be used to
define the push and pull steps for a specific deployment.
Example
Sample prefect.yaml
file that is configured to push and pull to and
from an Azure Blob Storage container:
```yaml prefect_version: ... name: ...
push: - prefect_azure.deployments.steps.push_to_azure_blob_storage: requires: prefect-azure[blob_storage] container: my-container folder: my-folder credentials: "{{ prefect.blocks.azure-blob-storage-credentials.dev-credentials }}"
pull: - prefect_azure.deployments.steps.pull_from_azure_blob_storage: requires: prefect-azure[blob_storage] container: "{{ container }}" folder: "{{ folder }}" credentials: "{{ prefect.blocks.azure-blob-storage-credentials.dev-credentials }}" ```
Note
Azure Storage account needs to have Hierarchical Namespace disabled.
For more information about using deployment steps, check out out the Prefect docs.
pull_from_azure_blob_storage(container, folder, credentials)
Pulls from an Azure Blob Storage container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container
|
str
|
The name of the container to pull files from |
required |
folder
|
str
|
The folder within the container to pull from |
required |
credentials
|
Dict[str, str]
|
A dictionary of credentials with keys |
required |
Note
Azure Storage account needs to have Hierarchical Namespace disabled.
Example
Pull from an Azure Blob Storage container using credentials stored in a block:
pull:
- prefect_azure.deployments.steps.pull_from_azure_blob_storage:
requires: prefect-azure[blob_storage]
container: my-container
folder: my-folder
credentials: "{{ prefect.blocks.azure-blob-storage-credentials.dev-credentials }}"
Pull from an Azure Blob Storage container using an account URL and default credentials:
pull:
- prefect_azure.deployments.steps.pull_from_azure_blob_storage:
requires: prefect-azure[blob_storage]
container: my-container
folder: my-folder
credentials:
account_url: https://myaccount.blob.core.windows.net/
Source code in prefect_azure/deployments/steps.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
push_to_azure_blob_storage(container, folder, credentials, ignore_file='.prefectignore')
Pushes to an Azure Blob Storage container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container
|
str
|
The name of the container to push files to |
required |
folder
|
str
|
The folder within the container to push to |
required |
credentials
|
Dict[str, str]
|
A dictionary of credentials with keys |
required |
ignore_file
|
Optional[str]
|
The path to a file containing patterns of files to ignore when
pushing to Azure Blob Storage. If not provided, the default |
'.prefectignore'
|
Example
Push to an Azure Blob Storage container using credentials stored in a block:
push:
- prefect_azure.deployments.steps.push_to_azure_blob_storage:
requires: prefect-azure[blob_storage]
container: my-container
folder: my-folder
credentials: "{{ prefect.blocks.azure-blob-storage-credentials.dev-credentials }}"
Push to an Azure Blob Storage container using an account URL and default credentials:
push:
- prefect_azure.deployments.steps.push_to_azure_blob_storage:
requires: prefect-azure[blob_storage]
container: my-container
folder: my-folder
credentials:
account_url: https://myaccount.blob.core.windows.net/
Source code in prefect_azure/deployments/steps.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|