This is something you would typically do with PowerShell. Here's an example that reads the endpoints from a CSV file and adds it to a VM:
$endpoints = Import-Csv $csvFile -header Name,Protocol,PublicPort,LocalPort -delimiter ';' | foreach {
New-Object PSObject -prop @{
Name = $_.Name;
Protocol = $_.Protocol;
PublicPort = [int32]$_.PublicPort;
LocalPort = [int32]$_.LocalPort;
}
}
# Add each endpoint.
Foreach ($endpoint in $endpoints)
{
Add-AzureEndpoint -VM $vm -Name $endpoint.Name -Protocol $endpoint.Protocol.ToLower() -PublicPort $endpoint.PublicPort -LocalPort $endpoint.LocalPort
}
More information is available here: http://fabriccontroller.net/blog/posts/adding-multiple-endpoints-to-your-windows-azure-virtual-machines-by-using-a-csv-file/