Applies to: Azure SQL Database Azure Synapse Analytics
This article describes the logical server in Azure used by databases in Azure SQL Database and Azure Synapse Analytics. In the Azure portal, the logical server is named SQL server and is different to the SQL Server product.
OverviewIn Azure SQL Database and Azure Synapse Analytics, a server is a logical construct that acts as a central administrative point for a collection of databases. At the logical server level, you can administer logins, firewall rules, auditing rules, threat detection policies, and failover groups. A logical server can be in a different region than its resource group. The logical server must exist before you can create a database in Azure SQL Database or a dedicated SQL pool in Azure Synapse Analytics. All databases managed by a single logical server are created within the same region as the logical server.
This logical server is distinct from a SQL Server instance that you may be familiar with in the on-premises world. Specifically, there are no guarantees regarding location of the databases or dedicated SQL pool in relation to the server that manages them. Azure SQL Database and Azure Synapse don't expose any instance-level access or features. In contrast, the instance databases in a managed instance are all physically co-located - in the same way that you are familiar with SQL Server in the on-premises or virtual machine world.
When you create a logical server, you provide a server login account and password that has administrative rights to the master
database on that server and all databases created on that server. This initial account is a SQL login account. Azure SQL Database and Azure Synapse Analytics support both SQL authentication and Microsoft Entra authentication. For information about logins and authentication, see Managing Databases and Logins in Azure SQL Database. Windows Authentication is not supported.
A logical server in SQL Database and Azure Synapse Analytics:
<serverName>
.database.windows.net)master
databasemaster
database of a logical server contains logins similar to those in instances of SQL Server that are granted access to one or more databases on the server, and can be granted limited administrative rights. For more information, see logins.master
database on a logical server is not supported.SQL_LATIN1_GENERAL_CP1_CI_AS
, where LATIN1_GENERAL
is English (United States), CP1
is code page 1252, CI
is case-insensitive, and AS
is accent-sensitive.You can manage logical servers, databases, dedicated SQL pools, and firewalls by using the Azure portal, Azure PowerShell, the Azure CLI, Transact-SQL (T-SQL) and REST API.
You can create the resource group for a logical server ahead of time or while creating the server itself. There are multiple methods for getting to a new SQL server form, either by creating a new SQL server or as part of creating a new database.
Create a blank serverTo create a blank logical server (without a database, elastic pool, or dedicated SQL pool) using the Azure portal, navigate to a blank SQL server (logical SQL server) form.
Create a blank or sample database in Azure SQL DatabaseTo create a database in SQL Database using the Azure portal, navigate to create a new SQL Database and provide the requested information. You can create the resource group and server ahead of time or while creating the database itself. You can create a blank database or create a sample database based on AdventureWorksLT
.
To manage an existing server, navigate to the server using a number of methods - such as from specific database page, the SQL servers page, or the All resources page.
To manage an existing database, navigate to the SQL databases page and select the database you wish to manage.
For example, to configure a firewall rule, follow these steps:
Navigate to your database resource in the Azure portal. Select Set server firewall on the toolbar.
Set Public network access to Selected networks to reveal the virtual networks and firewall rules. When set to Disabled, virtual networks and firewall rule settings are hidden.
Choose Add a firewall rule to configure the firewall.
You can configure your database using Azure PowerShell.
Important
The PowerShell Azure Resource Manager (AzureRM) module was deprecated on February 29, 2024. All future development should use the Az.Sql module. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates. The AzureRM module is no longer maintained or supported. The arguments for the commands in the Az PowerShell module and in the AzureRM modules are substantially identical. For more about their compatibility, see Introducing the new Az PowerShell module.
To create and manage servers, databases, and firewalls with Azure PowerShell, use the following PowerShell cmdlets. If you need to install or upgrade PowerShell, see Install Azure PowerShell module. For creating and managing elastic pools, see Elastic pools.
To create and manage servers, databases, and firewalls with the Azure CLI, use the following Azure CLI SQL Database commands. Use the Cloud Shell to run the CLI in your browser, or install it on macOS, Linux, or Windows. For creating and managing elastic pools, see Elastic pools.
To create and manage servers, databases, and firewalls with Transact-SQL, use the following T-SQL commands. You can issue these commands using the Azure portal, SQL Server Management Studio, Visual Studio Code, or any other program that can connect to a server and pass Transact-SQL commands. For managing elastic pools, see Elastic pools.
Important
You cannot create or delete a server using Transact-SQL.
Command Description CREATE DATABASE (Azure SQL Database) Creates a new database in Azure SQL Database. You must be connected to themaster
database to create a new database. CREATE DATABASE (Azure Synapse) Creates a new dedicated SQL pool in Azure Synapse. You must be connected to the master
database to create a new database. ALTER DATABASE (Azure SQL Database) Modifies database or elastic pool. ALTER DATABASE (Azure Synapse Analytics) Modifies a dedicated SQL pool in Azure Synapse. DROP DATABASE (Transact-SQL) Deletes a database. sys.database_service_objectives (Azure SQL Database) Returns the edition (service tier), service objective (pricing tier), and elastic pool name, if any, for a database. If logged on to the master
database for a server, returns information on all databases. For Azure Synapse, you must be connected to the master
database. sys.dm_db_resource_stats (Azure SQL Database) Returns CPU, IO, and memory consumption for a database in Azure SQL Database. One row exists for every 15 seconds, even if there is no activity in the database. sys.resource_stats (Azure SQL Database) Returns CPU usage and storage data for a database in Azure SQL Database. The data is collected and aggregated within five-minute intervals. sys.database_connection_stats (Azure SQL Database) Contains statistics for database connectivity events for Azure SQL Database, providing an overview of database connection successes and failures. sys.event_log (Azure SQL Database) Returns successful database connections and connection failures for Azure SQL Database. You can use this information to track or troubleshoot your database activity. sp_set_firewall_rule (Azure SQL Database) Creates or updates the server-level firewall settings for your server. This stored procedure is only available in the master
database to the server-level principal login. A server-level firewall rule can only be created using Transact-SQL after the first server-level firewall rule has been created by a user with Azure-level permissions sys.firewall_rules (Azure SQL Database) Returns information about the server-level firewall settings associated with a server. sp_delete_firewall_rule (Azure SQL Database) Removes server-level firewall settings from a server. This stored procedure is only available in the master
database to the server-level principal login. sp_set_database_firewall_rule (Azure SQL Database) Creates or updates the database-level firewall rules for a database in Azure SQL Database. Database firewall rules can be configured for the master
database, and for user databases in SQL Database. Database firewall rules are useful when using contained database users. Database firewall rules are not supported in Azure Synapse. sys.database_firewall_rules (Azure SQL Database) Returns information about the database-level firewall settings for a database in Azure SQL Database. sp_delete_database_firewall_rule (Azure SQL Database) Removes database-level firewall setting for a database of yours in Azure SQL Database.
To create and manage servers, databases, and firewalls, use these REST API requests.
Next stepsRetroSearch 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