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
# Customer intent: As someone with a basic network background, but is new to Azure, I want to create a private endpoint on a SQL server so that I can securely connect to it.
@@ -33,178 +33,57 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
33
33
34
34
Sign in to the [Azure portal](https://portal.azure.com).
In this section, you'll create a virtual network, subnet, and bastion host.
39
-
40
-
The bastion host will be used to connect securely to the virtual machine for testing the private endpoint.
41
-
42
-
1. On the upper-left side of the screen, select **Create a resource > Networking > Virtual network** or search for **Virtual network** in the search box.
43
-
44
-
2. In **Create virtual network**, enter or select this information in the **Basics** tab:
| AzureBastionSubnet address space | Enter **10.1.1.0/24**. |
82
-
| Public IP Address | Select **Create new**. </br> For **Name**, enter **myBastionIP**. </br> Select **OK**. |
83
-
84
-
85
-
8. Select the **Review + create** tab or select the **Review + create** button.
86
-
87
-
9. Select **Create**.
88
-
89
-
## Create a virtual machine
90
-
91
-
In this section, you'll create a virtual machine that will be used to test the private endpoint.
92
-
93
-
1. On the upper-left side of the portal, select **Create a resource** > **Compute** > **Virtual machine** or search for **Virtual machine** in the search box.
94
-
95
-
2. In **Create a virtual machine**, enter or select the values in the **Basics** tab:
| Server admin login | Enter an administrator name of your choosing. |
161
-
| Password | Enter a password of your choosing. The password must be at least eight characters long and meet the defined requirements. |
162
-
| Confirm password | Reenter password. |
163
-
164
-
1. Select **OK**.
46
+
1. In **SQL databases**, select **+ Create**.
165
47
166
-
1. In the **Basics** tab, enter or select this information after creating the SQL database server:
48
+
1. In the **Basics** tab of **Create SQL Database**, enter or select the following information:
167
49
168
50
| Setting | Value |
169
-
| ------- | ----- |
51
+
|---|---|
52
+
|**Project details**||
53
+
| Subscription | Select your subscription. |
54
+
| Resource group | Select **test-rg**. |
170
55
|**Database details**||
171
-
| Want to use SQL elastic pool? | Select **No**. |
172
-
| Compute + Storage | Take default settings or select **Configure database** to configure compute and storage settings. |
56
+
| Database name | Enter **sql-db**. |
57
+
| Server | Select **Create new**. </br> Enter **sql-server-1** in **Server name** (Server names must be unique, replace **sql-server-1** with a unique value). </br> Select **(US) East US 2** in **Location**. </br> Select **Use SQL authentication**. </br> Enter a server admin sign-in and password. </br> Select **OK**. |
58
+
| Want to use SQL elastic pool? | Select **No**. |
59
+
| Workload environment | Leave the default of **Production**. |
:::image type="content" source="./media/tutorial-private-endpoint-sql-portal/create-sql-database-basics-tab-inline.png" alt-text="Screenshot of Create S Q L Database page showing the settings used." lightbox="./media/tutorial-private-endpoint-sql-portal/create-sql-database-basics-tab-expanded.png":::
1. Select **+ Add private endpoint** in **Private endpoints**.
188
-
189
-
1. In **Create private endpoint**, enter or select this information:
190
-
191
-
| Setting | Value |
192
-
| ------- | ----- |
71
+
|**Private endpoints**||
72
+
| Select **+Add private endpoint**. ||
73
+
|**Create private endpoint**||
193
74
| Subscription | Select your subscription. |
194
-
| Resource group | Select **CreateSQLEndpointTutorial**. |
195
-
| Location | Select **East US**. |
196
-
| Name | Enter **myPrivateSQLendpoint**. |
197
-
| Target sub-resource| Select **SqlServer**. |
75
+
| Resource group | Select **test-rg**. |
76
+
| Location | Select **East US 2**. |
77
+
| Name | Enter **private-endpoint-sql**. |
78
+
| Target subresource| Select **SqlServer**. |
198
79
|**Networking**||
199
-
| Virtual network | Select **myVNet**. |
200
-
| Subnet | Select **mySubnet**. |
201
-
|**Private DNS integration**||
202
-
| Integrate with private DNS zone | Leave the default **Yes**. |
203
-
| Private DNS Zone | Leave the default **(New) privatelink.database.windows.net**. |
204
-
205
-
1. Select **OK**.
80
+
| Virtual network | Select **vnet-1**. |
81
+
| Subnet | Select **subnet-1**. |
82
+
|**Private DNS integration**||
83
+
| Integrate with private DNS zone | Select **Yes**. |
84
+
| Private DNS zone | Leave the default of **privatelink.database.windows.net**. |
206
85
207
-
:::image type="content" source="./media/tutorial-private-endpoint-sql-portal/create-private-endpoint-sql-inline.png" alt-text="Screenshot of Create private endpoint page showing the settings used." lightbox="./media/tutorial-private-endpoint-sql-portal/create-private-endpoint-sql-expanded.png":::
86
+
1. Select **OK**.
208
87
209
88
1. Select **Review + create**.
210
89
@@ -214,78 +93,76 @@ In this section, you'll create a SQL server in Azure.
214
93
> When adding a Private endpoint connection, public routing to your Azure SQL server is not blocked by default. The setting "Deny public network access" under the "Firewall and virtual networks" blade is left unchecked by default. To disable public network access ensure this is checked.
215
94
216
95
## Disable public access to Azure SQL logical server
96
+
217
97
For this scenario, assume you would like to disable all public access to your Azure SQL server, and only allow connections from your virtual network.
218
98
219
-
1. In the Azure portal search box, enter **mysqlserver** or the server name you entered in the previous steps.
220
-
2. On the **Networking** page, select **Public access** tab, then select **Disable** for **Public network access**.
99
+
1. In the search box at the top of the portal, enter **SQL server**. Select **SQL servers** in the search results.
221
100
222
-
:::image type="content" source="./media/tutorial-private-endpoint-sql-portal/disable-sql-server-public-access-inline.png" alt-text="Screenshot of the S Q L server Networking page showing how to disable public access." lightbox="./media/tutorial-private-endpoint-sql-portal/disable-sql-server-public-access-expanded.png":::
101
+
1. Select **sql-server-1**.
102
+
103
+
1. On the **Networking** page, select **Public access** tab, then select **Disable** for **Public network access**.
223
104
224
-
3. Select **Save**.
105
+
1. Select **Save**.
225
106
226
107
## Test connectivity to private endpoint
227
108
228
-
In this section, you'll use the virtual machine you created in the previous steps to connect to the SQL server across the private endpoint.
109
+
In this section, you use the virtual machine you created in the previous steps to connect to the SQL server across the private endpoint.
229
110
230
-
1. Select **Resource groups** in the left-hand navigation pane.
111
+
1.In the search box at the top of the portal, enter **Virtual machine**. Select **Virtual machines** in the search results.
231
112
232
-
2. Select **CreateSQLEndpointTutorial**.
113
+
1. Select **vm-1**.
233
114
234
-
3. Select**myVM**.
115
+
1. In**Operations** select **Bastion**.
235
116
236
-
4. On the overview page for **myVM**, select **Connect** then **Bastion**.
117
+
1. Enter the username and password for the virtual machine.
237
118
238
-
5. Enter the username and password that you entered during the virtual machine creation.
119
+
1. Select **Connect**.
239
120
240
-
6. Select **Connect** button.
121
+
1. To verify name resolution of the private endpoint, enter the following command in the terminal window:
241
122
242
-
7. Open Windows PowerShell on the server after you connect.
123
+
```bash
124
+
nslookup sql-server-1.database.windows.net
125
+
```
243
126
244
-
8. Enter `nslookup <sqlserver-name>.database.windows.net`. Replace **\<sqlserver-name>** with the name of the SQL server you created in the previous steps. You'll receive a message similar to what is displayed below:
127
+
You receive a message similar to the following example. The IP address returned is the private IP address of the private endpoint.
A private IP address of **10.1.0.5** is returned for the SQL server name. This address is in **mySubnet** subnet of **myVNet** virtual network you created previously.
256
138
257
-
9. Install [SQL Server Management Studio](/sql/ssms/download-sql-server-management-studio-ssms?preserve-view=true&view=sql-server-2017) on **myVM**.
139
+
1. Install the SQL server command line tools from [Install the SQL Server command-line tools sqlcmd and bcp on Linux](/sql/linux/sql-server-linux-setup-tools). Proceed with the next steps after the installation is complete.
258
140
259
-
10. Open **SQL Server Management Studio**.
141
+
1. Use the following commands to connect to the SQL server you created in the previous steps.
260
142
261
-
4. In **Connect to server**, enter or select this information:
143
+
* Replace **\<server-admin>** with the admin username you entered during the SQL server creation.
262
144
263
-
| Setting | Value |
264
-
| ------- | ----- |
265
-
| Server type | Select **Database Engine**.|
266
-
| Server name | Enter **\<sqlserver-name>.database.windows.net**. |
267
-
| Authentication | Select **SQL Server Authentication**. |
268
-
| User name | Enter the username you entered during server creation. |
269
-
| Password | Enter the password you entered during server creation. |
270
-
| Remember password | Select **Yes**. |
145
+
* Replace **\<admin-password>** with the admin password you entered during SQL server creation.
271
146
272
-
1. Select **Connect**.
273
-
2. Browse databases from left menu.
274
-
3. (Optionally) Create or query information from **mysqldatabase**.
275
-
4. Close the remote desktop connection to **myVM**.
147
+
* Replace **sql-server-1** with the name of your SQL server.
1. A SQL command prompt is displayed on successful sign in. Enter **exit** to exit the **sqlcmd** tool.
276
154
277
-
## Clean up resources
278
-
When you're done using the private endpoint, SQL server, and the VM, delete the resource group and all of the resources it contains:
279
-
1. Enter **CreateSQLEndpointTutorial** in the **Search** box at the top of the portal and select **CreateSQLEndpointTutorial** from the search results.
280
-
2. Select **Delete resource group**.
281
-
3. Enter *CreateSQLEndpointTutorial* for **TYPE THE RESOURCE GROUP NAME** and select **Delete**.
0 commit comments