Hi team, does anyone have an example of using pref...
# ask-community
h
Hi team, does anyone have an example of using prefect with Azure Blob storage to manage results? I am trying to use it but keep getting
'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?
Copy code
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}")
The only thing that exists in the storage blob is the container
prefect-cache
Just bumping this question up.