You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-sql/database/authentication-azure-ad-only-authentication-create-server.md
+50-6Lines changed: 50 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.topic: how-to
8
8
author: GithubMirek
9
9
ms.author: mireks
10
10
ms.reviewer: vanto
11
-
ms.date: 08/31/2021
11
+
ms.date: 10/04/2021
12
12
---
13
13
14
14
# Create server with Azure AD-only authentication enabled in Azure SQL
@@ -28,7 +28,7 @@ This how-to guide outlines the steps to create a [logical server](logical-server
28
28
29
29
## Permissions
30
30
31
-
To provision an logical server or managed instance, you'll need to have the appropriate permissions to create these resources. Azure users with higher permissions, such as subscription [Owners](../../role-based-access-control/built-in-roles.md#owner), [Contributors](../../role-based-access-control/built-in-roles.md#contributor), [Service Administrators](../../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles), and [Co-Administrators](../../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles) have the privilege to create a SQL server or managed instance. To create these resources with the least privileged Azure RBAC role, use the [SQL Server Contributor](../../role-based-access-control/built-in-roles.md#sql-server-contributor) role for SQL Database and [SQL Managed Instance Contributor](../../role-based-access-control/built-in-roles.md#sql-managed-instance-contributor) role for Managed Instance.
31
+
To provision a logical server or managed instance, you'll need to have the appropriate permissions to create these resources. Azure users with higher permissions, such as subscription [Owners](../../role-based-access-control/built-in-roles.md#owner), [Contributors](../../role-based-access-control/built-in-roles.md#contributor), [Service Administrators](../../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles), and [Co-Administrators](../../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles) have the privilege to create a SQL server or managed instance. To create these resources with the least privileged Azure RBAC role, use the [SQL Server Contributor](../../role-based-access-control/built-in-roles.md#sql-server-contributor) role for SQL Database and [SQL Managed Instance Contributor](../../role-based-access-control/built-in-roles.md#sql-managed-instance-contributor) role for Managed Instance.
32
32
33
33
The [SQL Security Manager](../../role-based-access-control/built-in-roles.md#sql-security-manager) Azure RBAC role doesn't have enough permissions to create a server or instance with Azure AD-only authentication enabled. The [SQL Security Manager](../../role-based-access-control/built-in-roles.md#sql-security-manager) role will be required to manage the Azure AD-only authentication feature after server or instance creation.
34
34
@@ -38,13 +38,53 @@ The following section provides you with examples and scripts on how to create a
38
38
39
39
In our examples, we're enabling Azure AD-only authentication during server or managed instance creation, with a system assigned server admin and password. This will prevent server admin access when Azure AD-only authentication is enabled, and only allows the Azure AD admin to access the resource. It's optional to add parameters to the APIs to include your own server admin and password during server creation. However, the password cannot be reset until you disable Azure AD-only authentication.
40
40
41
-
To change the existing properties after server or managed instance creation, other existing APIs should be used. See [Managing Azure AD-only authentication using APIs](authentication-azure-ad-only-authentication.md#managing-azure-ad-only-authentication-using-apis) and [Configure and manage Azure AD authentication with Azure SQL](authentication-aad-configure.md) for more information.
41
+
To change the existing properties after server or managed instance creation, other existing APIs should be used. For more information, see [Managing Azure AD-only authentication using APIs](authentication-azure-ad-only-authentication.md#managing-azure-ad-only-authentication-using-apis) and [Configure and manage Azure AD authentication with Azure SQL](authentication-aad-configure.md).
42
42
43
43
> [!NOTE]
44
44
> If Azure AD-only authentication is set to false, which it is by default, a server admin and password will need to be included in all APIs during server or managed instance creation.
45
45
46
46
## Azure SQL Database
47
47
48
+
# [Portal](#tab/azure-portal)
49
+
50
+
1. Browse to the [Select SQL deployment](https://portal.azure.com/#create/Microsoft.AzureSQL) option page in the Azure portal.
51
+
52
+
1. If you aren't already signed in to Azure portal, sign in when prompted.
53
+
54
+
1. Under **SQL databases**, leave **Resource type** set to **Single database**, and select **Create**.
55
+
56
+
1. On the **Basics** tab of the **Create SQL Database** form, under **Project details**, select the desired Azure **Subscription**.
57
+
58
+
1. For **Resource group**, select **Create new**, enter a name for your resource group, and select **OK**.
59
+
60
+
1. For **Database name**, enter a name for your database.
61
+
62
+
1. For **Server**, select **Create new**, and fill out the new server form with the following values:
63
+
64
+
-**Server name**: Enter a unique server name. Server names must be globally unique for all servers in Azure, not just unique within a subscription. Enter a value, and the Azure portal will let you know if it's available or not.
65
+
-**Location**: Select a location from the dropdown list
66
+
-**Authentication method**: Select **Use only Azure Active Directory (Azure AD) authentication**.
67
+
- Select **Set admin**, which brings up a menu to select an Azure AD principal as your logical server Azure AD administrator. When you're finished, use the **Select** button to set your admin.
68
+
69
+
:::image type="content" source="media/authentication-azure-ad-only-authentication/azure-ad-portal-create-server.png" alt-text="screenshot of creating a server with Azure AD-only authentication enabled":::
70
+
71
+
1. Select **Next: Networking** at the bottom of the page.
72
+
73
+
1. On the **Networking** tab, for **Connectivity method**, select **Public endpoint**.
74
+
75
+
1. For **Firewall rules**, set **Add current client IP address** to **Yes**. Leave **Allow Azure services and resources to access this server** set to **No**.
76
+
77
+
1. Leave **Connection policy** and **Minimum TLS version** settings as their default value.
78
+
79
+
1. Select **Next: Security** at the bottom of the page. Configure any of the settings for **Azure Defender for SQL**, **Ledger**, **Identity**, and **Transparent data encryption** for your environment. You can also skip these settings.
80
+
81
+
> [!NOTE]
82
+
> Using a user-assigned managed identity (UMI) is not supported with Azure AD-only authentication. Do not set the the server identity in the **Identity** section as a UMI.
83
+
84
+
1. Select **Review + create** at the bottom of the page.
85
+
86
+
1. On the **Review + create** page, after reviewing, select **Create**.
87
+
48
88
# [The Azure CLI](#tab/azure-cli)
49
89
50
90
The Azure CLI command `az sql server create` is used to provision a new logical server. The below command will provision a new server with Azure AD-only authentication enabled.
@@ -95,7 +135,7 @@ For more information, see [New-AzSqlServer](/powershell/module/az.sql/new-azsqls
95
135
96
136
# [Rest API](#tab/rest-api)
97
137
98
-
The [Servers - Create Or Update](/rest/api/sql/2020-11-01-preview/servers/create-or-update) Rest API can be used to create an logical server with Azure AD-only authentication enabled during provisioning.
138
+
The [Servers - Create Or Update](/rest/api/sql/2020-11-01-preview/servers/create-or-update) Rest API can be used to create a logical server with Azure AD-only authentication enabled during provisioning.
99
139
100
140
The script below will provision a logical server, set the Azure AD admin as `<AzureADAccount>`, and enable Azure AD-only authentication. The server SQL Administrator login will also be created automatically and the password will be set to a random password. Since SQL Authentication connectivity is disabled with this provisioning, the SQL Administrator login won't be used.
101
141
@@ -251,6 +291,10 @@ You can also use the following template. Use a [Custom deployment in the Azure p
251
291
252
292
## Azure SQL Managed Instance
253
293
294
+
# [Portal](#tab/azure-portal)
295
+
296
+
Managing or deploying a managed instance with Azure AD-only authentication using the Azure portal is currently not supported. You can deploy a managed instance with Azure AD-only authentication using the Azure CLI, PowerShell, Rest API, or with an ARM template.
297
+
254
298
# [The Azure CLI](#tab/azure-cli)
255
299
256
300
The Azure CLI command `az sql mi create` is used to provision a new Azure SQL Managed Instance. The below command will provision a new managed instance with Azure AD-only authentication enabled.
@@ -661,12 +705,12 @@ Once the deployment is complete for your managed instance, you may notice that t
661
705
662
706
## Limitations
663
707
664
-
- Creating a server or instance using the Azure portal with Azure AD-only authentication enabled during provisioning is currently not supported.
708
+
- Creating a managed instance using the Azure portal with Azure AD-only authentication enabled during provisioning is currently not supported.
665
709
- To reset the server administrator password, Azure AD-only authentication must be disabled.
666
710
- If Azure AD-only authentication is disabled, you must create a server with a server admin and password when using all APIs.
667
711
668
712
## Next steps
669
713
670
714
- If you already have a SQL server or managed instance, and just want to enable Azure AD-only authentication, see [Tutorial: Enable Azure Active Directory only authentication with Azure SQL](authentication-azure-ad-only-authentication-tutorial.md).
671
715
- For more information on the Azure AD-only authentication feature, see [Azure AD-only authentication with Azure SQL](authentication-azure-ad-only-authentication.md).
672
-
- If you are looking to enforce server creation with Azure AD-only authentication enabled, see [Azure Policy for Azure Active Directory only authentication with Azure SQL](authentication-azure-ad-only-authentication-policy.md)
716
+
- If you're looking to enforce server creation with Azure AD-only authentication enabled, see [Azure Policy for Azure Active Directory only authentication with Azure SQL](authentication-azure-ad-only-authentication-policy.md)
0 commit comments