In this blog post, we are going to have a look at how you can automatically upload files to an Azure Blob storage account using Power Automate Desktop. Power Automate Desktop is a great tool to build automation on your desktop. You can create flows, interact with everyday tools such as email and excel and work with modern and legacy applications.
For example, you can automate tasks like:
Now want tasks I want to build some automation is to upload files to an Azure Blob Storage account for long-term storage. These can be small and large files, in my cases I wanted to backup all my large video files to an Azure blob Storage account.
To learn more about Power Automate check out Microsoft Docs.
You can download Power Automate Desktop from here.
Sign in to the Power Automate Desktop Windows application using one of the following accounts and automate your tedious tasks.
A full comparison of the features included in each account can be found here.
Secondly you create a Storage account in Azure. An Azure storage account provides you to host all of your Azure Storage data objects: blobs, files, queues, and tables. For more information about Azure storage accounts, see Storage account overview.
To create an Azure storage account just follow these steps on Microsoft Docs: Create a storage account.
Since I am dealing with large files, I decided to use the AzCopy utility. AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account. Get started with AzCopy.
After we prepared everything, we can now start to create the flow in Power Automate Desktop.
First, I create the following variables within the flow.
To generate the URI with the SAS (Shared access signature) token, go to the Azure Portal to your Azure storage account. Go to containers and create a new container. Open the container and on the and navigate to Shared access signature. Select add, create, and write permission, change the time if needed, and press Generate SAS token and URL. Copy the Blob SAS URL and save it as the variable in the flow.
IMPORTANT: When you add the SAS URL to the variable you will need to make all the % to %% because of how Power Automate Desktops names variables.
Since we want to use the AzCopy utility to copy the files to the Azure Blob storage, you can now add the “Run PowerSheel script” action with the following PowerShell code:
%AzCopy% copy "%UploadFolder%" "%AzureBlobSAS%" --recursive=true
With the last step, we are going to move the uploaded files to another folder.
I hope this blog post provides you with a quick overview of how you can upload files to an Azure Blob storage account using Power Automate. There are of course other ways on how to do this but the great thing here is that you can easily upload large files and add more actions to your Power Automate Desktop Flow. If you have any questions, feel free to leave a comment below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.