Azure PowerShell (7) Batch setup of virtual machine Endpoint using CSV file

Source: Internet
Author: User

  Windows Azure Platform Family of articles Catalog

Please note:

-Azure does not support adding endpoint Range

-Maximum number of endpoint can be increased by 150

http://azure.microsoft.com/zh-cn/documentation/articles/azure-subscription-service-limits/

In the previous chapter, we described how to use Azure PowerShell to set the endpoint for a single VM.

Here we further explain how to use the CSV file to batch set VM Endpoint.

This is divided into two parts:

1. Setting the endpoint of a single virtual machine

2. Set up load balancing for multiple virtual machines endpoint

1. Setting the endpoint of a single virtual machine

Assuming that we have only one virtual machine and need to set up multiple endpoint, it can be cumbersome to use the PowerShell command for one line of input.

We can set a default value by setting a CSV file that will require an open port. Then use Azure PowerShell commands for dynamic configuration.

(1) First, we create a new virtual machine

-ServiceName to Leiazure

-VM name is LeiAzureVM001

-We need to set the LocalPort to 1596,1597 and 1598.

(2) Then, we need to prepare a CSV file template, which can be downloaded here :

  

 , the Servicename,vmname,protocol,localport equivalents are defined.

We save the CSV file in the local computer's D-Packing directory.

(3) Run Azure PowerShell as an administrator

First select the current subscription name, the command is:

Select-azuresubscription-subscriptionname <SubscriptionName>-current

Perform:

  

(4) Implementing PowerShell to import CSV

' <CSVFilePath> ' foreach {Get-azurevm-servicename $_. Servicename-name $_. VMname  

<CSVFilePath> is the path to the local CSV file. Perform:

  

(5) Return to Azure Management Portal to view the results of the execution:

  

  

2. Set up load balancing for multiple virtual machines endpoint

  (1) Suppose we have created 2 azure Virtual machines

-ServiceName to Leiazure

-Create 2 VM,VM name for LeiAzureVM001 and LeiAzureVM002

-We need to set the localport of the load balance to 1596,1597 and 1598.

-We also need to create a new load-balanced set name

(2) Then we need to prepare a CSV file template that can be downloaded here . Content

  

(3) Run Azure PowerShell as an administrator. Select the current subscription name and process slightly.

(4) Perform a PowerShell import into CSV.

' <CSVFilePath> ' foreach {Get-azurevm-servicename $_. Servicename-name $_. VMname  

Execution results, such as:

  

(5) Return to Azure Management Portal to view the results of the execution:

  

  

Azure PowerShell (7) Batch setup of virtual machine Endpoint using CSV file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.