24 March 2022

Using UiPath Azure Activities to Access Azure Blob Storage Data

24 March 2022

Using UiPath Azure Activities to Access Azure Blob Storage Data

⬅  SEE ALL THE ARTICLES

 

Introduction

 

UiPath activities are the building blocks of automation projects. They enable you to perform all sorts of actions ranging from reading Excel, Outlook mails, PDFs, Word documents, and more to interact with different applications like Microsoft's Azure cloud. 

UiPath.AzureActivities package offers activities that enable IT departments to easily automate critical Azure operations in their workflows like storage accounts, Blob containers, Blobs, Key Vault, virtual machines, and resource groups. This article will assist you in using UiPath activities to get data from Azure Blob storage.  

  

Requirements

 

Before we get started, you'll need to have:  

  • 1. An overview of the Azure storage account, containers, and blob
  • 2. An understanding of App registration in Azure Active directory 
  • 3. UiPath.Azure.Activites installed in UiPath Studio
  •  

Scenario

 

Sometimes it can be challenging to align with all the teams to develop end-to-end process automation. You need to agree with their policies and way of working. I came across a scenario where we required some data daily from another organizational unit for our automation solution. We asked to share data over email, shared location, SharePoint, or any other common channel, and due to data sensitivity and policies, they could only share it via Azure storage.

 

But the challenge was we never used Azure storage in any of our automation solutions. So, we explored various alternatives, including:

  

  • 1. Connecting to Azure Blob from Excel  
  • 2. Downloading blobs from Azure Blob storage by using AzCopy  
  • 3. Azure Blob storage explorer  
  • 4. UiPath Azure Activities

  

Out of various alternatives, we found out that UiPath Azure Activities is the best possible solution because it is easy to implement, it offers stability and scalability. 

  

Now, let's dive into the steps to set up integration between UiPath and Azure. Keep the above scenario in mind and follow the steps. 

 

Connecting to Azure storage

 

The official UiPath IT Automation activities for Azure enable us to connect to Blob containers with both an App Registration and with a StorageAccountKey (without needing a Scope Activity). 

 

Option 1: Using a StorageAccountKey 

Option 2: Using the AzureScope activity and an Azure AppRegistration 

 

Step 1: Create App Registration in Azure Active Directory 

Once you have logged into Azure Portal, the first step to do is create an app in App registration. For this, follow the below steps: 

 

  1. 1.1 Go to Azure Active directory 
  2. 1.2 Go to App Registrations 
  3. 1.3 Click on New Registration
  4. 1.4 Provide a Name and select the Supported Account Type (which can use this application or access this API)
  5. 1.5 Click on Register 
  1.  

 

Next, you need to add API permissions. 

 

Step 2: Assign API permissions

 

Follow the below steps to assign API permissions: 

 

  1. 2.1 Select API Permissions inside the newly created app registration
  2. 2.2 Click on Add Permission
  3. 2.3 Select Azure storage
  4. 2.4 Select user_impersonation permissions
  5. 2.5 Click on Add Permissions
  6.  

  1. Now the App registration setup is completed. Get the Application ID, Tenant ID and Client Secret and Subscription ID.
  2.  
  3. Step 3: Retrieve necessary information
  4.  
  5. To use Azure Scope Activity in UiPath Studio, you will need to collect some information as mentioned below:
  6.  
  7. 3.1 Select Overview inside the newly created app registration
  8. 3.2 Copy the Application (Client) ID and directory (Tenant) ID
  9. 3.3 Click on Client credentials and Add a certificate or secret
  10. 3.4 Subscription ID will be visible in the overview section of the storage account (once it has been created)
  11.  
  12. Now you are ready to create a storage account.
  13.  
  14. Step 4: Create an Azure storage account

You can create Azure storage account with the Azure portal, by taking the steps below:  

  1. 4.1 From the left portal menu, select  storage accounts
  2. 4.2 Click Create on storage account page
  3. 4.3 Select Subscription, create a dedicated resource group
  4. 4.4 Select storage Account Name, Region, Performance and Redundancy
  5.  
  6. Once you create a storage account, create a container, and share it with the team to load data. Now that you have a storage account and App registration, let’s create a connection between them. 

 

Step 5: Assign App registration permissions to storage account

 

To assign registered App access to the storage account, follow these steps:

 

5.1 Go to Resource Group where storage account is created

5.2 Select Access Control (IAM)

5.3 Click on Add and select Add Role Assignment

5.4 Assign role to Storage Account Contributor

5.5 Select Members and search for newly created

 

App registration

 

Now everything is configured in Azure. Let’s create a workflow in UiPath to download data from Azure storage. 

 

Step 6: Create UiPath workflow to download data

 

To get the data from Azure, follow the below steps:

 

6.1 Add Azure Scope in the sequence

6.2 Enter the input details retrieved in Step 3 – ClientID, ClientSecret, SubscriptionID and TenantID

6.3 Add Get Storage Account Activity inside the Azure Scope

6.4 Enter Storage Account name, Resource Group Name and create an output variable for Storage Account

6.5 Add Get Storage Account Key Activity to retrieve Storage Account Key

6.6 Add Get Blob Container Activity and Enter Container name, Storage Account, Storage Account key and create an output variable for Blob container

6.7 Add Get Blob List Activity and Enter blob container and retrieve output as list of Blob.

6.8 Add For Each Activity to iterate through the blob list

6.9 Add Download Blob to file Activity to download the data

  1.  
  2.  
  3. Now you have data downloaded from Azure storage.
  4.  

Conclusion

 

One of the best things to do when building something is to be prepare in advance. Try to explore all the possible approaches to achieve the business scenario you have in mind. By using UiPath Azure Activities, you are not limited to downloading data, and you can also perform various operations in Azure Key Vault, networking, resource groups, security, storage, and virtual machines. This article explains at a conceptual level the steps that can be taken for UiPath and Azure integration. 

 

 

Ronak Gupta is an RPA Solution Architect & Developer at

 

 

Review UiPath and earn gift cards. Join us and help other professionals learn from your experience with UiPath. Your review can be anonymous.


by Ronak Gupta

TOPICS: IT Automation, Azure

Show sidebar