We have a number of Virtual Machines hosted in Azure that are used for development or testing purposes. Since we don’t need them online 24/7, we have some of them scheduled to turn on during office hours. Other we manually control when we need that particular configuration.
This Virtual Machines have dynamic IP Addresses, so we don’t know where to connect to once the VM has been turned on.
Rather than having to open up the Azure portal I have a powershell script for each machine that will find out the current public IP Address and then open up RDP to connect to it.
Login-AzureRmAccount $resourceGroup = "Your-resourceGroup" $vmName = "your-vm-name" $nicName ="vm-name-nic" Get-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName $vmpublicip = Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -Name $nicName $publicIp = $vmpublicip.IpAddress mstsc /v:"$publicIp"
I'm a .NET Software Engineer that is currently working at SafeToNet. Opinions are my own.
Nant (1) Load testing (1) Visual studio (1) Azure (24) Aws (1) Asp.net (1) Tfs (1) Puppetlabs reports (2) Devops (2) Iis (1) Powershell (6) Arm templates (2) Arm template (1) Azure (5) Powershell (1) Dsc (1) Arm (1) Jekyll (1) Vsts (1)