How to Add or Remove a Gateway Data Source from Powerbi.com

We’ve split the on-premises data gateway docs into content that’s specific to Power BI and general content that applies to all services that the gateway supports. You’re currently in the Power BI content. To provide feedback on this article, or the overall gateway docs experience, scroll to the bottom of the article.

Power BI supports many on-premises data sources, and each has its own requirements. A gateway can be used for a single data source or multiple data sources. For this example, we show you how to add SQL Server as a data source. The steps are similar for other data sources.

Most data sources management operations can be performed by using APIs as well. For more information, see REST APIs (Gateways).

If you don’t have a gateway installed yet, see Install an on-premises data gateway to get started.

Add a data source

  1. From the page header in the Power BI service, select Settings Settings gear icon > Manage gateways.Manage gateways
  2. Select a gateway and then select Add data source. You can select the header text ADD DATA SOURCE or hover your cursor next to the gateway entry to reveal the more options menu.Add data source
  3. Assign a name to your data source, then select the Data Source Type. In this example, we’ll choose SQL Server.Select SQL Server
  4. Enter information about the data source. For SQL Server, provide the Server and Database.Data source settings
  5. Select an Authentication Method to use when connecting to the data source. For SQL Server, choose Windows or Basic (SQL Authentication). Enter the credentials for your data source.Basic authentication settings. NoteIf the selected authentication method is OAuth:
    • Any query that runs longer than the OAuth token expiration policy may fail.
    • Cross-tenant AAD accounts are not supported If the selected authentication method is Windows:
    • Make sure that account has access on the machine. If not sure, make sure to add NT-AUTHORITY\Authenticated Users (S-1-5-11) to the local machine “Users” group.
  6. Under Advanced settings, you could configure Single Sign-On (SSO) for your data source.Screenshot of advanced settings. You can either configure Use SSO via Kerberos for DirectQuery queriesUse SSO via Kerberos for DirectQuery And Import queries or Use SSO via Azure AD for DirectQuery queries for DirectQuery-based reports and Use SSO via Kerberos for DirectQuery And Import queries for refresh-based reports.If you use Use SSO via Kerberos for DirectQuery queries and use this data source for a DirectQuery-based report, it will use the credentials of the user that signs in to the Power BI service. For a refresh-based report, it will use the credentials that you enter in the Username and Password fields and the Authentication method chosen.When you use Use SSO via Kerberos for DirectQuery And Import queries, you don’t need to provide any credentials. If this data source is used for DirectQuery-based reports, it will use the user that’s mapped to the (Azure) Active Directory user that signs in to the Power BI service. For a refresh-based report, it will use the dataset owner’s security context.For more information on Use SSO via Kerberos for DirectQuery queries or Use SSO via Kerberos for DirectQuery And Import queries, see Overview of single sign-on (SSO) for gateways in Power BI.If you use Use SSO via Azure AD for DirectQuery queries and use this data source for a DirectQuery-based report, it will use the Azure AD token of the user who signs into the Power BI service. For a refresh-based report, it will use the credentials that you enter in the Username and Password fields and the Authentication method chosen. The Use SSO via Azure AD for DirectQuery queries option will be available only if the tenant admin allows Azure AD SSO via the on-premises data gateway and for the following data sources:
    • SQL Server
    • Azure Data Explorer
    • Snowflake
    For more information on Use SSO via Azure AD for DirectQuery queries please see Azure AD Single Sign-On (SSO) for Gateway. NoteSSO for Import Queries is available only for the list of SSO data sources using Kerberos constrained delegation.
  7. Under Advanced settings, optionally configure the privacy level for your data source (doesn’t apply to DirectQuery).Privacy level selections.
  8. Select Add. You see Connection Successful if the process succeeds.Connection successful

You can now use this data source to include data from SQL Server in your Power BI dashboards and reports.

Remove a data source

You can remove a data source if you no longer use it. Removing a data source breaks any dashboards and reports that rely on that data source.

To remove a data source, go to the data source and then select Remove from the more options menu. The more options menu appears when you hover your cursor next to the data source name.

Remove a data source

Use the data source for scheduled refresh or DirectQuery

After you create the data source, it’s available to use with either DirectQuery connections or through scheduled refresh. You can learn more about setting up scheduled refresh in Configure scheduled refresh.

 Note

Server and database names must match between Power BI Desktop and the data source added to the on-premises data gateway.

The link between your dataset and the data source in the gateway is based on your server name and database name. These names must match. For example, if you supply an IP address for the server name, in Power BI Desktop, you must use the IP address for the data source in the gateway configuration. If you use SERVER\INSTANCE in Power BI Desktop, you must use the same in the data source configured for the gateway.

If you’re listed in the Users tab of the data source configured in the gateway, and the server and database name match, you see the gateway as an option to use with scheduled refresh.

Gateway connection

 Warning

If your dataset contains multiple data sources, each data source must be added in the gateway. If one or more data sources aren’t added to the gateway, you won’t see the gateway as available for scheduled refresh.

Considerations and limitations

OAuth is a supported authentication scheme only for custom connectors with the on-premises data gateway.

Manage users

After you add a data source to a gateway, you give users and email-enabled security groups access to the specific data source (not the entire gateway). The access list for the data source controls only who is allowed to publish reports that include data from the data source. Report owners can create dashboards and apps, and then share those items with other users.

You can also give users and security groups administrative access to the gateway.

 Note

Users with access to the data source can associate datasets to the data source, and connect, based on the security options (either the stored credentials or Single Sign-On) selected while creating a data source.

Add users to a data source

  1. From the page header in the Power BI service, select Settings Settings gear icon > Manage gateways.
  2. Select the data source where you want to add users.
  3. Select Users, and enter the users and mail-enabled security groups from your organization who will access the selected data source. Select Add, and the added member’s name is added to the list of people who can publish reports that use this data source.Add user

Remember that you need to add users to each data source that you want to grant access to. Each data source has a separate list of users. Add users to each data source separately.

Remove users from a data source

On the Users tab for the data source, you can remove users and security groups that use this data source.

Remove user

Store encrypted credentials in the cloud

When you add a data source to the gateway, you must provide credentials for that data source. All queries to the data source will run by using these credentials. The credentials are encrypted securely. They use symmetric encryption so that they can’t be decrypted in the cloud before they’re stored in the cloud. The credentials are sent to the machine that runs the gateway, on-premises, where they’re decrypted when the data sources are accessed.

Ref: https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-data-sources