Hristo Papazov
11/27/2024, 11:07 PM'Result storage configuration must be persisted server-side. Please call '.save()' on your block before passing it in.'
error. Here is an example that I am trying. What am I missing?
from prefect import task, flow
from prefect_azure import AzureBlobStorageContainer, AzureBlobStorageCredentials
from azure.identity import DefaultAzureCredential
from prefect.filesystems import WritableFileSystem
credential = DefaultAzureCredential()
credentials = AzureBlobStorageCredentials(
account_url="<https://my-test-storage.blob.core.windows.net/>",
credentials=credential,
)
result_storage: WritableFileSystem = AzureBlobStorageContainer(
container_name="prefect-cache",
credentials=credentials,
base_folder="my_cache",
)
result_storage.save("my_results_storage", overwrite=True)
@task(persist_result=True)
def my_task(x):
print("Executing task...")
return x * 2
@flow(result_storage=result_storage)
async def entrypoint():
result = my_task(10)
print(f"Result: {result}")
Hristo Papazov
11/27/2024, 11:08 PMprefect-cache
Hristo Papazov
11/29/2024, 3:27 PM