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
This how-to guide outlines the steps to create a [logical server](logical-servers.md) for Azure SQL Database with a [user-assigned managed identity](/azure/active-directory/managed-identities-azure-resources/overview#managed-identity-types). For more information on the benefits of using a user-assigned managed identity for the server identity in Azure SQL Database, see [User-assigned managed identity in Azure AD for Azure SQL](authentication-azure-ad-user-assigned-managed-identity.md).
19
23
20
24
To retrieve the system-assigned managed identity (SMI) or user-assigned managed identity or identities (UMI) of an Azure SQL Database, see [Get or set a managed identity for a logical server or managed instance](authentication-azure-ad-user-assigned-managed-identity.md#get-or-set-a-managed-identity-for-a-logical-server-or-managed-instance).
21
25
22
-
> [!NOTE]
23
-
> If you're looking for a guide on Azure SQL Managed Instance, see [Create an Azure SQL Managed Instance with a user-assigned managed identity](../managed-instance/authentication-azure-ad-user-assigned-managed-identity-create-managed-instance.md).
Copy file name to clipboardExpand all lines: azure-sql/managed-instance/authentication-azure-ad-user-assigned-managed-identity-create-managed-instance.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
x---
1
+
---
2
2
title: Create an Azure SQL Managed Instance using a user-assigned managed identity
3
3
titleSuffix: Azure SQL Managed Instance
4
4
description: This article guides you through creating an Azure SQL Managed Instance using a user-assigned managed identity
@@ -8,15 +8,16 @@ ms.reviewer: vanto
8
8
ms.date: 06/30/2022
9
9
ms.service: sql-managed-instance
10
10
ms.subservice: security
11
-
ms.topic: conceptual
11
+
ms.topic: how-to
12
12
---
13
13
14
14
# Create an Azure SQL Managed Instance with a user-assigned managed identity
> If you are looking for a guide on Azure SQL Database, see [Create an Azure SQL logical server using a user-assigned managed identity](../database/authentication-azure-ad-user-assigned-managed-identity-create-server.md)
This how-to guide outlines the steps to create an [Azure SQL Managed Instance](sql-managed-instance-paas-overview.md) with a [user-assigned managed identity](/azure/active-directory/managed-identities-azure-resources/overview#managed-identity-types). For more information on the benefits of using a user-assigned managed identity for the server identity in Azure SQL Database, see [User-assigned managed identity in Azure AD for Azure SQL](../database/authentication-azure-ad-user-assigned-managed-identity.md).
Today you have multiple choices when deciding how and where you host your application.
19
+
This article describes how to connect your application to Azure SQL Managed Instance in a number of different application scenarios inside or between Azure virtual networks.
20
20
21
-
You may choose to host an application in the cloud by using Azure App Service or some of Azure's virtual network integrated options, like Azure App Service Environment, Azure Virtual Machines, and Virtual Machine Scale Sets. You could also take the hybrid ("mixed") cloud approach and keep your applications on-premises.
22
-
23
-
Whatever choice you make, your application can connect to Azure SQL Managed Instance. This article describes how to do so in a number of different application scenarios inside or between Azure virtual networks.
21
+
Today you have multiple choices when deciding how and where you host your application. You may choose to host an application in the cloud by using Azure App Service or some of Azure's virtual network integrated options, like Azure App Service Environment, Azure Virtual Machines, and Virtual Machine Scale Sets. You could also take the hybrid ("mixed") cloud approach and keep your applications on-premises. Whatever choice you make, your application can connect to Azure SQL Managed Instance in a number of different application scenarios inside or between Azure virtual networks.
24
22
25
23
You can also enable data access to your managed instance from outside a virtual network – for example, from multi-tenant Azure services like Power BI and Azure App Service, or from an on-premises network not connected to your virtual networks via VPN. To accomplish these and similar scenarios, please refer to [Configure public endpoint in Azure SQL Managed Instance](./public-endpoint-configure.md).
26
24
@@ -40,32 +38,39 @@ There are three options to connect to a SQL Managed Instance in a different virt
Of the three, private endpoints are the most secure and resource-economical option because they expose only the SQL Managed Instance from its virtual network, allow for one-way connectivity only, and require just one IP address in the application's virtual network. If private endpoints can't fully meet the requirements of your scenario, consider virtual network peering. Peering uses Azure backbone network, so there is no noticeable latency penalty for communication across virtual network boundaries. Virtual network peering is supported between networks across all regions (global virtual network peering), while [instances hosted in subnets created before September 22, 2020](frequently-asked-questions-faq.yml#does-sql-managed-instance-support-global-vnet-peering) only support peering within their region.
41
+
Of the three, private endpoints are the most secure and resource-economical option because they:
42
+
- only expose the SQL Managed Instance from its virtual network
43
+
- only allow one-way connectivity only
44
+
- require just one IP address in the application's virtual network.
45
+
46
+
If private endpoints can't fully meet the requirements of your scenario, consider virtual network peering instead. Peering uses the backbone Azure network, so there's no noticeable latency penalty for communication across virtual network boundaries. Virtual network peering is supported between networks across all regions (global virtual network peering), while [instances hosted in subnets created before September 22, 2020](frequently-asked-questions-faq.yml#does-sql-managed-instance-support-global-vnet-peering) only support peering within their region.
44
47
45
48
## Connect from on-premises
46
49
47
-
You can connect your on-premises application to the [VNet-local endpoint](connectivity-architecture-overview.md#vnet-local-endpoint) of your SQL Managed Instance. In order to access it from on-premises, you need to make a site-to-site connection between the application and the SQL Managed Instance virtual network. If data-only access to your managed instance is sufiicient, you can connect to it from outside a virtual network via a public endpoint; see [Configure public endpoint in Azure SQL Managed Instance](./public-endpoint-configure.md).
50
+
You can connect your on-premises application to the [VNet-local endpoint](connectivity-architecture-overview.md#vnet-local-endpoint) of your SQL Managed Instance. In order to access it from on-premises, you need to make a site-to-site connection between the application and the SQL Managed Instance virtual network. If data-only access to your managed instance is sufficient, you can connect to it from outside a virtual network via a public endpoint - review [Configure public endpoint in Azure SQL Managed Instance](./public-endpoint-configure.md) to learn more.
48
51
49
-
There are two options for how to connect an on-premises application to an Azure virtual network:
52
+
There are two options to connect an on-premises application to an Azure virtual network:
If you've established an on-premises to Azure connection successfully and you can't establish a connection to SQL Managed Instance, check if your firewall has an open outbound connection on SQL port 1433 as well as the 11000-11999 range of ports for redirection.
57
+
If you've established an on-premises connection to Azure connection and you can't establish a connection to SQL Managed Instance, check if your firewall has an open outbound connection on SQL port 1433 as well as the 11000-11999 range of ports for redirection.
55
58
56
59
## Connect a developer box
57
60
58
-
It is also possible to connect your developer box to SQL Managed Instance. In order to access it from your developer box via virtual network, you first need to make a connection between your developer box and the SQL Managed Instance virtual network. To do so, configure a point-to-site connection to a virtual network using native Azure certificate authentication. For more information, see [Configure a point-to-site connection to connect to Azure SQL Managed Instance from an on-premises computer](point-to-site-p2s-configure.md).
61
+
It's also possible to connect your developer box to SQL Managed Instance. In order to access it from your developer box via the virtual network, you first need to make a connection between your developer box and the SQL Managed Instance virtual network. To do so, configure a point-to-site connection to a virtual network using native Azure certificate authentication. For more information, see [Configure a point-to-site connection to connect to Azure SQL Managed Instance from an on-premises computer](point-to-site-p2s-configure.md).
59
62
60
63
For data access to your managed instance from outside a virtual network see [Configure public endpoint in Azure SQL Managed Instance](./public-endpoint-configure.md).
61
64
62
65
## Connect to a spoke network
63
66
64
-
Another common scenario is where a VPN gateway is installed in a separate virtual network (and perhaps subscription) - _spoke network_ - from the one hosting SQL Managed Instance (_hub network_). Connectivity to SQL Managed Instance from the spoke network is configured via one of the options listed in [Connect from inside a different VNet](#connect-from-inside-a-different-vnet): private endpoints, VNet peering, or a VNet-to-VNet gateway. The following sample architecture diagram shows how this can be implemented.
67
+
Another common scenario is where a VPN gateway is installed in a separate virtual network (and perhaps subscription) - _spoke network_ - from the one hosting SQL Managed Instance (_hub network_). Connectivity to SQL Managed Instance from the spoke network is configured via one of the options listed in [Connect from inside a different VNet](#connect-from-inside-a-different-vnet): private endpoints, VNet peering, or a VNet-to-VNet gateway.
68
+
69
+
The following sample architecture diagram shows VNet peering:
Note that if you are peering hub and spoke networks, you'll also need to ensure that the VPN gateway sees the IP addresses from the hub network. To do so, make the following changes under the**Peering settings**:
73
+
If you are peering hub and spoke networks, ensure the VPN gateway sees the IP addresses from the hub network. To do so, make the following changes under **Peering settings**:
69
74
70
75
1. In the virtual network that hosts the VPN gateway (spoke network), go to **Peerings**, go to the peered virtual network connection for SQL Managed Instance, and select **Allow Gateway Transit**.
71
76
2. In the virtual network that hosts SQL Managed Instance (hub network), go to **Peerings**, go to the peered virtual network connection for the VPN gateway, and select **Use remote gateways**.
@@ -74,35 +79,35 @@ Note that if you are peering hub and spoke networks, you'll also need to ensure
74
79
75
80
You can also connect an application hosted by Azure App Service when it is [integrated with your virtual network](/azure/app-service/overview-vnet-integration.md). To do so, select one of the mechanisms listed in [Connect from inside a different VNet](#connect-from-inside-a-different-vnet). For data access to your managed instance from outside a virtual network, see [Configure public endpoint in Azure SQL Managed Instance](./public-endpoint-configure.md).
76
81
77
-
A special case of connecting Azure App Service to SQL Managed Instance is when you integrate Azure App Service to a network peered to a SQL Managed Instance virtual network. That case requires the following configuration to be set up:
82
+
A special case for connecting Azure App Service to SQL Managed Instance is when you integrate Azure App Service to a network peered to a SQL Managed Instance virtual network. That case requires the following configuration to be set up:
78
83
79
84
- SQL Managed Instance virtual network must NOT have a gateway
80
85
- SQL Managed Instance virtual network must have the `Use remote gateways` option set
81
86
- Peered virtual network must have the `Allow gateway transit` option set
82
87
83
88
This scenario is illustrated in the following diagram:

86
91
87
-
>[!NOTE]
88
-
>The virtual network integration feature does not integrate an app with a virtual network that has an ExpressRoute gateway. Even if the ExpressRoute gateway is configured in coexistence mode, virtual network integration does not work. If you need to access resources through an ExpressRoute connection, then you can use App Service Environment, which runs in your virtual network.
92
+
>[!NOTE]
93
+
>The virtual network integration feature does not integrate an app with a virtual network that has an ExpressRoute gateway. Even if the ExpressRoute gateway is configured in coexistence mode, virtual network integration does not work. If you need to access resources through an ExpressRoute connection, then you can use App Service Environment, which runs in your virtual network.
89
94
90
-
For troubleshooting Azure App Service access via virtual network, see[Troubleshooting virtual networks and applications](/azure/app-service/overview-vnet-integration#troubleshooting).
95
+
To troubleshoot Azure App Service access via virtual network, review[Troubleshooting virtual networks and applications](/azure/app-service/overview-vnet-integration#troubleshooting).
91
96
92
-
## Troubleshooting connectivity issues
97
+
## Troubleshoot connectivity issues
93
98
94
-
For troubleshooting connectivity issues, review the following:
99
+
To troubleshoot connectivity issues, review the following:
95
100
96
-
- If you are unable to connect to SQL Managed Instance from an Azure virtual machine within the same virtual network but a different subnet, check if you have a Network Security Group set on VM subnet that might be blocking access. Additionally, open outbound connection on SQL port 1433 as well as ports in the range 11000-11999, since those are needed for connecting via redirection inside the Azure boundary.
101
+
- If you are unable to connect to SQL Managed Instance from an Azure virtual machine within the same virtual network but a different subnet, check if you have a Network Security Group set up on VM subnet that might be blocking access. Additionally, open outbound connection on SQL port 1433 as well as ports in the range 11000-11999, since those are needed to connect via redirection inside the Azure boundary.
97
102
- Ensure that BGP Propagation is set to **Enabled** for the route table associated with the virtual network.
98
103
- If using point-to-site VPN, check the configuration in the Azure portal to see if you see **Ingress/Egress** numbers. Non-zero numbers indicate that Azure is routing traffic to/from on-premises.

101
106
102
107
- Check that the client machine (that is running the VPN client) has route entries for all the virtual networks that you need to access. The routes are stored in

106
111
107
112
As shown in this image, there are two entries for each virtual network involved and a third entry for the VPN endpoint that is configured in the portal.
0 commit comments