Sunday, 1 February 2015


Function New-HttpVmEndpoint {
This script defines a function to add an HTTP endpoint
to an Azure VM.
This script uses the Azure module to change the VM instance size.
File Name : New-HttpVmEndpoint.ps1
Author : Thomas Lee -
Requires : PowerShell Version 3.0, Azure module
Tested : PowerShell Version 5
This script posted to:

New-HttpVmEndpoint -VmName 'psh1' -ServiceName 'psh1'

OperationDescription OperationId OperationStatus
-------------------- ----------- ---------------
Update-AzureVM 99709683-8c4b-607e-8856-5958a6967147 Succeeded

Param (
# So here, get the vm, add the endpoint, then update the VM
Get-AzureVM -ServiceName $ServiceName -Name $VmName |
Add-AzureEndpoint -Name "Http" -Protocol "tcp" -PublicPort 80 -LocalPort 80 |


# And Test It
New-HttpVmEndpoint -vm 'psh1' -servicename 'psh1'


Technorati Tags: ,,,

No comments: