Various alternatives for Azure storage in any of our automation solutions

How to automate important Azure operations in automation solutions.

Issue Description

Cannot connect UiPath Studio to Azure services, including Azure Storage, due to the absence of the Azure Activities Package or the Azure Scope Activity in the workflow.

Use Case:

Sometimes it can be challenging to align with all the teams to develop end-to-end process automation. This is a scenario where some data is required daily from another organizational unit for the automation solution. The data is requested to be shared over email, shared location, SharePoint, or any other common channel, but due to data sensitivity and policies, the other organization could only share it via Azure storage.

The challenge is that Azure storage was never used in any of the previous automation solutions. So various alternatives are being considered, including:

  • Connecting to Azure Blob from Excel
  • Downloading blobs from Azure Blob storage by using AzCopy
  • Azure Blob storage explorer
  • UiPath Azure Activities

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

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 allow the connection 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 logged into Azure Portal, the first step to do is to create an app in App registration. For this, follow the below steps:

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

Next, API permissions need to be added.

Step 2: Assign API permissions

  1. Follow the below steps to assign API permissions:
  2. Select API Permissions inside the newly created app registration
  3. Click on Add Permission
  4. Select Azure storage
  5. Select user_impersonation permissions
  6. Click on Add Permissions

Now the App registration setup is completed. Get the Application ID, Tenant ID and Client Secret and Subscription ID.

Step 3: Retrieve necessary information

To use Azure Scope Activity in UiPath Studio,collect some information as mentioned below:

  1. Select Overview inside the newly created app registration
  2. Copy the Application (Client) ID and directory (Tenant) ID
  3. Click on Client credentials and Add a certificate or secret Subscription ID will be visible in the overview section of the storage account (once it has been created)

Now you are ready to create a storage account.

Step 4: Create an Azure storage account

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

  1. From the left portal menu, select storage accounts
  2. Click Create on storage account page
  3. Select Subscription create a dedicated resource group
  4. Select storage Account Name, Region, Performance and Redundancy

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:

  1. Go to Resource Group where storage account is created
  2. Select Access Control (IAM)
  3. Click on Add and select Add Role Assignment
  4. Assign role to Storage Account Contributor
  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

  1. To get the data from Azure, follow the steps below:
  2. Add Azure Scope in the sequence
  3. Enter the input details retrieved in Step 3 – ClientID, ClientSecret, SubscriptionID and TenantID
  4. Add Get Storage Account activity inside the Azure Scope
    1. Enter Storage Account name, Resource Group Name and create an output variable for Storage Account
    2. Add Get Storage Account Key Activity to retrieve Storage Account Key
    3. Add Get Blob Container Activity and Enter Container name, Storage Account, Storage Account key and create an output variable for Blob container
    4. Add Get Blob List Activity and Enter blob container and retrieve output as list of Blob.
    5. Add For Each Activity to iterate through the blob list
    6. Add Download Blob to file Activity to download the data

With the help of the above configuration steps, data can be downloaded from Azure storage.