Applies to: Azure SQL Database
The Query editor (preview) is a tool to run T-SQL queries in the Azure portal in the browser against Azure SQL Database.
The query editor is designed for lightweight querying and object exploration in your Azure SQL database, all from within the browser in the Azure portal. You can run T-SQL queries against your database, as well as edit data in the build-in tabular data editor.
Similar to the query experience in SQL Server Management Studio, use the query editor for both simple queries or larger T-SQL queries. You can execute Data Manipulation Language (DML) and Data Definition Language (DDL) queries.
Connect via the query editorThere are two authentication options for query editor: SQL authentication or authentication with Microsoft Entra ID (formerly Azure Active Directory).
Authentication to Azure SQL DatabaseFor examples, see Quickstart: Use the Azure portal query editor (preview) to query Azure SQL Database.
master
database or a contained SQL user in the desired user database. For more information, see Logins.
Users need at least the Azure role-based access control (RBAC) permission Read access to the server and database to use the query editor.
Navigate query editorThere are four main sections of the query editor:
Navigation barThere are four tasks you can perform in the navigation bar.
.sql
or .txt
files from your local computer and open them in the query window.The object explorer allows you to view and perform tasks against your database's tables, views, and stored procedures.
This window allows you to type or paste a query, then run it. The results of the query are shown in the Results pane.
You can cancel your query. As noted under Considerations and limitations, there's a five-minute timeout period.
The Save query button allows you to save the query text to your computer as a .sql file.
The Export data as button allows you to export the query results to your computer as a .json, .csv, or .xml file.
The query execution time, or errors, are shown in the status bar.
Microsoft Copilot in Azure SQL Database (preview)Copilot for Azure SQL Database within the Azure portal provides relevant answers to user questions, simplifying database management by applying database context, documentation, dynamic management views, Query Store, and other knowledge sources.
Data editorThe data editor allows you to modify data in an existing row, add a new row of data to the table, or delete a row of data. This is similar to the experience in SQL Server Management Studio (SSMS).
To access data editor, in the object explorer expand Tables, then select the ellipses to the right of the table name and select Edit Data (Preview).
To modify data in an existing row, select the value you want to change, make your change, and then select Save at the top.
Save failed: Failed to execute query. Error: Cannot update identity column *column_name*
.To add a new row, select Create New Row and enter the values you want to add. There are certain data types you can't add or work with in this context.
Save failed: Cannot set value in identity columns *column_name*
.Save failed: Failed to execute query. Error: The column *column_name* cannot be modified because it is either a computed column or is the result of a UNION operator.
It is not recommended to use the data editor for tables that have computed columns.To delete a row of data, select the row and select Delete Row.
The following considerations and limitations apply when connecting to and querying Azure SQL Database with the Azure portal query editor.
Query editor limitationsmaster
database. To connect to the master
database, use other tools to query your Azure SQL Database.ApplicationIntent=ReadOnly
. To connect in this way, use SSMS and specify ApplicationIntent=ReadOnly
on the Additional Connection Parameters tab in connection options. For more information, see Connect to a read-only replica.In addition to the Azure portal query editor for Azure SQL Database, consider the following quickstarts for other tools:
If you see the error message The X-CSRF-Signature header could not be validated
, take the following actions to resolve the issue:
X-CSRF-Signature
isn't being modified or dropped.If your database is serverless and you see the error message: Database *name* on server *name.database.windows.net* is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID *ID*
This indicates your serverless database is currently paused. If this occurs, selecting Continue as <user@domain>
sends a request to the database to resume. Wait approximately one minute, refresh the page, and try again.
If you see the error message "Login failed for user <token-identified principal>
. The server is not currently configured to accept this token." when you attempt to use AD authentication, your user does not have access to the database.
CREATE USER [group or user] FROM EXTERNAL PROVIDER
in the user database.You might get one of the following errors in the query editor:
Your local network settings might be preventing the Query Editor from issuing queries. Please click here for instructions on how to configure your network settings.
A connection to the server could not be established. This might indicate an issue with your local firewall configuration or your network proxy settings.
These errors occur because the query editor is unable to communicate through ports 443 and 1443. You need to enable outbound HTTPS traffic on these ports. The following instructions walk you through this process, depending on your OS. Your corporate IT department might need to grant approval to open this connection on your local network.
Allow 443 and 1443 in Windows Defender Firewall443, 1443
, and then select Next.Run these commands to update iptables
:
sudo iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 1443 -j ACCEPT
Allow 443 and 1443 in Azure VM
When using Azure VMs, you have an Azure network security group blocking connectivity. A network security group can filter inbound and outbound network traffic to and from Azure resources in an Azure virtual network. You need to add an outbound security rule to the network security group. For an example, see Create security rules.
Next stepQuickstart: Use the Azure portal query editor to query Azure SQL Database
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4