How to Fix Azure SQL OAuth Authentication Errors in Power BI
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.

- 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.'
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.
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.
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.
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.
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.
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.

Verify Virtual Network Data Gateway Configuration
A misconfigured or offline VNet data gateway can block OAuth logins between the Power BI service and Azure SQL.
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. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install and Launch: Follow the simple on-screen instructions to install the software, then launch WPS Spreadsheet.
- 3. Import and Analyze Data: Open your existing Excel files or connect to local data sources directly to begin visualizing your data instantly.

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.




