Deploy a Virtual Machine with SSH rsa public key

Azure Public Test Date Azure Public Test Result

Azure US Gov Last Test Date Azure US Gov Last Test Result

Best Practice Check Cred Scan Check

Deploy To Azure Deploy To Azure US Gov Visualize

This template allows you to create a Linux Virtual Machine with SSH Keys. This template also deploys Virtual Network with an inbound rule allowing only port 22 connections, Public IP addresses, a Public domain namespace, and a Network Interface.

The SSH rsa public key is typically generated by ssh-keygen, among other tools, on Linux, Mac, or Windows. If you already have an ~/.ssh/id_rsa.pub file, that will work directly, as you would expect. When deployed using the Azure portal, you should paste in the contents of your ssh-rsa public key file as a string. When you deploy the template from the Azure CLI, when the parameter prompts you for the string, do not surround it in quotes, or they will be treated as part of the public key.

For more information about SSH keys, see:

If you are new to Azure virtual machines, see:

If you are new to the template deployment, see:

Azure Resource Manager documentation

Tags: Microsoft.Network/networkSecurityGroups, Microsoft.Network/publicIPAddresses, Microsoft.Network/virtualNetworks, Microsoft.Network/networkInterfaces, Microsoft.Compute/virtualMachines