Thread
#prefect-server
    Will Skelton

    Will Skelton

    8 months ago
    Can someone point me towards some additional documentation (examples are great!) on how to use the prefect.tasks.azure.blobstorage.BlobStorageUpload Task? I feel like I'm fairly close, but I'm not sure exactly what I need to try and pass into it credentials wise. I have a connection string from Azure and a Key, but I don't know where to put them exactly. Many Thanks!
    Kevin Kho

    Kevin Kho

    8 months ago
    The task pulls the Secret here and uses it to connect. If that setup is inconvenient to work with, I would suggest just using the task as a template and creating your own since it’s actually few lines of code. In order to get it to work though, it looks for a Secret named
    AZ_CONNECTION_STRING
    . If you were on Cloud, you would store the secret with us and it would be fetched. For Server, you need to set them locally like this
    Will Skelton

    Will Skelton

    8 months ago
    Thanks! I've gotten the secrets to work via the config.toml for another connection. I'm not entirely sure what the value of AZ_CONNECTION_STRING needs to be. I've got connection strings but also security key strings and Shared Access signature strings too. Any working examples around?
    Kevin Kho

    Kevin Kho

    8 months ago
    Ah I see. Unfortunately, I don’t have have an example. That task uses this line and you can see an example of what the connection string looks like here
    Will Skelton

    Will Skelton

    8 months ago
    Thanks Kevin, I feel like I'm getting closer.. maybe 😆 I just was able to run this and it seemed to pass successfully. (I added the last line to take an action on the "service" object to see if it would fail)
    connection_string = Secret("AZ_CONNECTION_STRING").get()
    service = BlobServiceClient.from_connection_string(conn_str=connection_string)
    service.get_service_stats(logging_enable=True)
    Kevin Kho

    Kevin Kho

    8 months ago
    Azure just has a lot of unintuitive stuff. I’ve been there 😅
    Will Skelton

    Will Skelton

    8 months ago
    Upon further inspection, it may be that the format of the data I'm trying to write into Azure isn't correct. I'm simply passing the my results from SqlServerFectch.run() straight into BlobStorageUpload.run() and that might be my issue. Going to look further into that. Thanks for the help!