About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_first
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation is heavily biased towards Windows and PowerShell. All command-line examples use Azure PowerShell, and the tutorial assumes the use of Windows-based tools and workflows throughout. The virtual machine created is explicitly a Windows Server VM, and the connectivity test instructions rely on Windows PowerShell and SQL Server Management Studio, both of which are Windows-centric. There are no examples or guidance for using Azure CLI, Bash, Linux VMs, or cross-platform SQL tools.
Recommendations:
- Provide equivalent Azure CLI (az) commands alongside or as an alternative to the PowerShell examples, as Azure CLI is cross-platform and widely used on Linux and macOS.
- Include instructions for creating and using a Linux-based virtual machine, with examples for both Windows and Linux VMs.
- Offer connectivity test steps using Bash (e.g., nslookup or dig) and cross-platform SQL clients such as sqlcmd or Azure Data Studio.
- Mention and demonstrate installation and use of cross-platform tools, not just Windows-specific ones like SQL Server Management Studio.
- Structure the tutorial so that Linux and Windows options are presented equally, or provide clear sections for each platform.
Create pull request
Flagged Code Snippets
It can take a few minutes for the Azure Bastion host to deploy.
## Create test virtual machine
In this section, you create a virtual machine that is used to test the private endpoint.
Create the virtual machine with:
* [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential)
* [New-AzNetworkInterface](/powershell/module/az.network/new-aznetworkinterface)
* [New-AzVM](/powershell/module/az.compute/new-azvm)
* [New-AzVMConfig](/powershell/module/az.compute/new-azvmconfig)
* [Set-AzVMOperatingSystem](/powershell/module/az.compute/set-azvmoperatingsystem)
* [Set-AzVMSourceImage](/powershell/module/az.compute/set-azvmsourceimage)
* [Add-AzVMNetworkInterface](/powershell/module/az.compute/add-azvmnetworkinterface)
## Create a virtual network and bastion host
In this section, you create a virtual network, subnet, and bastion host.
The bastion host is used to connect securely to the virtual machine for testing the private endpoint.
Create a virtual network and bastion host with:
* [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork)
* [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress)
* [New-AzBastion](/powershell/module/az.network/new-azbastion)
[!INCLUDE [ephemeral-ip-note.md](~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md)]
## Create an Azure SQL server
In this section, you create a SQL server and database using:
* [New-AzSqlServer](/powershell/module/az.sql/new-azsqlserver)
* [New-AzSQlDatabase](/powershell/module/az.sql/new-azsqldatabase)
Create SQL server and database. Replace **\<sql-server-name>** with your unique server name:
## Create private endpoint
In this section, you create the private endpoint and connection using:
* [New-AzPrivateLinkServiceConnection](/powershell/module/az.network/New-AzPrivateLinkServiceConnection)
* [New-AzPrivateEndpoint](/powershell/module/az.network/new-azprivateendpoint)
## Configure the private DNS zone
In this section you create and configure the private DNS zone using:
* [New-AzPrivateDnsZone](/powershell/module/az.privatedns/new-azprivatednszone)
* [New-AzPrivateDnsVirtualNetworkLink](/powershell/module/az.privatedns/new-azprivatednsvirtualnetworklink)
* [New-AzPrivateDnsZoneConfig](/powershell/module/az.network/new-azprivatednszoneconfig)
* [New-AzPrivateDnsZoneGroup](/powershell/module/az.network/new-azprivatednszonegroup)
## Test connectivity to private endpoint
In this section, you use the virtual machine you created in the previous step to connect to the SQL server across the private endpoint.
1. Sign in to the [Azure portal](https://portal.azure.com).
2. Select **Resource groups** in the left-hand navigation pane.
3. Select **CreateSQLEndpointTutorial-rg**.
4. Select **myVM**.
5. On the overview page for **myVM**, select **Connect** then **Bastion**.
6. Select the blue **Use Bastion** button.
7. Enter the username and password that you entered during the virtual machine creation.
8. Open Windows PowerShell on the server after you connect.
9. Enter `nslookup <sqlserver-name>.database.windows.net`. Replace **\<sqlserver-name>** with the name of the SQL server you created in the previous steps. You receive a message similar to what is displayed below: