This blog post will help you build an automated and effortless way to keep your Azure Analysis Services model up-to-date using Azure Data Factory, ensuring accurate insights with seamless refreshment.
Let’s get started.
Before you start with Azure Data Factory, you need to complete the following activities:
Granting Contributor access to Azure Data factory’s Managed Identity in Azure Analysis Service.
Step 1: Go to portal.azure.com
Step 2: Go to your Azure Analysis Service Resource.
Step 3: Click on Access Control (IAM).
Step 4: Click on Add Role Assignment.
Step 5: Choose Role as Contributor.
Step 6: Click on Members.
Step 7: Select the radio button Managed identity and click Select members.
Step 8: From Managed Identity drop down, select Data Factory.
Step 9: Select the Azure Data factory instance you want to give access to.
Step 10: Click Select.
Step 11: Click Review + Assign.
Getting the Azure Data factory Service Principal:
Step 1: Go to portal.azure.com
Step 2: Go to your Azure Data factory Resource.
Step 3: Click on Properties.
Step 4: Copy the values of Managed Identity Tenant and Managed Identity Application ID and keep them in Notepad in the format app:<Managed Identity Application ID>@<Managed Identity Tenant>
Adding Azure Data factory’s (ADF) Service Principal as a User to the Azure Analysis Service (AAS)
Step 1: Open SQL Server Management Studio (SSMS).
Step 2: Connect to the Azure Analysis Service Server (AAS).
Step 3: Right Click on the Server and select Properties.
Step 4: Select Security.
Step 5: Click on Add.
Step 6: Paste the ADF’s Service Principal you had copied earlier in the Manual Entry.
Step 7: Click Add.
Step 8: Click Ok.
Generating the AAS URL to use in ADF Pipeline for Refresh:
Step 1: Go to a Notepad and fill in the details in the below format:
https://<AAS region>.asazure.windows.net/servers/<AAS Server Name>/models/<AAS Model Name>/refreshes
e.g.: https://centralus.asazure.windows.net/servers/IzationAAS/models/Sales/refreshes
Now that we have set up all the required access and details, let’s go to Azure Data Factory.
Step 1: Launch the Azure Data Factory.
Step 2: Create a new pipeline.
Step 3: Drag and Drop Web Activity from Activities section to the Canvas.
Step 4: Go to the settings section of this activity.
Step 5: Enter the following values:
URL: https://<region>.asazure.windows.net/servers/<AAS ServerName>/models/<AAS ModelName>/refreshes
Method: POST
Body:
{"Type":"Full","CommitMode":"transactional","MaxParallelism":10,"RetryCount":2}
Authentication: System Assigned Managed Identity
Resource: https://*.asazure.windows.net
Step 6: Click Debug.
Ready to elevate your skills? Click here for my Python book and here for my Machine Learning book on Kindle.
Leave a comment