Categories: Microsoft Azure

Add multiple endpoints or port range to an Azure Virtual Machine

&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2528 " id&equals;"quads-ad2528" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<p>If you ever needed to add multiple ports or range of ports endpoints to a particular Virtual machine on Azure&period; you might have a difficulty doing this since it’s not allowed by design and that will require time to do this manually for range of ports&period; that’s where this article comes handy&period;<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2524 " id&equals;"quads-ad2524" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2522 " id&equals;"quads-ad2522" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2527 " id&equals;"quads-ad2527" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p>To achieve this first you will need to connect to your Azure subscription on Azure powershell&period; <a href&equals;"http&colon;&sol;&sol;www&period;google&period;com&sol;url&quest;q&equals;http&percnt;3A&percnt;2F&percnt;2Fmsdn&period;microsoft&period;com&percnt;2Fen-us&percnt;2Flibrary&percnt;2Fwindowsazure&percnt;2Fjj554332&period;aspx&amp&semi;sa&equals;D&amp&semi;sntz&equals;1&amp&semi;usg&equals;AFQjCNH9f6WllUyrtDSFJuRSDbojS&lowbar;hA3g" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">Azure PowerShell<&sol;a>&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>Run Azure powershell as an administrator and type the following cmdlet to get your subscription info<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>Get-AzurePublishSettingsFile<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-mKEvmyU1SKw&sol;VaHEDytSNkI&sol;AAAAAAAAQF8&sol;AjL9aj21Ymg&sol;s1600-h&sol;clip&lowbar;image001&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;o3WBYn3Wp2X&lowbar;fkGj&lowbar;VKHTK&lowbar;FLmLAKxyWxb9QKyUzZFzOm894qgD8ASbwJ7d8yfgjkWriVK9ndA&equals;w673" alt&equals;"clip&lowbar;image001"&sol;><&sol;a> &NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2531 " id&equals;"quads-ad2531" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; &NewLine;<&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>This will open a page and ask you to sign in to your Azure user account and download a file called Visual Studio Premium with MSDN-DATE-credentials&period;publishsettings<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-&lowbar;KYc59eEGK8&sol;VaHEGYea2HI&sol;AAAAAAAAQGM&sol;N-6lFmoJkWY&sol;s1600-h&sol;clip&lowbar;image002&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh4&period;googleusercontent&period;com&sol;M7cuXkcqpMz&lowbar;Jx9ZxVzlFlEAYFL4NTn&lowbar;JePbkin9gX5OOWx1exp9g44lXedwCy1u6WnpRG6zrXpfd4iqA4rNXppI&lowbar;lGt-pWw6xr8vdCv6dyRbrQMiA&equals;w673" alt&equals;"clip&lowbar;image002"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>In the powershell you will have to navigate to where the file is located&period; And import the settings that have just been downloaded in that file<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>Import-azurepublishSettingsFile &grave;&period;&bsol;Visual Studio FileLocation&grave;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-0A9p8pMyJFg&sol;VaHEJdhyEPI&sol;AAAAAAAAQGc&sol;1INE&lowbar;&lowbar;aNpug&sol;s1600-h&sol;clip&lowbar;image003&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh6&period;googleusercontent&period;com&sol;30owz8Q2&lowbar;vGxNLZWBWNFiwk6LTFAA8lsEBqG2aAzIK2Y9CKM4GseKRw5LQohO0j&lowbar;&lowbar;HwTrcOvu-nc2botmt-5LhvjA&lowbar;eznpIjZvvifPluAdMmKauv2m0&equals;w673" alt&equals;"clip&lowbar;image003"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>You can check for your account and Subscription&comma; using Get-azureaccount script<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-&lowbar;xazNGh7qqk&sol;VaHELPRcozI&sol;AAAAAAAAQGs&sol;Nlbj3E4sZ8U&sol;s1600-h&sol;clip&lowbar;image004&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;aYRJGmN0nYb15EOJo1p9hIlihvC5p67WKsXuj7h0IDatc1WbjCLhceVpuMoW30GoO5nTvGGvRvF3DzIwAONMmOshwRiB&lowbar;N-N9byqKlxsZYtNibEk2hE&equals;w673" alt&equals;"clip&lowbar;image004"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Now I have setup a ubuntu Machine on Azure that hosts Openfire Chat server which requires 10000-10005 port range for the media service&period; On Azure Web interface the port range option is not yet supported&period; The only available option is through powershell which will open the required port range for us&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>To do so I&&num;8217&semi;ll use the following cmdlet highlighting the required information to enter<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2530 " id&equals;"quads-ad2530" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p>To create endpoints for ports 10000-10005&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>&dollar;vm &equals; Get-AzureVM -ServiceName <strong>moh10ly<&sol;strong> -Name <strong>ubunut-mohammed<&sol;strong> &semi; 10000&period;&period;10005 &vert; ForEach &lbrace; &dollar;VM &vert; Add-AzureEndpoint -Name <strong>TestEndpoint<&sol;strong>&dollar;&lowbar; -Protocol TCP -LocalPort &dollar;&lowbar; -PublicPort &dollar;&lowbar;&rcub; &semi; &dollar;vm &vert; Update-AzureVM<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>To Acquire your service name&comma; you can simply login to Azure portal and check out All Items and see the cloud service name &period;&period; Just like the below screenshot<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-woVAG&lowbar;ZuzsY&sol;VaHENFdVQyI&sol;AAAAAAAAQG8&sol;sVOWDsG-XZU&sol;s1600-h&sol;clip&lowbar;image005&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;fcGaszzrC2TWjIOOj42ylTZHMzRyU92IafVrcFtCGSxgxeje6PknPTHQJ0SSoEiQlsnoyY-WyCp-4YoVR7m-oRLUPpihgaT4y0Z-ZuMUmjxFKP1GRWbp&equals;w673" alt&equals;"clip&lowbar;image005"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>To Check your VMname simply navigate to Virtual machines tab and on the right side you can see the name&period;&period; I have copied it as well in the command&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-hIKNWnDL6ng&sol;VaHEPD&lowbar;sTZI&sol;AAAAAAAAQHM&sol;osfwXMSTQoU&sol;s1600-h&sol;clip&lowbar;image006&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh6&period;googleusercontent&period;com&sol;WPGfkZKjSUzEGMkNboBRad8S9b0-RpX-7DwayonfcqvFBF0YnwVxgPK41eP9Zg2&lowbar;1sHVsgipQSH6vKqTEfGHvLUmSEgkCTVcXF1AQnEn-MbKhz2ZXPE&equals;w673" alt&equals;"clip&lowbar;image006"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Once you edited the cmdlet with your information you can enter it in the Powershell and enter<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p>It should return something like this&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-C4HKdbfELnk&sol;VaHEQwNhWZI&sol;AAAAAAAAQHc&sol;zxYLru7nOco&sol;s1600-h&sol;clip&lowbar;image007&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;Ncr9yEi1dLU&lowbar;77Ny-2T5LnBCHH&lowbar;ktvHEODLbWnFAW6nz&lowbar;AbnDnSp2mDBCOzPIHwIG8GjW8VlARKSzwAHcBom5K8G9FzsJFzuEy4f2c0sOZv4zM5KeA&equals;w673" alt&equals;"clip&lowbar;image007"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Once finished you can check Azure end point portal for the new ports configuration<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-OpDPuu7cs3w&sol;VaHESypLieI&sol;AAAAAAAAQHs&sol;yasdE7qe51g&sol;s1600-h&sol;clip&lowbar;image008&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;ira3BtdASdDGWqFMe2hWHp2tcfZhUDZ2Z9UAKclC59Vtpuj4s7m0-KvmmCSvbIKEuJGPRnFMvnzyHnPoaUQz1qGutrA1AJ-o5yZ2k6TvoaajWmaPZ0g&equals;w673" alt&equals;"clip&lowbar;image008"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>Here we go &period;&period; Ports are created in Azure<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-image"><a href&equals;"http&colon;&sol;&sol;lh3&period;googleusercontent&period;com&sol;-ng7arttpQi4&sol;VaHEU2-docI&sol;AAAAAAAAQH8&sol;RxsH5&lowbar;fF2FE&sol;s1600-h&sol;clip&lowbar;image009&percnt;25255B3&percnt;25255D&period;png" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener"><img src&equals;"https&colon;&sol;&sol;lh5&period;googleusercontent&period;com&sol;txHe3LBgv1PiFdCGE8p-1vutdmpJAmMhQuR5FUUXKgPmhNR9GI64cfn5SLl-gYbWX70ZGRn9dGOcNRrt1uaQDQjWhSPQ7sI9RfXvhpfZ-QtxiorhTU8&equals;w673" alt&equals;"clip&lowbar;image009"&sol;><&sol;a><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p>To remove the endpoints for ports 10000-10005&colon;<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2523 " id&equals;"quads-ad2523" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;&NewLine;<p>&dollar;vm &equals; Get-AzureVM -ServiceName <strong>moh10ly<&sol;strong> -Name <strong>ubunut-mohammed<&sol;strong> &semi; 10000&period;&period;10005 &vert; ForEach &lbrace; &dollar;VM &vert; Remove-AzureEndpoint -Name <strong>TestEndpoint<&sol;strong>&dollar;&lowbar;&rcub; &semi; &dollar;vm &vert; Update-AzureVM<&sol;p>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2529 " id&equals;"quads-ad2529" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;

moh10ly

Recent Posts

Reset passwords for Active Directory Users

Reset and manage your Active Directory users' Passwords Active Directory is one of the most…

3 years ago

Finding Exchange Database hidden mailboxes. ​

Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…

3 years ago

Setting up ADConnect and PTA (Password auth through) servers agents behind proxy

If you're using a Proxy server in your firewall or in your network and have…

3 years ago

Get Report of Active Directory Locked Accounts and Machine they logged in from

Story:I got some clients  that have reported some of their users being locked out and…

3 years ago

Checking and Providing Full and SendAs delegate access on O365 Exchange Online

Delegate Permissions This is a code that I have wrote recently to check if an…

3 years ago

Retrieving attachments from Exchange mailbox using python

Story: I got a request from a client who constantly gets CVs and have to…

4 years ago

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298