logo
search
Account Security Problems

How to Fix Azure SQL OAuth Authentication Errors in Power BI

Olivia MillerOlivia Miller Oct 16, 2026 868 views

Question details

The user is experiencing OAuth authentication failures when attempting to connect Power BI to an Azure SQL Database through a virtual network data gateway.

How to Fix Azure SQL OAuth Authentication Errors in Power BI
Product
Power BI
Device & OS
not provided
Scenario
Updating database connection credentials or refreshing a scheduled dataset via a virtual network data gateway.
Observed behavior
Power BI displays the error: 'Unable to update connection credentials. OAuth login through the data gateway was unsuccessful.'
Before you start

Ensure you have administrative access to your Microsoft Entra ID (formerly Azure Active Directory) portal and possess the necessary permissions to register new applications and assign database roles in Azure SQL.

Solution 1Recommended

Register an Application in Microsoft Entra ID and Configure Credentials

Registering a dedicated app in Microsoft Entra ID generates the client ID and secret required for Power BI to securely authenticate with Azure SQL Database via OAuth over a private endpoint.

When connecting Power BI to an Azure SQL Database through a virtual network data gateway using OAuth, standard user credentials are not sufficient. You must explicitly register an application to manage the secure token exchange.

1
Register a new application

Navigate to the Microsoft Entra ID portal. In the left-hand menu, select 'App registrations' and click 'New registration'. Enter a recognizable name for your application and complete the registration to obtain the Application (client) ID.

2
Generate a client secret

Within your new app registration, go to 'Certificates & secrets'. Click 'New client secret', add a description, and select an expiration period. Copy and securely save the generated secret value immediately, as it will be hidden later.

3
Grant database permissions

Log into your Azure SQL Database using an admin account. Run the necessary SQL commands to create a user for your registered application and assign it the appropriate database read or server roles.

4
Update Power BI gateway credentials

Open the Power BI service and navigate to 'Settings' > 'Manage gateways'. Select your virtual network data gateway, edit the Azure SQL data source credentials, and input the newly generated Client ID and Client Secret under the OAuth authentication method.

Register an Application in Microsoft Entra ID and Configure Credentials
Private Endpoint Requirements: An explicitly registered Entra ID application is mandatory when connecting through a private endpoint using a virtual network data gateway to properly route and authenticate the OAuth tokens.
Free Microsoft Office alternative

Switch to WPS Office for Seamless Data Management and Reporting

While Power BI handles complex cloud database gateways, WPS Spreadsheet provides a lightweight, highly compatible, and user-friendly environment for your everyday data analysis, visualization, and reporting tasks—without the need for complex OAuth setups.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install and Launch: Follow the simple on-screen instructions to install the software, then launch WPS Spreadsheet.
  3. 3. Import and Analyze Data: Open your existing Excel files or connect to local data sources directly to begin visualizing your data instantly.
Highly compatible with Microsoft Excel (.xlsx) formats for seamless file sharing.Free and lightweight alternative to Microsoft Office.Built-in charts, pivot tables, and advanced data visualization tools.Familiar user interface ensuring a zero-learning-curve transition.
QA img-9

Frequently Asked Questions

Why do I need to register an app for Azure SQL in Power BI?

When using a virtual network (VNet) data gateway with private endpoints, Power BI cannot use standard user-delegated authentication. It requires a registered Microsoft Entra ID application to securely generate and manage OAuth tokens for database access.

What does 'OAuth login through the data gateway was unsuccessful' mean?

This error indicates that the Power BI data gateway could not authenticate with your Azure SQL Database. Common causes include incorrect client IDs, expired client secrets, or insufficient application permissions configured in Microsoft Entra ID.

Can I use basic SQL authentication instead of OAuth for Azure SQL?

Yes, basic SQL authentication (using a username and password) can be used. However, OAuth is strongly recommended for enterprise environments because it provides more secure, centralized, and identity-based access control.

How do I grant the Entra ID application access to my Azure SQL database?

You must connect to the Azure SQL database using an administrative account (e.g., via SQL Server Management Studio) and execute SQL commands to create a user mapped to your application's identity, followed by altering the role to grant it required read or write permissions.