PowerShell: 101-vm-simple-freebsd

Very simple deployment of an FreeBSD VM


This is a conversion of ARM template 101-vm-simple-freebsd  from the repository azure\azure-quickstart-templates  to PowerShell Script.

This script allows you to deploy a simple FreeBSD VM using a few different options for the FreeBSD version, using the latest patched version. This will deploy a A1 size VM in the resource group location and return the FQDN of the VM, and it will deploy the following resources…

… and in-addition to it, just in-case if the deployment is not successful, then it will rollback the entire deployment.


If the specified resource group is already exist then the script will not continue with the deployment.


Deploy-AzResource.ps1 -ResourceGroupName <string> -Location <string> -AdminUsername <string> -DNSLabelPrefix <string> [-FreeBSDOSVersion <string>] [-SSHKey <string>] [<CommonParameters>]

Deploy-AzResource.ps1 -ResourceGroupName <string> -Location <string> -AdminUsername <string> -DNSLabelPrefix <string> -AdminPassword <securestring> [-FreeBSDOSVersion <string>] [<CommonParameters>]


I 💙 PS> $Key = Get-Content -Path ~\.ssh\id_rsa

I 💙 PS> $param = @{
>> ResourceGroupName = 'linux-rg'
>> Location = 'westus'
>> AdminUsername = 'sysadmin'
>> DNSLabelPrefix = 'linuxsdhjiu'
>> SSHKey = $Key
>> }

I 💙 PS> .\Deploy-AzResource.ps1 @param


HostName: linuxsdhjiu.westus.cloudapp.azure.com
SSH Command: ssh sysadmin@linuxsdhjiu.westus.cloudapp.azure.com
Deployment is successful!


    View the code in GitHub  
Last modified: 3 September 2020

Share it on     |   |   |   | 
comments powered by Disqus