From April 2017 onward we can use On-premises Data Gateway for Azure Analysis Services. This means you can connect your Tabular Models hosted in Azure Analysis Services to your on-premises data sources through On-premises Data Gateway. In this post you learn how to setup and configure the On-premises Data Gateway as well as how to configure Azure Analysis Services to connect to the on-premises database(s) via the gateway.
Requirements/Assumptions
- You have an Azure subscription
- You already have an up and running instance of Azure Analysis Services (AAS)
- You already installed and configured the latest version of On-premises Data Gateway
- Your instance of Azure Analysis Services, your instance of Power BI Service and your On-premises Data Gateway are all in the same “Region” (Check Prerequisites section below for more details)
- This post covers the most common scenario which doesn’t involve Kerberos, Proxy Server, OKTA etc…
Reading: If you are not that familiar with On-premises Data Gateway then I encourage you to read this and for more in-depth read this article. You may also watch this video from Adam Saxton discussing On-premises Data Gateway.
Prerequisites
As stated in the “Requirements” section, it is important to check if your instances of Azure Analysis Services, Power BI Service and On-premises Data Gateway located in the same “Region”.
The reasons behind that are:
- Your On-premises Data Gateway MUST be installed in the same Region as your Power BI Service sits in. Otherwise your Power BI cannot see the gateway, therefore, you’re unable to schedule automatic data refresh in Power BI Service
- To get the best performance and more reliability, you have to create On-premises Data Gateway Resource in Azure side in the same region as your Azure Analysis Services lives in
But, in some cases people created their Power BI account a long time ago and perhaps they didn’t set the right region for their Power BI Service to sit in. Now, they need to create an instance of Azure Analysis Services, but, due to their organisation privacy and security, they don’t want to (or perhaps not allowed to) create the instance of Azure Analysis Services in the region that their Power BI tenant sits in. So they would prefer to create the Azure Analysis Services in another region. In that case, it is recommended to install a new instance of On-premises Data Gateway in a separate server and change the “Gateway Region” during the installation.
To check the “Region” of your instances follow the steps below:
Power BI Service Region:
- Login to your Power BI Service
- Click the question mark on top right side of the page
- Click “About Power BI”
- The last line shows the region your tenant sits in
On-premises Data Gateway Region:
-
-
- Open “On-premises Data Gateway” and pass your credentials to sign in
- Look at the “Gateway Region” your current gateway is currently installed.
-
Azure Analysis Services Region:
- Login to Azure Portal
- Navigate to the Resource Group you created your instance of Azure Analysis Services
- You can find the region under “Location”
How It Works
I found it a bit confusing when I started to setup the “On-premises Data Gateway” for Azure Analysis Services for the first time. So, to make your lives easier I simply explain how it works and hopefully I can demystify the subject. The confusion raises when you see that you have to configure two “On-premises Data Gateway”. What is the difference?
Well, you have two different environments. Your on-premises environment and your Azure environment, right? The source database(s) sits in on-premises environment and Azure Analysis Services sits in Azure. You want to be able to process your data in Azure Analysis Services from your on-premises database. Therefore you need to expose your on-premises database to the cloud, right?
To do so:
- You first install and configure an instance of “On-premises Data Gateway”, which is a windows application, on a server in your on-premises environment.
- Then you create and configure “On-premises Data Gateway Resource” in your Azure environment.
- At last you connect your instance of Azure Analysis Services to your On-premises Data Gateway Resource.
Look at my hand drawing below that simply shows what I explained above:
Creating an On-premises Data Gateway Resource in Azure
As mentioned earlier I assume that you already installed an instance of “On-premises Data Gateway” on a server.
- Open “On-premises Data Gateway” and pass your credentials to sign in
- Click “Create a gateway in Azure” link which directly navigates you to “Create Connection Gateway” in online Azure Portal
- Enter “Resource Name”, select your subscription, select an existing resource group or create a new one
Note: if you prefer to create the gateway from Azure Portal, then click on “Create a resource” and search for “On-premises Data Gateway”. You can also find the “On-premises Data Gateway” resource under “Enterprise Integration” blade in Azure Portal.
-
- Select “Location” based on the “Gateway Region” you saw earlier in “On-premises Data Gateway”
- The “Installation Name” will be automatically detected if you select the right “Location” then click “Create”
So far we successfully created an instance of “On-premises Data Gateway” in Azure. Now it is time to connect our instance of Azure Analysis Services to the gateway.
To see more details about the gateway, in Azure Portal, navigate the “Resources Group” you created the gateway in then click on the gateway.
Connect Azure Analysis Services to On-premises Data Gateway
Now that we have successfully installed and configured t the gateway in both sides, our local machine and the cloud, it’s time to connect our existing instance of Azure Analysis Services to the gateway.
- Sign in to your Azure Portal
- Navigate to your Analysis Services instances
- Click on a desired instance
- Click “On-premises Data Gateway”
- If the gateway resource is created in the same region you should be able to see it in the drop-down list in the “Pick an On-premises Data Gateway to Connect” section
- Click Connect
- You then should see that Azure Analysis Services in now connected to the gateway resource
All done!