<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Ninad Kanthi's WebLog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ninadk/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ninadk/feed.xml</link>
    <description>Cloud Ramblings</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:50:03 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Stack available for everyone!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/azure-stack-available-for-everyone</link>
      <pubDate>Tue, 19 Sep 2017 12:58:39 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/?p=126</guid>
      <description><![CDATA[Can't wait to drive this technology with our customers and partners ......]]></description>
      <content:encoded><![CDATA[Can't wait to drive this technology with our customers and partners ... <a href="https://news.microsoft.com/en-gb/2017/07/14/microsoft-releases-azure-stack-everyone-can-enjoy-benefits-cloud/?wt.mc_id=AID640463_QSG_EML_177222_5236054_7349746">https://news.microsoft.com/en-gb/2017/07/14/microsoft-releases-azure-stack-everyone-can-enjoy-benefits-cloud/?wt.mc_id=AID640463_QSG_EML_177222_5236054_7349746</a>

<strong><a target="_blank" href="https://news.microsoft.com/en-gb/#sm.0000y8sy4w1hudd6xr922w6wu2uzn" rel="noopener noreferrer">Microsoft</a></strong> has expanded its cloud service by letting companies enjoy all the benefits of <strong><a target="_blank" href="https://azure.microsoft.com/en-gb/" rel="noopener noreferrer">Azure</a></strong> within their own data centres.

<strong><a target="_blank" href="https://azure.microsoft.com/en-us/overview/azure-stack/" rel="noopener noreferrer">Azure Stack</a></strong> has been rolled out across the world, and allows developers to create and run applications on their own servers but use all the Azure tools that cloud-only professionals enjoy.

The service will appeal to companies that have a so-called hybrid model – using servers on their own premises as well as Microsoft’s cloud]]></content:encoded>
    </item>
    <item>
      <title>Public preview of Azure Advisor</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/public-preview-of-azure-advisor</link>
      <pubDate>Thu, 24 Nov 2016 15:15:35 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/?p=115</guid>
      <description><![CDATA[A personalized recommendation engine that provides proactive best practices guidance for optimally...]]></description>
      <content:encoded><![CDATA[A personalized recommendation engine that provides proactive best practices guidance for optimally configuring your Azure resources.  While it’s easy to start building applications on Azure, making sure that the underlying Azure resources are setup correctly and being used optimally can be a challenging task. Details <a href="https://azure.microsoft.com/en-us/blog/announcing-public-preview-azure-advisor/">here</a>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft adds Azure data centres in UK</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/microsoft-adds-azure-data-centres-in-uk</link>
      <pubDate>Wed, 07 Sep 2016 08:12:37 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/?p=108</guid>
      <description><![CDATA[The Microsoft Cloud in the UK opens today with Azure and Office 365 now generally available from...]]></description>
      <content:encoded><![CDATA[<div class="pw-hidden-cp">The <strong><a target="_blank" href="https://www.microsoft.com/en-us/enterprise/microsoftcloud/default.aspx">Microsoft Cloud</a></strong> in the UK opens today with Azure and Office 365 now generally available from multiple data centre locations in the UK. This cloud empowers the digital transformation of businesses and public sector organisations, helping them increase productivity while meeting compliance and policy requirements. <strong><a target="_blank" href="https://www.microsoft.com/en-gb/dynamics/crm.aspx">Dynamics CRM Online</a></strong> will join the line-up in the first half of 2017.<span>
Read more at https://news.microsoft.com/en-gb/2016/09/06/not-publish-microsoft-becomes-first-company-open-data-centres-uk/#czQkrhRgHCYk5e6F.99</span></div>]]></content:encoded>
    </item>
    <item>
      <title>Adafruit Feather with to the Microsoft Azure IoT Hub</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/adafruit-feather-with-to-the-microsoft-azure-iot-hub</link>
      <pubDate>Thu, 02 Jun 2016 10:40:53 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/?p=105</guid>
      <description><![CDATA[If you are the lucky owner of the Microsoft Azure IoT Starter Kits containing Adafruit Feather, I've...]]></description>
      <content:encoded><![CDATA[If you are the lucky owner of the Microsoft Azure IoT Starter Kits containing Adafruit Feather, I've created a step-by-step guide for you to integrate with Azure. The aim of this <a href="https://github.com/ninadkanthi/Adafruit_IoTSuite_Integration">mini project</a> is for the Adafruit Feather to communicate with to the Microsoft Azure IoT Hub. Adafruit Feather should be able to send telemetry messages and also respond to commands sent to it by the IoT hub. Enjoy. and don't forget to provide feedback.

GitHub Link: https://github.com/ninadkanthi/Adafruit_IoTSuite_Integration]]></content:encoded>
    </item>
    <item>
      <title>Time Lapse Video using Raspberry Pi and Windows Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/time-lapse-video-using-raspberry-pi-and-windows-azure</link>
      <pubDate>Wed, 11 May 2016 20:14:31 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/?p=65</guid>
      <description><![CDATA[Hello,

Recently had some spare bandwidth and a Raspberry Pi device to play with.

Great. :-)...]]></description>
      <content:encoded><![CDATA[Hello,

Recently had some spare bandwidth and a Raspberry Pi device to play with.

Great. :-) .

Embarked on a project to create time-lapsed videos in conjunction with the Raspberry Pi camera module.  Project takes snapshots every seconds, per day and uploads the photographs to Microsoft Azure at the end of every hour. At the end of day, all the uploaded photographs are consolidated into a movie file and stored on Azure storage. The complete end-to-end project has been uploaded on GitHub and can be accessed from <a title="Git-Hub timelapse video using Raspberry Pi and Microsoft Azure" href="https://github.com/ninadkanthi/Timelapse-Video">here</a>. Happy to hear back]]></content:encoded>
    </item>
    <item>
      <title>We are Hiring .....</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/we-are-hiring</link>
      <pubDate>Fri, 12 Feb 2016 01:34:00 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/2016/02/12/we-are-hiring/</guid>
      <description><![CDATA[Interested in joining a team which is undertaking fun-filled cloud journey within Microsoft. Here is...]]></description>
      <content:encoded><![CDATA[Interested in joining a team which is undertaking fun-filled cloud journey within Microsoft. Here is your opportunity ...

<a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=3&amp;jid=216298&amp;jlang=EN&amp;pp=SS">Architect - Gurgoan</a>

<a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=2&amp;jid=216523&amp;jlang=EN&amp;pp=SS"> Architect - Mumbai </a>

<a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=1&amp;jid=217216&amp;jlang=EN&amp;pp=SS"> Architect - India </a>

<a href="https://careers.microsoft.com/jobdetails.aspx?ss=&amp;pg=0&amp;so=&amp;rw=1&amp;jid=217328&amp;jlang=EN&amp;pp=SS"> Architect - India </a>

[Update 2nd June 2016] Thanks for all your responses. We now have the super team that we were searching for and the head count search is now paused.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Azure RateCard API and Excel Integration</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/azure-ratecard-api-and-excel-integration</link>
      <pubDate>Wed, 18 Nov 2015 15:29:00 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/2015/11/18/azure-ratecard-api-and-excel-integration/</guid>
      <description><![CDATA[Simple challenge  We have been tasked to find out the monthly consumption cost of Azure services...]]></description>
      <content:encoded><![CDATA[<hr />  <h1>Simple challenge</h1>  <p align="justify"><font size="2">We have been tasked to find out the monthly consumption cost of Azure services that we would be consuming as part of our solution. Although our production example had approximately a dozen services in it, to keep this example simple, in this blog we’ll be looking at only a couple of azure services. These are</font></p>  <ul>   <li>     <div align="justify"><font size="2"><b>2</b> instances of Standard_D1 Cloud services </font></div>   </li>    <li>     <div align="justify"><font size="2"><b>800</b> GB of Geo Redundant storage, Standard IO – Page Blob/Disk </font></div>   </li> </ul>  <p align="justify"><font size="2">Everything in financial calculations start and end in Excel. But before we transfer these Azure service components into an Excel spreadsheet, we need to finalise some additional information. Azure service prices are dependent on the geo and regions from where they are consumed and also on the currency they are transacted in. For our calculations, we’ve assumed the following</font></p>  <ul>   <li>     <div align="justify"><font size="2">Cloud Services will be instantiated from the ‘US East’ region </font></div>   </li>    <li>     <div align="justify"><font size="2">Storage will also be in the same region, which in Azure terms gets classified as ‘Zone 1’ </font></div>   </li>    <li>     <div align="justify"><font size="2">The currency of transaction will be USD – ‘$’. </font></div>   </li> </ul>  <h2 align="justify">Plan</h2>  <p align="justify"><font size="2">We will use Microsoft Excel for our calculation. This file will have two worksheets ‘<b>Azure Rate Card</b>’ and ‘<b>Bill of Material</b>’. We will copy the Azure RateCard information into the <b>Azure Rate Card</b> worksheet and the computation for monthly consumption will be carried out in the ‘<b>Bill of Material</b>’ tab. </font></p>  <h2 align="justify">Accessing and Downloading Azure RateCard data</h2>  <p align="justify"><font size="2">We will use Azure PowerShell script to download the Azure RateCard data applicable to our azure subscription. </font></p>  <p align="justify"><font size="2">What is Azure RateCard API? <strong>Azure RateCard API is part of Azure Billing API service, which also includes Usage API. The RateCard API returns the list of the resources available at an Azure offer level (Pay-as-you-go, MSDN,…) and this is not specific to a customer’s subscription, so what you would get back here is the list of ALL the resources that are available for billing under an offer.&#160; More information on Azure RateCard API is available here and here. </strong></font></p>  <h3 align="justify">Step 1. Configuring Authentication using the Management Portal </h3>  <p align="justify"><font size="2">In order for our PowerShell client application to access the billing API data, the Azure subscription needs to be configured to allow access to this API from client applications. The process of doing this is clearly and succinctly described </font><a href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx"><font size="2">here</font></a><font size="2"> – you’ll need to execute only the Steps 1 and Step 2 . Whilst creating the application, ensure that you specify </font><a href="https://localhost/"><font size="2">https://localhost/</font></a><font size="2"> as the re-direct URI. You will need to substitute the in the PowerShell script. Once the application has been created, make a note of the Client-ID – the GUID number – that is assigned to the application that you added. This GUID will be used in the PowerShell script. </font></p>  <p align="justify"><font size="2">Whilst you are logged onto the Azure management portal, make a note of the following items</font></p>  <ul>   <li>     <div align="justify"><font size="2">Subscription ID and Azure Offer-ID. Navigate to ‘- </font><a href="https://account.windowsazure.com/Subscriptions"><font size="2">https://account.windowsazure.com/Subscriptions</font></a><font size="2">’ and select the subscription under which the client access configuration was added. Make a note of subscription ID and offer-ID values. </font></div>   </li>    <li>     <div align="justify"><font size="2">The primary tenant that you are authenticated against in Azure. This is the primary directory that you login to and in the old portal (manage.windowsazure.com), can be found under <b>Settings </b><b>à Subscriptions </b>à Make a note of the Directory record next to your subscription ID </font></div>   </li> </ul>  <h3 align="justify">Step 2. Load and configure the PowerShell script</h3>  <p align="justify"><font size="2">The complete PowerShell script is coped </font><a href="#PowerShellScript"><font size="2">here</font></a><font size="2">. Substitute the following values in the script from the previous step</font></p>  <table cellspacing="0" cellpadding="0" border="1"><tbody>     <tr>       <td valign="top" width="164">         <p><b><font size="2">Shell Script Variable name</font></b></p>       </td>        <td valign="top" width="246">         <p><b><font size="2">Format &amp; example – your values would be different. </font></b></p>       </td>     </tr>      <tr>       <td valign="top" width="164">         <p><font size="2"><b>$adTenant</b><b></b></font></p>          <p><b><font size="2"></font></b></p>       </td>        <td valign="top" width="246">         <p><font size="2">$adTenant = &quot;microsoft.onmicrosoft.com&quot; </font></p>       </td>     </tr>      <tr>       <td valign="top" width="164">         <p><font size="2"><b>$clientId</b><b></b></font></p>       </td>        <td valign="top" width="246">         <p><font size="2">$clientId = &quot;XXXXXXXX-XXXX-4d50-937a-96e123b13015&quot;</font></p>       </td>     </tr>      <tr>       <td valign="top" width="164">         <p><font size="2"><b>$redirectUri</b><b></b></font></p>       </td>        <td valign="top" width="246">         <p><font size="2">$redirectUri = New-Object System.Uri('https://localhost/') </font></p>       </td>     </tr>      <tr>       <td valign="top" width="164">         <p><font size="2"><b>$SubscriptionId</b><b></b></font></p>       </td>        <td valign="top" width="246">         <p><font size="2">$SubscriptionId = 'XXXXXXXX-XXXX-4802-a5e6-d9c5a43c72a0' </font></p>       </td>     </tr>      <tr>       <td valign="top" width="164">         <p><font size="2"><b>$OfferDurableId</b><b></b></font></p>       </td>        <td valign="top" width="246">         <p><font size="2">$OfferDurableId = 'MS-AZR-0121p'</font></p>       </td>     </tr>   </tbody></table>  <h4><font size="2" face="Segoe UI">&#160;</font></h4>  <h3 align="justify">Step 3. Execute the PowerShell script.</h3>  <p align="justify"><font size="2">Save a copy of the script and run the script inside the ‘<b>Windows Powershell ISE</b>’ desktop application. After successful execution of the script, you should have the following data file under the folder ‘<b>C:\Users\&lt;username&gt;\AppData\Local\Temp’</b></font></p>  <ul>   <li>     <div align="justify"><strong><font size="2">Ratecardoutput.txt</font></strong> </div>   </li> </ul>  <h4 align="justify">&#160;</h4>  <h3 align="justify">Step 4. Load the output data file inside the Excel </h3>  <ul>   <li>     <div align="justify"><font size="2">Data file – <b>Ratecardoutput.txt</b> – is a character delimited file and the delimiting character is chosen to be the exclamation mark (!). </font></div>   </li>    <li>     <div align="justify"><font size="2">Open Excel and create two worksheets inside it. One called ‘<b>Bill of Material</b>’ and another called ‘<b>Azure Rate Card</b>’. </font></div>   </li>    <li>     <div align="justify"><font size="2">Select the <b>Azure Rate Card</b> Tab in the Excel spread-sheet. Select <b>Data</b> Menu and click on <b>Get-External Data</b> – “From Text” </font></div>   </li>    <li>     <div align="justify"><font size="2">Open File dialog box is shown. Navigate to “<b>C:\Users\&lt;username&gt;\AppData\Local\Temp</b>” and open the file ‘<b>ratecardoutput.txt</b>’ </font></div>   </li>    <li>     <div align="justify"><font size="2">You’ll be shown the <b>Text import Wizard – Step 1 of 3 </b>screen. - Select <b>Delimited</b> option and also ‘<b>My data has headers</b>’ </font></div>   </li>    <li>     <div align="justify"><font size="2">In Step 2, uncheck the ‘<b>Tab’ </b>delimiter and enter <b>‘!’</b> in the ‘<b>Other’</b> box. Click ‘<b>Finish</b>’. </font></div>   </li>    <li>     <div align="justify"><font size="2">Data dialog box shown, ensure that the data is inserted at the top left hand row – Enter ‘<b>='Azure Rate Card'!$A$1</b>’ value in the field. </font></div>   </li>    <li>     <div align="justify"><font size="2">If this step is incorrectly executed, all the rest of calculations will be incorrect </font></div>   </li> </ul>  <h3 align="justify">&#160;</h3>  <h3 align="justify">Step 5. Adding computational logic</h3>  <p align="justify"><font size="2">At this point, we’ve loaded the RateCard data in our Excel. We now need to add the computational logic into the ‘Bill of Material’ worksheet. </font></p>  <h4 align="justify">Excel implementation details </h4>  <p align="justify"><font size="2">As per the requirement, we create two rows. One containing the details about Storage and other about the virtual machine required. To facilitate this look-up, we have manually substituted the relevant ‘<b>Meter</b> <b>Guid</b>’ from the previous downloads of Azure Ratecard. This is a one-time process. In order to calculate the monthly bill, Azure services from the ‘<b>Bill of Material</b>’ worksheet will reference the relevant record from ‘<b>Azure Rate Card</b>’ worksheet. </font></p>  <p align="justify"><img src="https://nkimages.blob.core.windows.net/imagecontainer/image07.png" max-height:100%;margin:auto;display:block;="max-height:100%;margin:auto;display:block;" max-width:100%;="max-width:100%;" /></p>  <p style="list-style-type: disc; background: #a8d08d; margin-left: 0cm; margin-right: 0cm" align="justify"><strong><span style="font-family: "><font face="Courier New"><font style="font-size: 12pt" color="#000000">=IFERROR(VLOOKUP(E6, 'Azure Rate Card'!$A$2:$I$2000,4,FALSE), ) </font></font></span></strong></p>  <p style="list-style-type: disc; background: #a8d08d; margin-left: 0cm; margin-right: 0cm" align="justify"><strong><span style="font-family: "></span></strong><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-bidi-theme-font: minor-bidi"><font color="#000000" size="2"><em>Explanation: ‘E’ column contains the Meter Guid. We take the value of Meter Guid and match it against the corresponding Rate in the ‘Azure Rate Card’ worksheet. <span style="mso-spacerun: yes">&#160;</span>For more information on VLOOKUP, please see </em></font><a style="cursor: auto" href="https://support.microsoft.com/en-us/kb/181213"><span><font color="#0563c1" size="2"><u>this article</u></font></span></a></span></p>  <p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 10pt" align="justify"><font color="#000000" size="2">The formula used in the column J – consumption column is </font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #a8d08d; margin: 0cm 0cm 10pt; mso-background-themecolor: accent6; mso-background-themetint: 153" align="justify"><b style="mso-bidi-font-weight: normal"><span style="font-family: "><font face="Courier New"><font color="#000000"><font style="font-size: 11pt">=ROUND(IF(ISNUMBER(I6),H6*I6,CalculateTieredRate(H6, I6)), 2) or =ROUND(IF(ISNUMBER(I7),H7*I7</font></font><font style="font-size: 11pt"><span style="color: "><font color="#ff0000">*744</font></span><font color="#000000">,CalculateTieredRate(H7, I7)), 0)</font></font></font></span></b></p>  <p class="MsoNormal" style="list-style-type: disc; background: #a8d08d; margin: 0cm 0cm 10pt; mso-background-themecolor: accent6; mso-background-themetint: 153" align="justify"><span><font size="2"><em><font color="#000000">The rate value obtained from Azure Ratecard API can either be in numeric or in string format. When it’s in string format, the rates are expressed as a key-value pairs. For e.g. the rate value obtained for storage is like – “0,0.095;1024,0.08;51200,0.07;512000,0.065;1024000,0.06;5120000,0.055”. <span style="mso-spacerun: yes">&#160;</span>This value is not suitable to calculate the consumption. Therefore, in the Consumption Cost – Monthly column, we check the value of Rate column. If its numeric, we multiply it with the Quantity and monthly hours to come up with monthly consumption cost. Otherwise we use a separate VBA formula </font><font color="#000000">- CalculateTieredRate</font><font color="#000000"> - to calculate the tiered metered cost. This VBA function is copied <a href="#ExcelVBAFunction">here</a></font></em><em><font color="#000000"> </font></em></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #a8d08d; margin: 0cm 0cm 10pt; mso-background-themecolor: accent6; mso-background-themetint: 153" align="justify"><em><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-bidi-theme-font: minor-bidi"><font color="#000000" size="2">We use two flavours of formula, depending upon the unit of measure. If the rate is provided as hourly charge, then we multiply the consumption with 744 (= number of hours in a month) to obtain the monthly consumption figure. </font></span></em></p>  <h1 align="justify"><font size="2" face="Segoe UI">Sample excel file, with all the mentioned functionality, can be downloaded from </font><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/95/26/2526.Azure%20Rate%20Card%20to%20BoM%20implementation.xlsm" original-url="https://blogs.msdn.com/cfs-filesystemfile.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-95-26/2526.Azure-Rate-Card-to-BoM-implementation.xlsm" target="_blank"><font size="2" face="Segoe UI">here</font></a></h1>  <p align="justify">&#160;</p>  <h1 align="justify">Result: </h1>  <p align="justify"><font size="3">Now you should have a fully functioning Azure monthly estimator which takes the Azure rates applicable to your offer-ID and also takes into consideration tiered meter usage. <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/95/26/metablogapi/7318.wlEmoticon-smile_2793AEC1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-95-26-metablogapi/7318.wlEmoticon_2D00_smile_5F00_2793AEC1.png" /></font></p>  <hr />  <h2 id="PowerShellScript">PowerShell Script</h2>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Activate Azure Powershell module </font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#0000ff"><font style="font-size: 9pt">Import-Module</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Azure</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># TODO - Replace the following values</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># =================================================</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$adTenant</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">&quot;microsoft.onmicrosoft.com&quot;</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Set well-known client ID for Azure PowerShell</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$clientId</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;XXXXXXXX-XXXX-4d50-937a-96e123b13015&quot;</font></span><font color="#000000"> </font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># subscription guid </font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$SubscriptionId</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'XXXXXXXX-XXXX-4802-a5e6-d9c5a43c72a0'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Set redirect URI for Azure PowerShell</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$redirectUri</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Uri</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">'https://localhost/'</font></span><font color="#000000">)</font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Azure on Internal subscription</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$OfferDurableId</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">'MS-AZR-0121p'</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#006400"># Azure on Internal subscription</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># =================================================</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Set Resource URI to Azure Service Management API</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$resourceAppIdURI</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">&quot;https://management.azure.com/&quot;</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Set Authority to Azure AD Tenant</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$authority</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;https://login.microsoftonline.com/</font></span><span style="color: "><font color="#ff4500">$adTenant</font></span></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">&quot;</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Create Authentication Context tied to Azure AD Tenant</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$authContext</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext</font></span><font color="#000000">(</font><span style="color: "><font color="#ff4500">$authority</font></span><font color="#000000">)</font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Acquire token</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$authResult</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$authContext</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">AcquireToken(</font><span style="color: "><font color="#ff4500">$resourceAppIdURI</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$clientId</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$redirectUri</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;Auto&quot;</font></span><font color="#000000">)</font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$ResHeaders</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> @{</font><span style="color: "><font color="#8b0000">'authorization'</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$authResult</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">CreateAuthorizationHeader()}</font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#ff4500">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$ApiVersion</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'2015-06-01-preview'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$Currency</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'USD'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$Locale</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'en-US'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$RegionInfo</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'US'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$File</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$env:TEMP</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">'\resourcecard.json'</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$OutputFilename</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$env:TEMP</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">'\ratecardoutput.txt'</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#006400"># This is usually C:\Users\&lt;username&gt;\AppData\Local\Temp</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$ResourceCard</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;https://management.azure.com/subscriptions/{5}/providers/Microsoft.Commerce/RateCard?api-version={0}&amp;`$filter=OfferDurableId eq '{1}' and Currency eq '{2}' and Locale eq '{3}' and RegionInfo eq '{4}'&quot;</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">-f</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$ApiVersion</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$OfferDurableId</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Currency</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Locale</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$RegionInfo</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#ff4500">$SubscriptionId</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#0000ff">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#0000ff"><font style="font-size: 9pt">Invoke-RestMethod</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-Uri</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$ResourceCard</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Headers</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$ResHeaders</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-ContentType</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">'application/json'</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-OutFile</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#ff4500">$File</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$Resources</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">Get-Content</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Raw</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Path</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$File</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Encoding</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">UTF8</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#0000ff">ConvertFrom-Json</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Insert the header line</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$strHeaderLine</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;{0}!{1}!{2}!{3}!{4}!{5}!{6}!{7}!{8}&quot;</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">-f</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterId&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterSubCategory&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterRegion&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterRates&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterCategory&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;MeterName&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;Unit&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;EffectiveDate&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> <span style="mso-spacerun: yes">&#160;</span></font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">&quot;IncludedQuantity&quot;</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#006400"># Create the header in the output file </font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#ff4500"><font style="font-size: 9pt">$strHeaderLine</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">Out-File</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#ff4500">$OutputFilename</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#006400"># We create this loop to take care of tiered meter enteries in the table</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#00008b">foreach</font></span><font color="#000000">(</font><span style="color: "><font color="#ff4500">$meterObj</font></span><font color="#000000"> </font><span style="color: "><font color="#00008b">in</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Resources</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Meters)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><span style="color: "><font style="font-size: 9pt" color="#006400"># convert the darn PSCustomeObject created by ConvertFrom_Json to our dictionary object</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$meterRates</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> @{}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterRates </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">Get-Member</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-MemberType</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Properties</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">SELECT</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-exp</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;Name&quot;</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">%</font></span><font color="#000000"> {</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$meterRates</font></span><span style="color: "><font color="#a9a9a9">[</font></span><span style="color: "><font color="#ff4500">$_</font></span><span style="color: "><font color="#a9a9a9">]</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> (</font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterRates </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">SELECT</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-exp</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$_</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8b0000">&quot;&quot;</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">if</font></span><font color="#000000"> (</font><span style="color: "><font color="#ff4500">$meterRates</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Count </font><span style="color: "><font color="#a9a9a9">-gt</font></span><font color="#000000"> </font><span style="color: "><font color="#800080">1</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$nCount</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#800080">0</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">foreach</font></span><font color="#000000">(</font><span style="color: "><font color="#ff4500">$meterRatePair</font></span><font color="#000000"> </font><span style="color: "><font color="#00008b">in</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterRates</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">GetEnumerator() </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">Sort</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Property</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Value</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Descending</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+=</font></span><font color="#000000"> $(</font><span style="color: "><font color="#ff4500">$meterRatePair</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Name) </font><span style="color: "><font color="#a9a9a9">+</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;,&quot;</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+</font></span><font color="#000000"> $(</font><span style="color: "><font color="#ff4500">$meterRatePair</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Value)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">if</font></span><font color="#000000"> (</font><span style="color: "><font color="#ff4500">$nCount</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">-lt</font></span><font color="#000000"> (</font><span style="color: "><font color="#ff4500">$meterRates</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Count </font><span style="color: "><font color="#a9a9a9">-</font></span><span style="color: "><font color="#800080">1</font></span><font color="#000000">))</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;;&quot;</font></span><font color="#000000">;</font></font><span style="mso-spacerun: yes"><font style="font-size: 9pt" color="#000000">&#160;&#160; </font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$nCount</font></span><span style="color: "><font color="#a9a9a9">++</font></span><font color="#000000">; </font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><span style="color: "><font style="font-size: 9pt" color="#00008b">else</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">foreach</font></span><font color="#000000">(</font><span style="color: "><font color="#ff4500">$meterRatePair</font></span><font color="#000000"> </font><span style="color: "><font color="#00008b">in</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterRates</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">GetEnumerator())</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> $(</font><span style="color: "><font color="#ff4500">$meterRatePair</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Value)<span style="mso-spacerun: yes">&#160; </span></font></font><span style="color: "><font style="font-size: 9pt" color="#006400"># this line will execute only once.</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strOutputLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;{0}!{1}!{2}!{3}!{4}!{5}!{6}!{7}!{8}&quot;</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">-f</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterId</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterSubCategory</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterRegion</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$strLine</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterCategory</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">MeterName</font><span style="color: "><font color="#a9a9a9">,</font></span><span style="mso-spacerun: yes"><font color="#000000">&#160;&#160; </font></span><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Unit</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">EffectiveDate</font><span style="color: "><font color="#a9a9a9">,</font></span><span style="mso-spacerun: yes"><font color="#000000">&#160; </font></span><span style="color: "><font color="#ff4500">$meterObj</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">IncludedQuantity</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font><font style="font-size: 9pt"><span style="color: "><font color="#ff4500">$strOutputLine</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">|</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">Out-File</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$OutputFilename</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#000080">-Append</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font color="#000000"><span style="mso-spacerun: yes"><font style="font-size: 9pt">&#160;</font></span><font style="font-size: 9pt"><span style="mso-spacerun: yes">&#160;&#160; </span>}</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#0000ff"><font style="font-size: 9pt">Remove-Item</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-Force</font></span><font color="#000000"> </font><span style="color: "><font color="#000080">-Path</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#ff4500">$File</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: white; margin: 0cm 0cm 0pt; text-autospace: ; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; margin: 0cm 0cm 10pt" align="justify"><span style="font-family: ; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: &quot;Times New Roman&quot;; mso-bidi-theme-font: minor-bidi; mso-bidi-font-weight: bold"><font color="#000000" size="2">Description of the PowerShell shell script. </font></span></p>  <p class="MsoListParagraphCxSpFirst" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">1.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Start of the script gathers all the authentication, subscription, offer-id etc data. </font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">2.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>It logs on to the Azure subscription using the credentials provided and obtains an authentication token. </font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">3.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Script formats the RateCard request whilst substituting the values for subscription-id, offer-id, locale, currency, Region-info. </font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">4.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Scripts invokes REST based API call using the previously obtained authentication token and formatted request. </font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">5.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>On success, the return values are written to output file – ‘resourcecard.json’ and its copied to location - C:\Users\&lt;username&gt;\AppData\Local\Temp </font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">6.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Script then filters and picks up only the ‘Meters’ data and converts the Json formatted data into a ‘!’ – exclamation mark -<span style="mso-spacerun: yes">&#160; </span>character delimited file.<span style="mso-spacerun: yes">&#160; </span></font></span></font></p>  <p class="MsoListParagraphCxSpMiddle" style="list-style-type: disc; margin: 0cm 0cm 0pt 72pt; line-height: 13pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level2 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">a.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>We will use this delimiting character to load the file into Excel. </font></span></font></p>  <p class="MsoListParagraphCxSpLast" style="list-style-type: disc; margin: 0cm 0cm 10pt 36pt; line-height: 13pt; text-indent: -18pt; mso-list: l0 level1 lfo1" align="justify"><font color="#000000"><span><font size="2"><span style="mso-list: ignore">7.<span style="font-family: ; line-height: normal">&#160;&#160;&#160;&#160;&#160;&#160; </span></span>The output of this formatted data is written to file ‘ratecardoutput.txt’ which is copied to the folder - C:\Users\&lt;username&gt;\AppData\Local\Temp</font></span></font></p>  <hr />  <h2 id="ExcelVBAFunction">Excel VBA function – Calculate Storage value</h2>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#0000ff"><font style="font-size: 9pt">Option</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Explicit</font></span></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#00008b"><font style="font-size: 9pt">Function</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font><span style="color: "><font color="#8a2be2">CalculateTieredRate</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">Quantity</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Double</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">String</font></span><font color="#000000">)</font></font></span></font></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;</font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#006400">’The assumption is that the MeterRate that is passed is already sorted in value</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#006400">’MeterRate format is &quot;0, 0.024;1024,0.0236;51200,0.0232;512000,0.0228;1024000,0.0224;5120000,0.055&quot;</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#800080">0</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterRatePair</font></span><font color="#000000">() </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">String</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterValue</font></span><font color="#000000">()<span style="mso-spacerun: yes">&#160; </span></font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">String</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">nNumberOfRates</font></span><span style="mso-spacerun: yes"><font color="#000000">&#160; </font></span><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Long</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">nNumberOfRates</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">UBound</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">Split</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">MeterRate</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;;&quot;</font></span><font color="#000000">)) </font></font><span style="color: "><font style="font-size: 9pt" color="#006400">‘ ; is our delimiting characters between records</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">ReDim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterRatePair</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">nNumberOfRates</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">+</font></span><font color="#000000"> </font><span style="color: "><font color="#800080">1</font></span><font color="#000000">) </font></font><span style="color: "><font style="font-size: 9pt" color="#006400">‘ because the number of pairs would be one greater</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">MeterRatePair</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Split</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">MeterRate</font></span><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;;&quot;</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">i</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Integer</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">For</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">i</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#800080">0</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">To</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">nNumberOfRates</font></span><span style="mso-spacerun: yes"><font color="#000000">&#160; </font></span></font><span style="color: "><font style="font-size: 9pt" color="#006400">‘ Its a zero bound array</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">lowerBound</font></span><span style="mso-spacerun: yes"><font color="#000000">&#160; </font></span><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Double</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">upperBound</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Double</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">currentRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Double</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">MeterValue</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Split</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">MeterRatePair</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">i</font></span><font color="#000000">)</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;,&quot;</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">lowerBound</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterValue</font></span><font color="#000000">(</font><span style="color: "><font color="#800080">0</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">currentRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterValue</font></span><font color="#000000">(</font><span style="color: "><font color="#800080">1</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Dim</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">costAtThisLevel</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">As</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Double</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">costAtThisLevel</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#800080">0</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">If</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">i</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">&gt;</font></span><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">nNumberOfRates</font></span><font color="#000000">) </font></font><span style="color: "><font style="font-size: 9pt" color="#0000ff">Then</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#006400">‘ we are already at the last record. there is no upper bound for us at this point</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">costAtThisLevel</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">Quantity</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">-</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">lowerBound</font></span><font color="#000000">) </font><span style="color: "><font color="#8a2be2">*</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">currentRate</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">+</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">costAtThisLevel</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#00008b">Else</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">MeterValue</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">Split</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">MeterRatePair</font></span><font color="#000000">(</font><span style="color: "><font color="#0000ff">i</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">+</font></span><font color="#000000"> </font><span style="color: "><font color="#800080">1</font></span><font color="#000000">)</font><span style="color: "><font color="#a9a9a9">,</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;,&quot;</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">upperBound</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">MeterValue</font></span><font color="#000000">(</font><span style="color: "><font color="#800080">0</font></span><font color="#000000">)</font></font></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><span style="mso-spacerun: yes"><font face="Lucida Console"><font style="font-size: 9pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">If</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">Quantity</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">&gt;</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">upperBound</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">-</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">lowerBound</font></span><font color="#000000">)) </font></font><span style="color: "><font style="font-size: 9pt" color="#0000ff">Then</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">costAtThisLevel</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">upperBound</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">-</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">lowerBound</font></span><font color="#000000">) </font><span style="color: "><font color="#8a2be2">*</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">currentRate</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#006400">‘ rate of the full band</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">+</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">costAtThisLevel</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9pt" color="#00008b">Else</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">costAtThisLevel</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> (</font><span style="color: "><font color="#0000ff">Quantity</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">-</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">lowerBound</font></span><font color="#000000">) </font><span style="color: "><font color="#8a2be2">*</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">currentRate</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">CalculateTieredRate</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">+</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">costAtThisLevel</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#00008b">Exit</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#0000ff">For</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">End</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">If</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">End</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">If</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9pt">&#160;&#160;&#160; </font></font></span><font style="font-size: 9pt"><span style="color: "><font color="#0000ff">Next</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">i</font></span></font></span></p>  <p class="MsoNormal" style="list-style-type: disc; background: #bfbfbf; margin: 0cm 0cm 0pt; text-autospace: ; mso-background-themecolor: background1; mso-background-themeshade: 191; mso-layout-grid-align: none"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font color="#0000ff"><font style="font-size: 9pt">End</font></font></span><span style="font-family: ; mso-bidi-font-family: &quot;Lucida Console&quot;"><font style="font-size: 9pt"><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9pt" color="#8a2be2">Function </font></span></span></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Bare Metal - MPI library on Azure Linux nodes</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/bare-metal-mpi-library-on-azure-linux-nodes</link>
      <pubDate>Fri, 10 Jul 2015 13:33:00 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/2015/07/10/bare-metal-mpi-library-on-azure-linux-nodes/</guid>
      <description><![CDATA[This post was published to Ninad...]]></description>
      <content:encoded><![CDATA[    

    <div class=WordSection1>
        <?xml namespace prefix="w" ns="urn:schemas-microsoft-com:office:word" ?>
        <w:sdt id=89512093 sdtgroup="t" contentlocked="t" sdtlocked="t">
            <div style="BORDER-TOP: #e1e1e1 1pt solid; BORDER-RIGHT: #f0f0f0 1pt solid; BACKGROUND: #f0f0f0; BORDER-BOTTOM: #e1e1e1 1pt solid; PADDING-BOTTOM: 1pt; PADDING-TOP: 1pt; PADDING-LEFT: 2pt; BORDER-LEFT: #f0f0f0 1pt solid; PADDING-RIGHT: 2pt; mso-element: para-border-div">
                <p class=PublishStatus style="BACKGROUND: #f0f0f0">This post was published to Ninad Kanthi's WebLog at 21:33:08 10/07/2015<w:sdtpr></w:sdtpr></p>
            </div><w:sdt id=89512082 title="Post Title" storeitemid="X_5F329CAD-B019-4FA6-9FEF-74898909AD20" text="t" docpart="89512082" xpath="/ns0:BlogPostInfo/ns0:PostTitle">
                <p class=Publishwithline><span style='FONT-SIZE: 28pt; FONT-FAMILY: "Calibri Light",sans-serif; LETTER-SPACING: -0.5pt; mso-bidi-font-family: "Times New Roman"'>Bare Metal - MPI library on Azure Linux nodes</span><span style='FONT-SIZE: 28pt; LETTER-SPACING: -0.5pt; mso-ascii-font-family: "Calibri Light"; mso-hansi-font-family: "Calibri Light"; mso-bidi-font-family: "Times New Roman"'><w:sdtpr></w:sdtpr></span></p>
            </w:sdt>
            <div style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: #c6c6c6 1pt solid; PADDING-BOTTOM: 2pt; PADDING-TOP: 0cm; PADDING-LEFT: 0cm; BORDER-LEFT: medium none; PADDING-RIGHT: 0cm; mso-element: para-border-div">
                <p class=underline><?xml namespace prefix="o" ns="urn:schemas-microsoft-com:office:office" ?>
                <o:p>&nbsp;</o:p></p>
            </div>
            <p class=PadderBetweenControlandBody><o:p>&nbsp;</o:p></p>
        </w:sdt>
        <h1><span style='mso-fareast-font-family: "Times New Roman"'>Step-By-Step guide<o:p></o:p></span></h1>
        <p class=MsoNormal>&nbsp;</p>
        <p class=MsoNormal>This article shows how a MPI applications can be setup using “bare metal” Linux nodes on Azure. </p>
        <p class=MsoNormal>It must be emphasized that this article shows how easy it is to setup and configure the Azure environment to execute the MPI application but the configurations shown here are not recommended for a production environment. &nbsp;It is assumed that the reader has basic knowledge of Azure and medium to advanced knowledge on Linux, especially Ubuntu distros. </p>
        <p class=MsoNormal>The techniques shown here have been extended from this Ubuntu <a href="https://help.ubuntu.com/community/MpichCluster">article</a>. </p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>1.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Creating a Cluster<o:p></o:p></span></h2>
        <p class=MsoNormal>As the first step, we will configure a Linux cluster under Azure. It will consist of four nodes and one of them will be the master node. The cluster will be created inside a VPN. To keep things very simple, we won’t create a DNS server and instead modify the <b><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>/<span class=SpellE>etc</span>/hosts</span></b><span style="FONT-SIZE: 10pt"> </span>file. </p>
        <p class=MsoNormal>The script for creating the Linux cluster is shown at the bottom of this article. Couple of things to note in the script are:</p>
        <p class=MsoListParagraphCxSpFirst style="BACKGROUND: #c5e0b3; TEXT-INDENT: -18pt; mso-background-themecolor: accent6; mso-background-themetint: 102">-<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>We create Linux cluster from Ubuntu-14_04_2_LTS. This image is available from the Azure gallery.</p>
        <p class=MsoListParagraphCxSpLast style="BACKGROUND: #c5e0b3; TEXT-INDENT: -18pt; mso-background-themecolor: accent6; mso-background-themetint: 102">-<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>We will use NFS to created shared storage between the Linux nodes. In order for the NFS to be successful, required ports, 2049 and 111 are configured during the provisioning of the nodes. </p>
        <p class=MsoNormal>After successful execution of creation script, you should see the Linux nodes configured under the VNET in your subscription as shown below</p>
        <p class=MsoNormal style="TEXT-ALIGN: center" align=center><span style="mso-no-proof: yes"><img id=_x0000_i1026 border=0 alt=image5.jpg src="https://nkimages.blob.core.windows.net/imagecontainer/image005.jpg" width=602 height=362></span></p>
        <p class=MsoCaption style="TEXT-ALIGN: center" align=center>Figure 1: Linux nodes under Azure VPN</p>
        <p class=MsoNormal>After the Linux nodes have been provisioned and up and running, we use <span class=SpellE>PuTTY</span> to establish a SSH connection and login to the node. </p>
        <p class=MsoNormal style="BACKGROUND: #a8d08d">NOTE: The process of accessing and logging on to the provisioned Linux nodes is described in detailed <a href="https://blogs.msdn.com/b/ninadk/archive/2015/04/16/big-bank-weekend-project.aspx">here</a>.&nbsp; </p>
        <p class=MsoNormal>We will use the Linux node, <b>linuxdistro-001</b>, as the <b>master</b> node. </p>
        <p class=MsoNormal>After logging onto the node, we edit the <b><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>/<span class=SpellE>etc</span>/hosts</span></b><span style="FONT-SIZE: 10pt"> </span>file and add the nodes TCP endpoints to this file. This step is replicated across all nodes. </p>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> <span class=GramE>vi</span> /<span class=SpellE>etc</span>/hosts</span></p>
        <p class=MsoNormal>After editing, the content of <span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>/<span class=SpellE>etc</span>/hosts</span> file should look like following:</p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ cat /<span class=SpellE>etc</span>/hosts<o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>127.0.0.1 <span class=GramE>localhost</span><o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.4 <span class=GramE>ub0</span><o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.5 <span class=GramE>ub1</span><o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.6 <span class=GramE>ub2</span><o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.7 <span class=GramE>ub3</span><o:p></o:p></span></p>
        <p class=MsoNormal>After repeating the above step across each node, each node can communicate with each other without the DNS being provisioned but please bear in mind that DNS is always a better option. </p>
        <p class=MsoNormal>As we need to execute same commands across the Linux nodes, we will install <span class=SpellE><b>ssh</b> </span> & <span class=SpellE><b>pssh</b></span> utilities on the master node. </p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Install </span><span class=SpellE><span style='FONT-WEIGHT: normal; mso-fareast-font-family: "Times New Roman"'>pssh</span></span><span style='mso-fareast-font-family: "Times New Roman"'> on the master node<o:p></o:p></span></h3>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> apt-get install <span class=SpellE><span class=GramE>ssh</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> apt-get install <span class=SpellE>pssh</span></span></p>
        <p class=MsoNormal style="BACKGROUND: white">&nbsp;</p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Test that </span><span class=SpellE><span style='FONT-WEIGHT: normal; mso-fareast-font-family: "Times New Roman"'>pssh</span></span><span style='mso-fareast-font-family: "Times New Roman"'> is working correctly<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -H&nbsp; 10.0.0.5&nbsp; -H 10.0.0.6 -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" echo hi</span></p>
        <p class=MsoNormal style="BACKGROUND: white">&nbsp;</p>
        <p class=MsoNormal style="BACKGROUND: #c5e0b3">Note: To supress SSH warnings, we add the options <span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o<span class=GramE>&nbsp; <span class=SpellE>GlobalKnownHostsFile</span></span>=/dev/null" </span>to every <span class=SpellE><b>pssh</b></span> &nbsp;command</p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>2.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Provisioning shared Storage<o:p></o:p></span></h2>
        <p class=MsoNormal style="BACKGROUND: white">&nbsp;</p>
        <p class=MsoNormal style="BACKGROUND: white">We will create <b>/mirror</b> folder under the master node and this will be shared across the nodes via <b>NFS</b></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Install <span class=SpellE>nfs</span>-client on all nodes except the master node<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -H&nbsp; 10.0.0.5&nbsp; -H 10.0.0.6 -H 10.0.0.7 -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> apt-get install -y <span class=SpellE>nfs</span>-client</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Create same folder structure on all nodes<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -h <span class=SpellE>host_file</span> -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> <span class=SpellE>mkdir</span> /mirror</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Install the <span class=SpellE>nfs</span>-server on the master node<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> apt-get install <span class=SpellE>nfs</span>-server</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Ensure that the /mirror folder is set to share<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ echo "/mirror *(<span class=SpellE>rw<span class=GramE>,sync</span></span>)" | <span class=SpellE>sudo</span> tee -a /<span class=SpellE>etc</span>/exports</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Restart the <span class=SpellE>nfs</span> share on the master node <o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> service <span class=SpellE>nfs</span>-kernel-server restart</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Mount the share across the client nodes<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -H&nbsp; 10.0.0.5&nbsp; -H 10.0.0.6 -H 10.0.0.7 -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> mount ub0:/mirror /mirror</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Test the share across the client nodes. <o:p></o:p></span></h3>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> <span class=SpellE>cp</span> /<span class=SpellE>etc</span>/hosts /mirror</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -H&nbsp; 10.0.0.5&nbsp; -H 10.0.0.6 -H 10.0.0.7 -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> ls /mirror</span></p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>3.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Setting up mutual trust for non-admin user<o:p></o:p></span></h2>
        <p class=MsoNormal>We will create a non-admin user – <span class=SpellE><b>mpiu</b></span>. This user needs to be created because Ubuntu does not support root trust. We also assign our shared folder, <b>/mirror</b>, as the home folder for this user. <span class=SpellE><span class=GramE><b>newusers</b></span></span> command is used to create this user across all nodes. </p>
        <p class=MsoNormal style="BACKGROUND: #a8d08d">Note: We use the <span class=SpellE><b>newusers</b></span> command to create the user across the various nodes as it provides the ability to create execute the command in non-interactive mode. The parameters for the user <span class=SpellE><b>mpiu</b></span> is specified in a file – <b>/mirror/<span class=SpellE>userfile</span></b>.&nbsp; </p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Creating non-admin user<o:p></o:p></span></h3>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ cd /mirror<o:p></o:p></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ <span class=GramE>vi</span> <span class=SpellE>userfile</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ cat <span class=SpellE>userfile</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span class=SpellE><span class=GramE><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu</span></span></span><span class=GramE><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>:</span></span><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"; COLOR: red'>&lt;password removed&gt;</span><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>:1002:1000:MPI user:/mirror:/bin/bash</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A &nbsp;-h <span class=SpellE>host_file</span> -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> <span class=SpellE>newusers</span> /mirror/<span class=SpellE>userfile</span></span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Change the owner of shared folder to newly created user.<o:p></o:p></span></h3>
        <p class=MsoNormal style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ <span class=SpellE>sudo</span> <span class=SpellE>chown</span> <span class=SpellE>mpiu</span> /mirror</span></p>
        <h3><span style='mso-fareast-font-family: "Times New Roman"'>Configuring password-less SSH communication across<o:p></o:p></span></h3>
        <p class=MsoListParagraphCxSpFirst style="TEXT-INDENT: -18pt">1.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Install <span class=SpellE><span class=GramE>ssh</span></span> components on the master node</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=SpellE>sudo</span> apt-get install <span class=SpellE><span class=GramE>ssh</span></span></span>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">2.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Next, Login with our newly created user</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ <span class=SpellE>su</span> - <span class=SpellE>mpiu</span></span>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">3.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Generate an RSA key pair for user <span class=SpellE><b>mpiu</b></span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ <span class=SpellE>ssh-keygen</span> –t <span class=SpellE>rsa</span></span>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">4.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Add this key to authorized keys file</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ cd .<span class=SpellE>ssh</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$<span class=GramE>&nbsp; cat</span> id_rsa.pub &gt;&gt; <span class=SpellE>authorized_keys</span></span></p>
        <p class=MsoListParagraphCxSpLast style="TEXT-INDENT: -18pt">5.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class=GramE>As</span> the home directory is common across all nodes <b style="mso-bidi-font-weight: normal">(/mirror</b>), there is no need to run these commands on all nodes</p>
        <p class=MsoNormal style="MARGIN-LEFT: 18pt; TEXT-INDENT: 18pt">Test SSH run – it should <u>not</u> ask you for password for connecting to the machine. </p>
        <p class=MsoListParagraph style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$<span class=GramE>&nbsp; <span class=SpellE>ssh</span></span> ub1 hostname</span></p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>4.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>MPI (HPC Application) installation and configuration<o:p></o:p></span></h2>
        <p class=MsoListParagraph style="TEXT-INDENT: -18pt">1.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Login as the admin user </p>
        <p class=MsoNormal style="MARGIN-LEFT: 36pt">We logout from our existing <span class=SpellE><b>mpiu</b></span> session and we should be back in our admin – <span class=SpellE><b>linuxuser</b></span> – session. </p>
        <p class=MsoListParagraphCxSpFirst style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ logout</span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001: </span></p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">2.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Install GCC </p>
        <p class=MsoListParagraphCxSpMiddle>We need a compiler to compile all the code. This needs to happen only on the master node.</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001: <span class=SpellE>sudo</span> apt-get install build-essential</span></p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">3.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Install MPICH2</p>
        <p class=MsoListParagraphCxSpMiddle>The MPICH2 structure folder structure needs to be same across all nodes, therefore we execute the following command across all nodes/</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"; BACKGROUND: #bdd6ee; mso-shading-themecolor: accent1; mso-shading-themetint: 102'>li</span><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>nuxuser@linuxdistro-001: parallel-<span class=SpellE>ssh</span><span class=GramE>&nbsp; -</span><span class=SpellE>i</span> -A&nbsp; -h /mirror/<span class=SpellE>hosts_file</span> -x "-o <span class=SpellE>StrictHostKeyChecking</span>=no -o <span class=SpellE>UserKnownHostsFile</span>=/dev/null -o&nbsp; <span class=SpellE>GlobalKnownHostsFile</span>=/dev/null" <span class=SpellE>sudo</span> apt-get install -y mpich2</span></p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto">Note the content of <b>/mirror/<span class=SpellE>hosts_file</span></b> is </p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:~$ <span class=GramE>cat ./</span><span class=SpellE>host_file</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.4</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.5</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #c5e0b3; mso-add-space: auto"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>10.0.0.7</span></p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">4.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Test installation</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>linuxuser@linuxdistro-001:/mirror$ <span class=SpellE>su</span> – <span class=SpellE>mpiu</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ which <span class=SpellE>mpiexec</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ which <span class=SpellE>mpirun</span></span></p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">5.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Setting up machine file</p>
        <p class=MsoListParagraphCxSpMiddle>Create a configuration file – <span class=SpellE>nodefile</span> – in <span class=SpellE>mpiu’s</span> home <span class=SpellE>folde</span>. Within the file specify the node names followed by the number of processes to spawn on each node.&nbsp; We have two cores per node, so we are going to specify 2 or 1 process per node. </p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ cat <span class=SpellE>nodefile</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>ub0</span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>ub1:2</span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>ub2:2</span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>ub3</span></p>
        <p class=MsoListParagraphCxSpMiddle style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$</span></p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle style="TEXT-INDENT: -18pt">6.<span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Create a testing MPICH2 C source code and compile. </p>
        <p class=MsoListParagraphCxSpMiddle>&nbsp;</p>
        <p class=MsoListParagraphCxSpMiddle>Dummy <a href="https://auriza.site40.net/notes/mpi/openmpi-on-ubuntu-904/"><span class=SpellE>mpi_hello.c</span></a> program.</p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ cat <span class=SpellE>mpi_hello.c</span></span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>#include &lt;<span class=SpellE>stdio.h</span>&gt;</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>#include &lt;<span class=SpellE>mpi.h</span>&gt;</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;<span class=SpellE><span class=GramE>int</span></span> main(<span class=SpellE>int</span> <span class=SpellE>argc</span>, char** <span class=SpellE>argv</span>) {</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=SpellE><span class=GramE>int</span></span> <span class=SpellE>myrank</span>, <span class=SpellE>nprocs</span>;</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=SpellE>MPI_<span class=GramE>Init</span></span><span class=GramE>(</span>&amp;<span class=SpellE>argc</span>, &amp;<span class=SpellE>argv</span>);</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=SpellE>MPI_Comm_<span class=GramE>size</span></span><span class=GramE>(</span>MPI_COMM_WORLD, &amp;<span class=SpellE>nprocs</span>);</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=SpellE>MPI_Comm_<span class=GramE>rank</span></span><span class=GramE>(</span>MPI_COMM_WORLD, &amp;<span class=SpellE>myrank</span>);</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=SpellE><span class=GramE>printf</span></span><span class=GramE>(</span>"Hello from processor %d of %d\n", <span class=SpellE>myrank</span>, <span class=SpellE>nprocs</span>);</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=SpellE>MPI_<span class=GramE>Finalize</span></span><span class=GramE>(</span>);</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=GramE>return</span> 0;</span></p>
        <p class=MsoListParagraphCxSpLast style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>}</span></p>
        <p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Compile the source code into an executable</p>
        <p class=MsoListParagraph style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ <span class=SpellE>mpicc</span> <span class=SpellE>mpi_hello.c</span> -o <span class=SpellE>mpi_hello</span></span></p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>5.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Job Execution<o:p></o:p></span></h2>
        <p class=MsoListParagraph style="BACKGROUND: #bdd6ee; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ <span class=SpellE>mpiexec</span> -n 6 -f <span class=SpellE><span class=GramE>nodefile</span></span><span class=GramE> ./</span><span class=SpellE>mpi_hello</span></span></p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>6.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Results capture and analysis<o:p></o:p></span></h2>
        <p class=MsoNormal style="MARGIN-LEFT: 36pt">If everything is successful, you should see the following result.</p>
        <p class=MsoListParagraphCxSpFirst style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$ <span class=SpellE>mpiexec</span> -n 6 -f <span class=SpellE><span class=GramE>nodefile</span></span><span class=GramE> ./</span><span class=SpellE>mpi_hello</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 5 of 6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 0 of 6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 3 of 6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 1 of 6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 4 of 6</span></p>
        <p class=MsoListParagraphCxSpMiddle style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>Hello from processor 2 of 6</span></p>
        <p class=MsoListParagraphCxSpLast style="MARGIN-BOTTOM: 0pt; BACKGROUND: #bdd6ee; mso-add-space: auto; mso-background-themecolor: accent1; mso-background-themetint: 102"><span style='FONT-SIZE: 10pt; FONT-FAMILY: "Courier New"'>mpiu@linuxdistro-001:~$</span></p>
        <h2 style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt"><span style='mso-fareast-font-family: "Times New Roman"'>7.</span><span style='FONT-SIZE: 7pt; FONT-FAMILY: "Times New Roman",serif; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='mso-fareast-font-family: "Times New Roman"'>Clean the environment<o:p></o:p></span></h2>
        <p class=MsoNormal>&nbsp;</p>
        <p class=MsoNormal>One of the biggest advantage of cloud computing is to utilise the pay-as-you-go features of the service. What that means is that once the experiment and exercise is over, the environment could be completely torn-down and it costs nothing to the end-user. </p>
        <p class=MsoNormal>Execute the script shown <a href="mhtml:file://C:\Users\ninadk\Downloads\TR21\IaaSClusterScript\Bare Metal Step By Step Guide.mht#_Removing_the_Linux">here</a> to clean the Azure environment. </p>
        <h2><span style='mso-fareast-font-family: "Times New Roman"'>Appendix<o:p></o:p></span></h2>
        <h3><a name=_Script_to_create></a><span style='mso-fareast-font-family: "Times New Roman"'>Script - Provisioning the Linux cluster<o:p></o:p></span></h3>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'>#<span class=SpellE>CreateLinuxVirtualMachines</span> - In NON AVAILABILITY GROUPS</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'>#azure <span class=SpellE>config</span> mode <span class=SpellE>asm</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># The Subscription name that we want to create our environment in</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>SubscriptionNameId</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"&lt;enter your subscription id here&gt;"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Storage account name. This should BE CREATED BEFORE EXECUTING THE SCRIPT</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>StorageAccountname</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>ubuntuimages</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=SpellE>AffinityGroup</span> name. This should BE CREATED BEFORE EXECUTING THE SCRIPT</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>AffinityGroupName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxdistros</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Network name. This should BE CREATED BEFORE EXECUTING THE SCRIPT</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>VnetName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"nktr21"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=SpellE>Subnetname</span>. This should BE CREATED BEFORE EXECUTING THE SCRIPT</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>SubnetName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxcluster</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Availability Set</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>AvailabilitySetName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxdistro</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Cloud Service name. This service will be created </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>CloudServiceName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxcloudsrv</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Instance size</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>InstanceSize</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"Medium"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Linux Admin Username </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$password</span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"&lt;<span class=SpellE>yourpassword</span>&gt;"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Linux Admin Password</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$username</span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxuser</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Name Prefix of the VM machine name. Numeric counter number is appended to this to create the final </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>LinuxImageNamePrefix</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"linuxdistro-00"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Load the keys for us to login to </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>LoadSettings</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">Import-<span class=SpellE>AzurePublishSettingsFile</span></span> <span style="COLOR: darkred">"<span class=SpellE>NinadKNew.publishsettings</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Important to specify the <span class=SpellE>CurrentStorageAccountName</span>, especially otherwise you might get Storage not accessible error when creating <span class=SpellE>linux</span> machines. </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: blue'>Set-<span class=SpellE>AzureSubscription</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: navy">-<span class=SpellE>SubscriptionId</span></span> <span style="COLOR: orangered">$<span class=SpellE>SubscriptionNameId</span></span> <span style="COLOR: navy">-<span class=SpellE>CurrentStorageAccountName</span></span> <span style="COLOR: orangered">$<span class=SpellE>StorageAccountname</span></span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Stop</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: blue'>Select-<span class=SpellE>AzureSubscription</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: navy">-<span class=SpellE>SubscriptionId</span></span> <span style="COLOR: orangered">$<span class=SpellE>SubscriptionNameId</span></span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Stop</span> </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Get the image from Azure repository that we want to create. <span class=SpellE><span class=GramE>Its</span></span> the Ubuntu 14_04_LTS variant. We can speed up the creation script by caching the name. </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=GramE>the</span> name thus <span class=SpellE>obtianed</span> is 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'>#$<span class=SpellE>UbuntuImage</span> = Get-<span class=SpellE>AzureVMImage</span> | where {($_.<span class=SpellE>ImageName</span> -match 'Ubuntu-14_04') -and ($_.<span class=SpellE>ImageName</span> -match '2015') -and ($_.<span class=SpellE>ImageName</span> -match 'LTS') -and ($_.Label -<span class=SpellE>eq</span> 'Ubuntu Server 14.04.2.LTS')} | Select <span class=SpellE>ImageName</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'>#Write-Host $<span class=SpellE><span class=GramE>UbuntuImage</span></span><span class=GramE>[</span>0].<span class=SpellE>ImageName</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=SpellE>Guid</span> of the image name that we want to create</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>ImageNameGuid</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=GramE>If</span> the service does not exist, we'll create one. </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>GetCloudService</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">Get-<span class=SpellE>AzureService</span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>CloudServiceName</span></span> <span style="COLOR: navy">-Verbose</span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Continue</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span class=GramE><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkblue'>if</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> (<span style="COLOR: darkgray">!</span><span style="COLOR: orangered">$<span class=SpellE>GetCloudService</span></span> )</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>{</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: darkgreen"># <span class=GramE>service</span> does not exist.&nbsp;&nbsp;&nbsp; </span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>CreateCloudService</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">New-<span class=SpellE>AzureService</span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>CloudServiceName</span></span> <span style="COLOR: navy">-Label</span> <span style="COLOR: darkred">"Created from Windows power shell"</span> <span style="COLOR: navy">-Description</span> <span style="COLOR: darkred">'16 June 2015'</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"Return value from creating the cloud service = {0}"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE><span class=GramE>CreateCloudService<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">OperationStatus</span><span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">ToString</span></span></span></span><span class=GramE>(</span>))</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>}</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>PortmapPort</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">2049</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>NfsPort</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">111</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>Portcounter</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">0</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$Counter</span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">1</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Loop to create the Linux machines. </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span class=GramE><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkblue'>do</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>{</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: darkgreen"># Prepend the VM name</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>LinuxImagename</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImageNamePrefix</span></span> <span style="COLOR: darkgray">+</span> <span style="COLOR: orangered">$<span class=SpellE><span class=GramE>Counter<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">ToString</span></span></span></span><span class=GramE>()</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;<span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: darkgreen"># Configure VM by specifying <span class=SpellE>VMName</span>, Instance Size, <span class=SpellE>ImageName</span>,<span class=GramE>&nbsp; and</span> specify <span class=SpellE>AzureSubnet</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>VMNew</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">New-<span class=SpellE>AzureVMConfig</span></span> <span style="COLOR: navy">-Name</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImagename</span></span> <span style="COLOR: navy">-<span class=SpellE>InstanceSize</span></span> <span style="COLOR: orangered">$<span class=SpellE>InstanceSize</span></span> <span style="COLOR: navy">-<span class=SpellE>ImageName</span></span> <span style="COLOR: orangered">$<span class=SpellE>ImageNameGuid</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: darkgreen"># Add the username and password to the VM creation configuration</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>VMNew</span></span> <span style="COLOR: darkgray">|</span> <span style="COLOR: blue">Add-<span class=SpellE>AzureProvisioningConfig</span></span> <span style="COLOR: navy">-Linux</span> <span style="COLOR: navy">-<span class=SpellE>LinuxUser</span></span> <span style="COLOR: orangered">$username</span> <span style="COLOR: navy">-Password</span> <span style="COLOR: orangered">$password</span> <span style="COLOR: darkgray">|</span> <span style="COLOR: blue">Set-<span class=SpellE>AzureSubnet</span></span> <span style="COLOR: orangered">$<span class=SpellE>SubnetName</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: darkgreen"># <span class=GramE>Create</span> and start the VM. Remember, it won't be fully provisioned when the call returns.&nbsp;&nbsp;&nbsp; </span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$Result</span> <span style="COLOR: darkgray">=</span> <span style="COLOR: orangered">$<span class=SpellE>VMNew</span></span> <span style="COLOR: darkgray">|</span> <span style="COLOR: blue">New-<span class=SpellE>AzureVM</span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>CloudServiceName</span></span> <span style="COLOR: navy">-<span class=SpellE>AffinityGroup</span></span> <span style="COLOR: orangered">$<span class=SpellE>AffinityGroupName</span></span> <span style="COLOR: navy">-<span class=SpellE>VNetName</span></span> <span style="COLOR: orangered">$<span class=SpellE>VnetName</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"Created VM Image {0}, return value = {1}"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImagename</span></span><span style="COLOR: darkgray">,</span> <span style="COLOR: orangered">$<span class=SpellE><span class=GramE>Result<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">OperationStatus</span></span></span></span><span class=GramE> )</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$Counter</span><span style="COLOR: darkgray">++</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>Portcounter</span></span><span style="COLOR: darkgray">++</span>; </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>} </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span class=GramE><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkblue'>while</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> (<span style="COLOR: orangered">$Counter</span> <span style="COLOR: darkgray">-le</span> <span style="COLOR: purple">4</span>)</span></p>
        <p class=MsoNormal>&nbsp;</p>
        <h3><a name=_Removing_the_Linux></a><span style='mso-fareast-font-family: "Times New Roman"'>Script - Removing the Linux cluster<o:p></o:p></span></h3>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># <span class=SpellE>CleanLinuxVirtualMachines</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># The Subscription name that we want to create our environment in</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>SubscriptionNameId</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"&lt;your subscription id&gt;"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Cloud Service name. This service will be created </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>CloudServiceName</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"<span class=SpellE>linuxcloudsrv</span>"</span> </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Name Prefix of the VM machine name. Numeric counter number is appended to this to create the final </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>LinuxImageNamePrefix</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: darkred">"linuxdistro-00"</span> </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkgreen'># Load the keys for us to login to </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: blue'>Import-<span class=SpellE>AzurePublishSettingsFile</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkred">"<span class=SpellE>NinadKNew.publishsettings</span>"</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: blue'>Set-<span class=SpellE>AzureSubscription</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: navy">-<span class=SpellE>SubscriptionId</span></span> <span style="COLOR: orangered">$<span class=SpellE>SubscriptionNameId</span></span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Stop</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: blue'>Select-<span class=SpellE>AzureSubscription</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: navy">-<span class=SpellE>SubscriptionId</span></span> <span style="COLOR: orangered">$<span class=SpellE>SubscriptionNameId</span></span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Stop</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$Counter</span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">1</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>AllVmsStopped</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">1</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: orangered'>$<span class=SpellE>OkToRemoveVM</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">0</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span class=GramE><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkblue'>do</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>{</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>OkToRemoveVM</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">0</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: darkgreen"># Prepend the VM name</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>LinuxImagename</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImageNamePrefix</span></span> <span style="COLOR: darkgray">+</span> <span style="COLOR: orangered">$<span class=SpellE><span class=GramE>Counter<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">ToString</span></span></span></span><span class=GramE>()</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"VM Image name = {0}"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImagename</span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>VMPresent</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">Get-<span class=SpellE>AzureVM</span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>CloudServiceName</span></span> <span style="COLOR: navy">-Name</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImageName</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">if</span></span> (<span style="COLOR: orangered">$<span class=SpellE>VMPresent</span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">if</span></span> (<span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Status</span></span></span> <span style="COLOR: darkgray">-<span class=SpellE>eq</span></span> <span style="COLOR: darkred">"<span class=SpellE>StoppedVM</span>"</span> <span style="COLOR: darkgray">-or</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Status</span></span></span> <span style="COLOR: darkgray">-<span class=SpellE>eq</span></span> <span style="COLOR: darkred">"<span class=SpellE>StoppedDeallocated</span>"</span> )</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"{0} VM is either stopped or <span class=SpellE>StoppedDeallocated</span>"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE><span class=GramE>LinuxImagename</span></span></span><span class=GramE> )</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>OkToRemoveVM</span></span> <span style="COLOR: darkgray">=</span><span style="COLOR: purple">1</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">else</span></span> </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"[Stopping] VM {0}"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Name</span></span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>StopVM</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: blue">Stop-<span class=SpellE>AzureVM</span></span> <span style="COLOR: navy">-Name</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Name</span></span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">ServiceName</span></span></span> <span style="COLOR: navy">-Force</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">if</span></span> (<span style="COLOR: orangered">$<span class=SpellE>StopVM<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">OperationStatus</span><span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Equals</span></span></span>(<span style="COLOR: darkred">'Succeeded'</span>))</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>OkToRemoveVM</span></span> <span style="COLOR: darkgray">=</span><span style="COLOR: purple">1</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">else</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"Not able to stop virtual machine {0}, cloud service will not be removed"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Name</span></span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$<span class=SpellE>AllVmsStopped</span></span> <span style="COLOR: darkgray">=</span> <span style="COLOR: purple">0</span>&nbsp;&nbsp; </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">if</span></span> ( <span style="COLOR: orangered">$<span class=SpellE>OkToRemoveVM</span></span> <span style="COLOR: darkgray">-<span class=SpellE>eq</span></span> <span style="COLOR: purple">1</span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Host</span> (<span style="COLOR: darkred">"[Removing] virtual machine {0}"</span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Name</span></span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Remove-<span class=SpellE>AzureVM</span></span> <span style="COLOR: navy">-Name</span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">Name</span></span></span> <span style="COLOR: navy">-<span class=SpellE>ServiceName</span></span> <span style="COLOR: orangered">$<span class=SpellE>VMPresent<span style="COLOR: darkgray">.</span><span style="COLOR: windowtext">ServiceName</span></span></span> <span style="COLOR: navy">-<span class=SpellE>ErrorAction</span></span> <span style="COLOR: blueviolet">Continue</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span class=GramE><span style="COLOR: darkblue">else</span></span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; {</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="COLOR: blue">Write-Warning</span> (<span style="COLOR: darkred">"No <span class=SpellE>Vm</span> <span class=GramE>found "</span></span> <span style="COLOR: darkgray">-f</span> <span style="COLOR: orangered">$<span class=SpellE>LinuxImageName</span></span>)</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; }</span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>&nbsp;&nbsp;&nbsp; <span style="COLOR: orangered">$Counter</span><span style="COLOR: darkgray">++</span></span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'>} </span></p>
        <p class=MsoNormal style="MARGIN-BOTTOM: 0pt; BACKGROUND: #e7e6e6; TEXT-AUTOSPACE: "><span class=GramE><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"; COLOR: darkblue'>while</span></span><span style='FONT-SIZE: 9pt; FONT-FAMILY: "Courier New"'> (<span style="COLOR: orangered">$Counter</span> <span style="COLOR: darkgray">-le</span> <span style="COLOR: purple">4</span>)</span></p>
    </div>
]]></content:encoded>
    </item>
    <item>
      <title>Big Bank Weekend Project</title>
      <link>https://docs.microsoft.com/archive/blogs/ninadk/big-bank-weekend-project</link>
      <pubDate>Thu, 16 Apr 2015 02:28:37 GMT</pubDate>
      <dc:creator><![CDATA[NinadK-MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ninadk/2015/04/16/big-bank-weekend-project/</guid>
      <description><![CDATA[&#160;         &#160;       &#160;    Converting Azure PowerShell scripts to Linux Scripts....]]></description>
      <content:encoded><![CDATA[  <div class="WordSection1">   <p class="Publishwithline">&#160;</p>    <div style="border-top-style: none; border-bottom: #c6c6c6 1pt solid; padding-bottom: 2pt; padding-top: 0cm; border-right-style: none; padding-left: 0cm; border-left-style: none; padding-right: 0cm">     <p class="underline">&#160;</p>   </div>    <p class="PadderBetweenControlandBody">&#160;</p>    <h1><a name="_Toc416864647">Converting Azure PowerShell scripts to Linux Scripts.</a></h1>    <p class="MsoNormal">In one of my recent customer engagements, I was demonstrating the capabilities of <a href="https://azure.microsoft.com/en-gb/solutions/big-compute/">Azure HPC</a> and <a href="https://azure.microsoft.com/en-gb/services/batch/">Azure Batch</a>. During the meeting the customer mentioned that as much as they liked the Windows PowerShell environment, they use Linux for undertaking most of their HPC compute requirements and would like to see the same running in the Linux environments. </p>    <p class="MsoNormal">What it means is it’s time to get the Azure Cross-Platform Command-line interface (Cli) a whirl and with the big weekend break coming up, it was time for a mini-project. </p>    <p class="MsoSubtitle"><strong>Project objective: ‘Convert and successfully execute Windows PowerShell script in the Linux environment’ </strong></p>    <h4>Engagement Constraints: </h4>    <p class="MsoListParagraphCxSpFirst" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">-<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Be as native as possible – meaning shell scripts only and utilising no-browser on Linux or on Windows.&#160; </p>    <p class="MsoListParagraphCxSpLast" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">-<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>No Desktop installation on Linux variants. I personally don’t believe in installing Desktops on Linux servers as it sorts of defeats the purpose. </p>    <h2><a name="_Toc416864648">Migration Script</a> </h2>    <p class="MsoNormal">First let’s take a moment to review the source PowerShell script that needs to be migrated. </p>    <p class="MsoNormal">At a very high level, the script creates six Linux ‘Ubuntu 2015 LTS’ ‘Medium’ instances inside a Virtual network and under a specific Subnet. </p>    <p class="MsoNormal">The complete script, is repeated in here</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen">#CreateLinuxVirtualMachines</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">azure</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: blueviolet">config</span> <span style="color: blueviolet">mode</span> <span style="color: blueviolet">asm</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># The Subscription name that we want to create our environment in</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubscriptionNameId</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;your-subscription-id-guid&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Storage account name. This should already be created</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$StorageAccountname</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;you-storage-account-name&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># AffinityGroup name. This should already exist before the script is executed</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$AffinityGroup</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistros&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Network name. Should already be created</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$VnetName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistronetwork&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Subnetname. Should exists before the script is executed.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubnetName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;Subnet-1&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Availability Set</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$AvailabilitySetName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistro&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Cloud Service name. This service will be created </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$CloudServiceName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;your-cloud-service-name-here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Instance size</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$InstanceSize</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;Medium&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux Admin Username </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$password</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;your password here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux Admin Password</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$username</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxuser&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Name Prefix of the VM machine name. Numeric counter number is appended to this to create the final VM name</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LinuxImageNamePrefix</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistro-0&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Load the certificate keys for us to login to </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LoadSettings</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Import-AzurePublishSettingsFile</span> <span style="color: darkred">&quot;NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Important to specify the CurrentStorageAccountName, especially otherwise you might get Storage not accessible error when creating Linux machines. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Set-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-CurrentStorageAccountName</span> <span style="color: orangered">$StorageAccountname</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Select-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Get the image from Azure repository that we want to create. Its the Ubuntu 14_04_LTS variant. We can speed up the creation script by caching the name. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># the name obtianed is 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$UbuntuImage</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureVMImage</span> <span style="color: darkgray">|</span> <span style="color: blue">where</span> {(<span style="color: orangered">$_</span><span style="color: darkgray">.</span>ImageName <span style="color: darkgray">-match</span> <span style="color: darkred">'Ubuntu-14_04'</span>) <span style="color: darkgray">-and</span> (<span style="color: orangered">$_</span><span style="color: darkgray">.</span>ImageName <span style="color: darkgray">-match</span> <span style="color: darkred">'2015'</span>) <span style="color: darkgray">-and</span> (<span style="color: orangered">$_</span><span style="color: darkgray">.</span>ImageName <span style="color: darkgray">-match</span> <span style="color: darkred">'LTS'</span>) <span style="color: darkgray">-and</span> (<span style="color: orangered">$_</span><span style="color: darkgray">.</span>Label <span style="color: darkgray">-eq</span> <span style="color: darkred">'Ubuntu Server 14.04.2.LTS'</span>)} <span style="color: darkgray">|</span> <span style="color: blue">Select</span> <span style="color: blueviolet">ImageName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Write-Host</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: orangered">$UbuntuImage</span><span style="color: darkgray">[</span><span style="color: purple">0</span><span style="color: darkgray">].</span>ImageName</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># If the service does not exist, we'll create one. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$GetCloudService</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureService</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-Verbose</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Continue</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: darkgray">!</span><span style="color: orangered">$GetCloudService</span> )</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># service does not exist.&#160;&#160;&#160; </span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$CreateCloudService</span> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureService</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-AffinityGroup</span> <span style="color: orangered">$AffinityGroup</span> <span style="color: navy">-Label</span> <span style="color: darkred">&quot;Created from Windows power shell&quot;</span> <span style="color: navy">-Description</span> <span style="color: darkred">'13 April 2014'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;Return value from creating the cloud service = {0}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$CreateCloudService</span><span style="color: darkgray">.</span>OperationStatus<span style="color: darkgray">.</span>ToString())</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$Counter</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: purple">1</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Loop to create the Linux machines. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">do</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Prepend the VM name</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$LinuxImagename</span> <span style="color: darkgray">=</span> <span style="color: orangered">$LinuxImageNamePrefix</span> <span style="color: darkgray">+</span> <span style="color: orangered">$Counter</span><span style="color: darkgray">.</span>ToString()</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Configure VM by specifying VMName, Instance Size, ImageName, AvailabilitySet and specify AzureSubnet</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$VMNew</span> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureVMConfig</span> <span style="color: navy">-Name</span> <span style="color: orangered">$LinuxImagename</span> <span style="color: navy">-InstanceSize</span> <span style="color: orangered">$InstanceSize</span> <span style="color: navy">-ImageName</span> <span style="color: orangered">$UbuntuImage</span><span style="color: darkgray">[</span><span style="color: purple">0</span><span style="color: darkgray">].</span>ImageName <span style="color: navy">-AvailabilitySetName</span> <span style="color: orangered">$AvailabilitySetName</span> <span style="color: darkgray">|</span> <span style="color: blue">Set-AzureSubnet</span> <span style="color: orangered">$SubnetName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Add the username and password to the VM creation configuration</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$VMNew</span> <span style="color: darkgray">|</span> <span style="color: blue">Add-AzureProvisioningConfig</span> <span style="color: navy">-Linux</span> <span style="color: navy">-LinuxUser</span> <span style="color: orangered">$username</span> <span style="color: navy">-Password</span> <span style="color: orangered">$password</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Create and start the VM. Remember, it won't be fully provisioned when the call returns.&#160;&#160;&#160; </span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$Result</span> <span style="color: darkgray">=</span> <span style="color: orangered">$VMNew</span> <span style="color: darkgray">|</span> <span style="color: blue">New-AzureVM</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-VNetName</span> <span style="color: orangered">$VnetName</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;Created VM Image {0}, return value = {1}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$LinuxImagename</span><span style="color: darkgray">,</span> <span style="color: orangered">$Result</span><span style="color: darkgray">.</span>OperationStatus )</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$Counter</span><span style="color: darkgray">++</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">} </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">while</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$Counter</span> <span style="color: darkgray">-le</span> 6)</span></p>    <p class="MsoCaption"><em><font size="1">Figure 1: Migration Source Script<span style="font-family: &quot;Lucida Console&quot;"> </span></font></em></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: white; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">&#160;</span></p>    <p class="MsoNormal" style="background: #e2efd9">Note:</p>    <p class="MsoNormal" style="background: #e2efd9">Script assumes that following entities already exists within the Azure subscription environment – </p>    <p class="MsoListParagraphCxSpFirst" style="background: #e2efd9; margin: 0cm 0cm 8pt 18pt; line-height: 107%; text-indent: -18pt"><span style="font-family: wingdings">§<span style="font: 7pt &quot;Times New Roman&quot;">&#160; </span></span>Valid Azure account: The subscription id of the valid subscription under the account is contained in the variable $SubscriptionNameId&#160; </p>    <p class="MsoListParagraphCxSpMiddle" style="background: #e2efd9; margin: 0cm 0cm 8pt 18pt; line-height: 107%; text-indent: -18pt"><span style="font-size: 8pt; font-family: wingdings; color: orangered; line-height: 107%">§<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span>Affinity group: Name of the affinity group is contained in the cmdlet variable <span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered; line-height: 107%">$AffinityGroup</span></p>    <p class="MsoListParagraphCxSpMiddle" style="background: #e2efd9; margin: 0cm 0cm 8pt 18pt; line-height: 107%; text-indent: -18pt"><span style="font-size: 8pt; font-family: wingdings; color: orangered; line-height: 107%">§<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span>Network: Azure network should be pre-created with a subnet. The VNet name is contained in the variable <span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered; line-height: 107%">$VnetName</span>&#160; and subnet name is contained in the variable <span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered; line-height: 107%">$SubnetName</span></p>    <p class="MsoListParagraphCxSpLast" style="background: #e2efd9; margin: 0cm 0cm 8pt 18pt; line-height: 107%; text-indent: -18pt"><span style="font-size: 8pt; font-family: wingdings; color: orangered; line-height: 107%">§<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160; </span></span>Storage account: Valid storage account to host and create Azure VMs should already exist. The name of the storage account is contained in the variable - <span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered; line-height: 107%">$StorageAccountname</span></p>    <p class="MsoNormal" style="background: #e2efd9">If the cloud service does not exists, script will create one (<span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered">$CloudServiceName</span>) and the virtual machines will be created inside the affinity group (<span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: orangered">$AvailabilitySetName</span>).</p>    <p class="MsoListParagraphCxSpFirst" style="background: #e2efd9; margin-left: 18pt; text-indent: -18pt"><span style="font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span>To connect to my Azure subscription, I use <a href="https://msdn.microsoft.com/en-us/library/dn495124.aspx"><span style="font-family: &quot;Courier New&quot;; color: blue">Import</span>-<span style="text-decoration: none; font-family: &quot;Courier New&quot;; color: blue">AzurePublishSettingsFile</span></a> cmdlet. You will need to execute <a href="https://msdn.microsoft.com/en-us/library/dn495224.aspx"><span style="text-decoration: none; font-family: &quot;Courier New&quot;; color: blue">Get-AzurePublishSettingsFile</span></a> cmdlet first to download the file. </p>    <p class="MsoListParagraphCxSpMiddle" style="background: #e2efd9; margin-left: 18pt; text-indent: -18pt"><span style="font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span>The script uses <a href="https://msdn.microsoft.com/en-us/library/azure/dn495275.aspx"><span style="text-decoration: none; font-family: &quot;Courier New&quot;; color: blue">Get-AzureVMImage</span></a> cmdlet and then filters it to get the name of the VM image that we want to create.&#160; Instead of retrieving the image name, one could instead use the complete name directly instead – ‘<span style="font-family: &quot;Lucida Console&quot;; color: darkgreen">'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB</span>’</p>    <p class="MsoListParagraphCxSpMiddle" style="background: #e2efd9; margin-left: 18pt; text-indent: -18pt"><span class="MsoHyperlink"><span style="text-decoration: none; font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span>Script uses <span style="font-family: &quot;Courier New&quot;; color: blue">New-AzureVMConfig</span>&#160; and <span style="font-family: &quot;Courier New&quot;; color: blue">AzureProvisioningConfig</span> cmdlets to configure the Linux VMs and finally create a Linux VM using cmdlet <span class="MsoHyperlink">New</span><span style="font-family: &quot;Lucida Console&quot;; color: blue">-</span><span class="MsoHyperlink">AzureVM</span></p>    <p class="MsoListParagraphCxSpLast" style="background: #e2efd9; margin-left: 18pt; text-indent: -18pt"><span style="font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span>The script to clean the environment is available <a href="#_Clean-Up_Script">here</a></p>    <h2><a name="_Toc416864649">Create Linux Host and establish connection</a></h2>    <p class="MsoNormal">Now we need to create a Linux host that will be used as a host for running our scripts. We use a <a href="#_Create_Linux_Host">simple script</a> to create the VM. </p>    <p class="MsoNormal">Once the VM has been created and provisioned, we access the provisioned VM by finding out the public port the VM is running and using DNS name to connect. We can find out the public port by using cmdlet <span style="font-family: &quot;Courier New&quot;; color: blue">Get-AzureEndpoint</span> as shown in the following example. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$VMEndpoints</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureVM</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-Name</span> <span style="color: orangered">$LinuxImagename</span> <span style="color: darkgray">|</span> <span style="color: blue">Get-AzureEndpoint</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$VMEndpoints</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">foreach</span>(<span style="color: orangered">$item</span> <span style="color: darkblue">in</span> <span style="color: orangered">$VMEndpoints</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$VMEndpoints</span><span style="color: darkgray">.</span>Name<span style="color: darkgray">.</span>Equals(<span style="color: darkred">'SSH'</span>))</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-host</span> (<span style="color: darkred">&quot;{0}.cloudapp.net:{1}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$CloudServiceName</span><span style="color: darkgray">,</span> <span style="color: orangered">$item</span><span style="color: darkgray">.</span>Port)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoCaption"><font size="1"><em>Figure 2: Get-AzureEndPoint Script</em></font></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: white; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">&#160;</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #e2efd9; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">Note: </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #e2efd9; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">Complete script of the above example is copied </span><a href="#_Get_Public_Endpoints"><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">here</span></a><span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;">.</span></p>    <p class="MsoNormal" style="background: #e2efd9">Outside the virtual network, public DNS name of the VM is made up of <span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;; color: darkred">&lt;your-cloud-service-name&gt; + ‘cloudapp.net’</span></p>    <p class="MsoNormal">The output of the above script shows the DNS name and the public port to connect to the Linux machine. </p>    <p class="MsoNormal">Now we need an SSH client to connect to the Linux VM. I’ll use PuTTY for our example. You can download PuTTY client from <a href="https://aka.ms/putty">https://aka.ms/putty</a>.&#160; Enter the DNS address and port number and click Open as shown in the screen snapshot below </p>    <p class="MsoNormal" style="text-align: center" align="center"><img id="Picture 1" border="0" alt="image3.jpg" src="https://nkimages.blob.core.windows.net/imagecontainer/image001.jpg" width="380" height="367" /></p>    <p class="MsoCaption" style="text-align: center" align="center"><em><font size="1">Figure 3: PuTTY Login screen</font></em></p>    <p class="MsoNormal">When you connect for the first time, you’ll see some security warnings, similar to the ones that get displayed when using a RDP connection. Click continue. </p>    <p class="MsoNormal">Enter username and password credentials on the PuTTY connection window. These are the same credentials that you used when you created the VM. It is important to note that you’d be logging in as <b>pseudo root user.</b> </p>    <p class="MsoNormal">If the login is successful, you would be in the Linux world. Welcome.</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">login as: linuxuser</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@<span style="color: red">&lt;Removed&gt;</span>.cloudapp.net's password:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-31-generic x86_64)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">* Documentation:&#160; https://help.ubuntu.com/</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; System information as of Mon Apr 13 21:31:13 UTC 2015</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; System load:&#160; 0.0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Processes:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 235</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; Usage of /:&#160;&#160; 2.7% of 28.80GB&#160;&#160; Users logged in:&#160;&#160;&#160;&#160; 0</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; Memory usage: 3%&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IP address for eth0: 100.78.2.22</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; Swap usage:&#160;&#160; 0%</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; Graph this data and manage this system at:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; https://landscape.canonical.com/</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160; Get cloud support with Ubuntu Advantage Cloud Guest:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; https://www.ubuntu.com/business/services/cloud</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">0 packages can be updated.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">0 updates are security updates.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">Last login: Mon Apr 13 21:31:14 2015 from <span style="color: red">&lt;Removed&gt;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~</span></p>    <p class="MsoCaption"><em><font size="1">Figure 4: Linux Login Screen</font></em></p>    <h2><a name="_Toc416864650">Install Azure Cross-Platform Cli on Linux Machine</a></h2>    <p class="MsoNormal">All the commands that you would now execute would be at ‘root’ level privileges. To execute commands at elevated privileges, on the command prompt, prefix each command with ‘sudo’ keyword. ‘sudo’ stands for ‘super user do’. To execute a command, you specify the command after this keyword.<span style="font-size: 9pt; font-family: &quot;Lucida Console&quot;"> </span></p>    <p class="MsoNormal">First we need to install the Azure cross-platform Command Line Interface (Cli). The instructions for the same can are available from <a href="https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/">here</a>. </p>    <p class="MsoNormal">First execute two commands to download the latest updates and upgrade the machine. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo apt-get update</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo apt-get upgrade</span></p>    <p class="MsoCaption"><em><font size="1">Figure 5: Linux VM Update and Upgrade</font></em></p>    <p class="MsoNormal">Click [Y] for confirmation to upgrade</p>    <p class="MsoNormal">Next install the Azure cross-platform Cli environment by executing following three commands</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo apt-get install nodejs-legacy<a name="_Clean-Up_Script"></a></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo apt-get install npm</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo npm install -g azure-cli</span></p>    <p class="MsoCaption"><em><font size="1">Figure 6: Install azure-cli</font></em></p>    <p class="MsoNormal">First command installs the compatible node.js environment. Second command installs the azure client library for node. This library provides a Node.js package that makes it easy to consume and manage Azure services. Last command installs the azure cross-platform Cli using npm.</p>    <p class="MsoNormal">Now let’s test the installation. Entering ‘azure’ on the command line should display us the cli banner – as shown. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ azure</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _&#160;&#160;&#160; _____&#160;&#160; _ ___ ___</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">&#160;&#160;&#160;&#160;&#160;&#160;&#160; /_\&#160; |_&#160; / | | | _ \ __|</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #555555">&#160; _ ___</span><span style="color: #00bbbb">/ _ \</span><span style="color: #555555">__</span><span style="color: #00bbbb">/ /| |_| |&#160;&#160; / _|</span><span style="color: #555555">___ _ _</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #555555">(___&#160; </span><span style="color: #00bbbb">/_/ \_\/___|\___/|_|_\___|</span><span style="color: #555555"> _____)</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #555555">&#160;&#160; (_______ _ _)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _ ______ _)_ _</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #555555">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (______________ _ )&#160;&#160; (___ _ _)</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Microsoft Azure: Microsoft's Cloud Platform</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Tool version 0.8.17</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">Display help for a given command</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; help [options] [command]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">Log in to an Azure subscription using Active Directory. Currently, the user can login only via Microsoft organizational account</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; login [options]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">Log out from Azure subscription using Active Directory. Currently, the user can log out only via Microsoft organizational account</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; logout [options] [username]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <span style="color: #00bbbb">Open the portal in a browser</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; portal [options]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Commands:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; account&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your account information and publish settings</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; config&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your local settings</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; hdinsight&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your HDInsight accounts</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; mobile&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Mobile Services</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; network&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Networks</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; sb&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Service Bus configuration</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; service&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Cloud Services</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; site&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Web Sites</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; sql&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your SQL Server accounts</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; storage&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Storage objects</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; vm&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #00bbbb">Commands to manage your Virtual Machines</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Options:</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; -h, --help&#160;&#160;&#160;&#160; output usage information</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; -v, --version&#160; output the application version</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$</span></p>    <p class="MsoCaption"><em><font size="1">Figure 7: Test Azure Cli Installation</font></em></p>    <h3><a name="_Toc416864651">Connecting to Azure Account from Linux Machine</a></h3>    <p class="MsoNormal">There are two ways to connect to the Azure account from the cli environment. </p>    <p class="MsoListParagraphCxSpFirst" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt"><span style="font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Account based authentication: using ‘azure login’ commands</p>    <p class="MsoListParagraphCxSpLast" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt"><span style="font-family: symbol">·<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span>Certificate based authentication: using ‘azure account download’ commands</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ <b>azure login</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Executing command <b>login</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #bbbb00">warn</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Please note that currently you can login only via Microsoft organizational account or service principal. For instructions on how to set them up, please read https://aka.ms/Dhf67j.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">Username: <span style="color: red">&lt;Details Removed&gt;</span>@microsoft.com</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">Password: ************</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">-</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Added subscription <span style="color: red">&lt;Details Removed&gt;</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Setting subscription <span style="color: red">&lt;Details Removed&gt;</span> as default</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Added subscription <span style="color: red">&lt;Details Removed&gt;</span> Subscription</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Added subscription <span style="color: red">&lt;Details Removed&gt;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">+</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <b>login</b> command OK</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ <b>azure logout -u <span style="color: red">&lt;Details Removed&gt;</span>@microsoft.com</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Executing command <b>logout</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; You have logged out.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <b>logout</b> command OK</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ <b>azure account download</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Executing command <b>account download</b></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Launching browser to https://go.microsoft.com/fwlink/?LinkId=254432</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; Save the downloaded file, then execute the command</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bbbb">help</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160;&#160;&#160; account import &lt;file&gt;</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;; color: #00bb00">info</span><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">:&#160;&#160;&#160; <b>account download</b> command OK</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$</span></p>    <p class="MsoCaption"><em><font size="1">Figure 8: Login to Azure from Linux Machine</font></em></p>    <p class="MsoNormal" style="background: #e2efd9">Note: A good comparison between the two approaches of authentication is provided <a href="https://msdn.microsoft.com/en-gb/library/azure/hh531793.aspx">here</a></p>    <p class="MsoNormal">Now one challenge that I encountered with running the azure cmdlets on the Linux environment was that although the second command reported success, as there is no browser installed on the machine, the second command does not work. The Linux machine VM does not have Desktop installed, no browser installed and therefore the certificate file cannot be downloaded. </p>    <h3><a name="_Toc416864652">Cunning Plan – Azure File share.</a> </h3>    <p class="MsoNormal">We would download the certificate file on a Windows client machine, and upload it on a file share and download it onto this Linux VM. </p>    <p class="MsoNormal">We would use Azure Files service to achieve this aim as it provides the ideal – SMB – environment to achieve this. </p>    <p class="MsoNormal">In order to achieve that we need to carry out following steps</p>    <h4 style="margin-left: 36pt; line-height: 107%; text-indent: -18pt">1.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160; </span>Create an Azure File share</h4>    <h4 style="margin-left: 36pt; line-height: 107%; text-indent: -18pt">2.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160; </span>Upload the file to Azure File share </h4>    <p class="MsoNormal">The script to carry out Steps 1 and 2 is copied <a href="#_Creating_Azure_File">here</a>. The script creates the Azure File share by utilising <span style="font-family: &quot;Courier New&quot;; color: blue">New-AzureStorageShare</span><span style="font-size: 16pt"> </span>and <span style="font-family: &quot;Courier New&quot;; color: blue">New-AzureStorageDirectory</span><span style="font-size: 16pt">&#160; </span>cmdlets. </p>    <p class="MsoNormal" style="background: #e2efd9"><strong>Note:</strong></p>    <p class="MsoNormal" style="background: #e2efd9"><a href="https://msdn.microsoft.com/en-us/library/azure/dn167006.aspx">Azure File </a>is currently in preview and you’ll need to request access from the <a href="https://azure.microsoft.com/en-us/services/preview/">azure preview page</a>. <span lang="EN">Azure Files allows Virtual Machines (VMs) in an Azure Data Centre to mount a shared file system using the SMB protocol. </span></p>    <p class="MsoNormal" style="background: #e2efd9"><span lang="EN"></span>Copying and storing the Azure certificate file in an online storage <b><u>poses security risk</u></b>. It is recommended that the share and the uploaded file be closed as soon as the file has been downloaded on to the Linux box. </p>    <h4 style="margin-left: 36pt; line-height: 107%; text-indent: -18pt">3.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160; </span>Mount the shared folder in the Linux machine</h4>    <h4 style="margin-left: 36pt; line-height: 107%; text-indent: -18pt">4.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160; </span>Download the file onto Linux machine</h4>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><a name="_Close_the_azure"></a><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ mkdir Share</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ pwd</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">/home/linuxuser</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo mount.cifs <span style="color: red">//&lt;your-file-storage-name&gt;.</span>file.core.windows.net/linuxshare/share /home/linuxuser/Share -o vers=2.1,username<span style="color: red">=&lt;your-file-storage-name&gt;</span>,password=<span style="color: red">&lt;your-password-key-ending-with ==&gt;</span>,dir_mode=0777,file_mode=0777</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ cp ./Share/NinadKNew.publishsettings ./Script</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ ls -l ./Script</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">total 12</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">-rwxrwxr-x 1 linuxuser linuxuser&#160;&#160; 76 Apr 14 11:16 createvm.sh</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">-rwxrwxr-x 1 linuxuser linuxuser 7503 Apr 14 19:32 NinadKNew.publishsettings</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$</span></p>    <p class="MsoCaption"><em><font size="1">Figure 9: Linux mount file share and download file commands</font></em></p>    <p class="MsoNormal">In the Linux shell, we first create a folder ‘Share’, next we mount the Azure File shared folder on the ‘Share’ folder using mount.cifs command. After the mount has been successful, we copy the file from the Share to the local scripts folder. </p>    <p class="MsoNormal" style="background: #e2efd9">Note: if cifs is not installed on the server, it can be installed using the following command</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ sudo apt-get install cifs-utils</span></p>    <p class="MsoNormal" style="background: #e2efd9">You can un mount the Share using the following ‘umount’ command</p>    <p class="MsoNormal" style="background: #deeaf6"><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">sudo umount /home/linuxuser/Share</span></p>    <h2><a name="_Toc416864653">Create Equivalent UNIX Script</a></h2>    <p class="MsoNormal">Now we are ready to create our cli script.&#160; First let’s create a folder where the script file will reside and create the skeleton shell file using the famous text editor – ‘VI’. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ pwd</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">/home/linuxuser</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ mkdir Script</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~$ cd Script</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ pwd</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">/home/linuxuser/Script</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ echo $SHELL</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">/bin/bash</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ vi createvm.sh</span></p>    <p class="MsoCaption"><em><font size="1">Figure 10: Start Creating UNIX equivalent script -1</font></em></p>    <p class="MsoNormal">Inside the VI editor, insert following line [VI Command <span style="font-family: wingdings">à</span>Esc i] </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb">#!/bin/bash</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #bb00bb">echo</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #bb0000"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #bbbb00">'</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #bb0000">This script will create Linux VMs in Azure subscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #bbbb00">'</span></p>    <p class="MsoCaption"><font size="1"><em>Figure 11: UNIX script inside VI</em></font></p>    <p class="MsoNormal">The first line in the script informs the system that it’s a script file and that the shell to be used for this is /bin/bash. This value is contained in the environment variable $SHELL. </p>    <p class="MsoNormal">Save the script file [VI command <span style="font-family: wingdings">à</span>Esc:wq] and change its mode to indicate it’s an executable. Finally execute the file from the command line. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ vi createvm.sh</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ chmod +x createvm.sh</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ ls -l</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">total 4</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">-rwxrwxr-x 1 linuxuser linuxuser 76 Apr 14 11:16 createvm.sh</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$ ./createvm.sh</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">This script will create Linux VMs in Azure subscription</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #deeaf6; text-autospace: "><span style="font-size: 9pt; font-family: &quot;Courier New&quot;">linuxuser@ubuntuhost:~/Script$</span></p>    <p class="MsoCaption"><em><font size="1">Figure 12: Create and Test Linux Script</font></em></p>    <p class="MsoNormal">The Linux script is divided into two parts. </p>    <p class="MsoNormal">The first parts uses the standard UNIX stream find tools to get the azure image name. The second script creates the six Linux VMs just as the original Windows script did. </p>    <p class="MsoNormal">In the first script, Azure account based authentication is used as that is the only valid option. In the second script, Azure certificate based authentication is used. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb">#!/bin/bash</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #bb00bb">echo</span><span style="color: #c00000"> </span><span style="color: #bbbb00">'</span><span style="color: #bb0000">This script will output the name of the Linux image file</span><span style="color: #bbbb00">'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb">#Login using account subscription and not with certificate login </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #bb00bb">azure</span> <span style="color: #bb00bb">login</span> <span style="color: #bb00bb">-u</span> <span style="color: #bbbb00">'</span><span style="color: #bb0000">&lt;REMOVED&gt;@microsoft.com</span><span style="color: #bbbb00">'</span> <span style="color: #bb00bb">-p</span> <span style="color: #bbbb00">'</span><span style="color: #bb0000">&lt;REMOVED&gt;</span><span style="color: #bbbb00">'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #1f4e79">IMAGENAME </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: #bb00bb">$(azure vm image list | grep </span><span style="color: #bbbb00">'</span><span style="color: #bb0000">Ubuntu-14_04_2</span><span style="color: #bbbb00">'</span><span style="color: #bb00bb"> | awk </span><span style="color: #bbbb00">'</span><span style="color: #bb0000">{print $2}</span><span style="color: #bbbb00">'</span><span style="color: #bb00bb">)</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #bb00bb">echo</span><span style="color: #c00000"> </span><span style="color: #1f4e79">$IMAGENAME</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #bb00bb">azure</span> <span style="color: #bb00bb">logout</span> <span style="color: #bb00bb">-u</span> <span style="color: #bbbb00">'</span><span style="color: #bb0000">&lt;REMOVED&gt;@microsoft.com</span><span style="color: #bbbb00">'</span></span></p>    <p class="MsoCaption"><em><font size="1">Figure 13: UNIX Script 1</font></em></p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: ">Script first logins to the Azure account using cmdlet <span style="font-family: &quot;Courier New&quot;; color: #bb00bb">azure</span><span style="font-family: &quot;Courier New&quot;"> <span style="color: #bb00bb">login</span></span><span style="font-size: 12pt"> </span>. After a successful login, we get the list of all the Azure images and pipe the result to UNIX <span style="font-family: &quot;Courier New&quot;; color: #bb00bb">grep </span>and <span style="font-family: &quot;Courier New&quot;; color: #bb00bb">awk </span>command. Script display’s the captured image name on the console window and then finally logout (<span style="font-family: &quot;Courier New&quot;; color: #bb00bb">azure</span><span style="font-family: &quot;Courier New&quot;"> <span style="color: #bb00bb">logout</span></span>)<span style="font-size: 7pt; font-family: &quot;Courier New&quot;"> </span>from the Azure account. </p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: ">&#160;</p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: ">The output from the first script -</p>    <p class="MsoNormal" style="margin-bottom: 0pt; text-autospace: ">‘<span style="font-size: 9pt; font-family: &quot;Courier New&quot;; background: #deeaf6">b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB</span>’ is the image name of the Ubuntu virtual machine and it’s used in the second script to create all the virtual machines. </p>    <p class="MsoNormal">&#160;</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb">#!/bin/bash</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">echo<span style="color: #bb0000"> </span><span style="color: red">'This script will create Linux VMS in Azure subscription'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">IMAGENAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">SF</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;/home/linuxuser/Share/NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">SUBSID</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">'&lt;your-subscription-id&gt;'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">STORAGEACCNAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;&lt;your-storage-account-name&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">AVAILABILITYSET</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;linuxdistroset&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">AFFINITYGROUP</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;linuxdistros&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">CLOUDSERVICENAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;&lt;your-cloud-service-name&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">VNETNAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;linuxdistronetwork&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">SUBNETNAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;Subnet-1&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">INSTANCESIZE</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;Medium&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">PASSWORD</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;&lt;your-password&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">USERNAME</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">&quot;linuxuser&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb"># Load the certificate file to login to azure account</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">azure account import <span style="color: #bb00bb">$SF</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb"># select the appropriate subscription</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">azure account set<span style="color: #00bbbb"> </span><span style="color: #bb00bb">$SUBSID</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #0000bb"># Let’s select the appropriate storage </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">azure storage account set<span style="color: #00bbbb"> </span><span style="color: #bb00bb">$STORAGEACCNAME</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">FILENAMEPREFIX</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: red">'linuxdistro-0'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: #00bbbb">COUNTER</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">=<span style="color: #bb0000">1</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">while<span style="color: #bbbb00"> </span>[ <span style="color: #bb00bb">$COUNTER</span> -lt <span style="color: #bb0000">7</span> ]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">do</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #00bbbb">TEMPFILENAME</span>=<span style="color: #bb00bb">$FILENAMEPREFIX$COUNTER</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #0000bb"># echo $TEMPFILENAME</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #0000bb"># echo current value of counter is $COUNTER</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">if<span style="color: #bbbb00"> </span>[ <span style="color: #bb00bb">$COUNTER</span> -eq <span style="color: #bb0000">1</span> ]</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">then</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo<span style="color: #bb0000"> Creating first VM</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; azure vm create -n <span style="color: #bb00bb">$TEMPFILENAME</span> -z <span style="color: #bb00bb">$INSTANCESIZE</span> -A <span style="color: #bb00bb">$AVAILABILITYSET</span> -w <span style="color: #bb00bb">$VNETNAME</span> -a <span style="color: #bb00bb">$AFFINITYGROUP</span> -b <span style="color: #bb00bb">$SUBNETNAME</span> <span style="color: #bb00bb">$CLOUDSERVICENAME</span> <span style="color: #bb00bb">$IMAGENAME</span> <span style="color: #bb00bb">$USERNAME</span> <span style="color: #bb00bb">$PASSWORD</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">else</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo<span style="color: #bb0000"> Creating next VM</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; azure vm create -n <span style="color: #bb00bb">$TEMPFILENAME</span> -z <span style="color: #bb00bb">$INSTANCESIZE</span> -A <span style="color: #bb00bb">$AVAILABILITYSET</span> -w <span style="color: #bb00bb">$VNETNAME</span> -b <span style="color: #bb00bb">$SUBNETNAME</span> -c <span style="color: #bb00bb">$CLOUDSERVICENAME</span> <span style="color: #bb00bb">$IMAGENAME</span> <span style="color: #bb00bb">$USERNAME</span> <span style="color: #bb00bb">$PASSWORD</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">fi</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;<span style="color: #00bbbb">COUNTER</span>=<span style="color: #bb00bb">$(($COUNTER+</span><span style="color: #bb0000">1</span><span style="color: #bb00bb">))</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #fff2cc; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">done</span></p>    <p class="MsoCaption"><em><font size="1">Figure 14: UNIX Script 2</font></em></p>    <p class="MsoNormal">We use the downloaded certificate file and consume the cmdlet <span style="font-family: &quot;Courier New&quot;">azure account import</span> to login to the Azure subscription. Next we set the appropriate subscription (<span style="font-family: &quot;Courier New&quot;">azure account set</span>) and azure storage (<span style="font-family: &quot;Courier New&quot;">azure storage account</span>)</p>    <p class="MsoNormal">The above Bash script creates Ubuntu instances using cmdlet <span style="font-family: &quot;Courier New&quot;">azure</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> </span><span style="font-family: &quot;Courier New&quot;">vm create</span>. Script uses normal Bash keywords and constructs to iterate through and create the require number of VM instance. Whilst creating the first instance we pass extra parameter (<span style="font-family: &quot;Courier New&quot;; color: #bb00bb">$AFFINITYGROUP</span>) because the cloud service is not yet created.&#160; </p>    <h1><a name="_Toc416864654">Conclusion</a></h1>    <p class="MsoNormal">&#160;</p>    <p class="MsoNormal">Microsoft Azure cross-platform cli makes it a real breeze to use the Linux shell environment to execute Azure cmdlets. It does not have all the intellisense and debugging support that Windows PowerShell ISE provides but in the hands of a familiar UNIX person, that should not be a deterrence. </p>    <p class="MsoNormal">Proof: - and yes I am aware that I am moving away from my goal of staying away from any GUI – but just to confirm the results, we will use the Azure management portal and see that our Linux instances are up and running. </p>    <p class="MsoNormal"><img id="Picture 2" border="0" alt="image2.jpg" src="https://nkimages.blob.core.windows.net/imagecontainer/image002.jpg" width="360" height="156" /></p>    <p class="MsoCaption"><font size="1"><em>Figure 15: Virtual instance running under service account</em></font></p>    <p class="MsoNormal"><img id="Picture 3" border="0" alt="image3.jpg" src="https://nkimages.blob.core.windows.net/imagecontainer/image003.jpg" width="360" height="304" /></p>    <p class="MsoCaption"><em><font size="1">Figure 16: Virtual instances running under network configuration</font></em></p>    <p class="MsoNormal" style="background: #e2efd9">Note: Please make sure you stop and clean your installation otherwise any they will incur cost to your subscription. The script to clean the environment is provided <a href="#_Clean-Up_Script">here</a>. </p>    <p class="MsoNormal">&#160;</p>    <h1><a name="_Toc416864655"></a>Scripts</h1>    <h2><a name="_Toc416864656"></a><a name="_Clean-Up_Script"></a><a name="_Clean-Up_Script_1"></a></a>Clean-Up Script</a></h2>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># CleanLinuxVirtualMachines</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># The Subscription name that we want to create our environment in</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubscriptionNameId</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;Account subscription id&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Cloud Service name. This service will be created </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$CloudServiceName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;cloud-service-name&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Name Prefix of the VM machine name. Numeric counter number is appended to this to create the final </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LinuxImageNamePrefix</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistro-0&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Load the keys for us to login to </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Import-AzurePublishSettingsFile</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkred">&quot;NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Set-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Select-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$Counter</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: purple">1</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$AllVmsStopped</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: purple">1</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">do</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Prepend the VM name</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$LinuxImagename</span> <span style="color: darkgray">=</span> <span style="color: orangered">$LinuxImageNamePrefix</span> <span style="color: darkgray">+</span> <span style="color: orangered">$Counter</span><span style="color: darkgray">.</span>ToString()</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;VM Image name = {0}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$LinuxImagename</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$VMPresent</span> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureVM</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-Name</span> <span style="color: orangered">$LinuxImageName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$VMPresent</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Status <span style="color: darkgray">-eq</span> <span style="color: darkred">&quot;StoppedVM&quot;</span> <span style="color: darkgray">-or</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Status <span style="color: darkgray">-eq</span> <span style="color: darkred">&quot;StoppedDeallocated&quot;</span> )</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;{0} VM is either stopped or StoppedDeallocated&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$LinuxImagename</span> )</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">else</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;[Stopping] VM {0}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Name)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: orangered">$StopVM</span> <span style="color: darkgray">=</span> <span style="color: blue">Stop-AzureVM</span> <span style="color: navy">-Name</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Name <span style="color: navy">-ServiceName</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>ServiceName <span style="color: navy">-Force</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$StopVM</span><span style="color: darkgray">.</span>OperationStatus<span style="color: darkgray">.</span>Equals(<span style="color: darkred">'Succeeded'</span>))</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;[Removing] virtual machine {0}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Name)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Remove-AzureVM</span> <span style="color: navy">-Name</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Name <span style="color: navy">-ServiceName</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>ServiceName</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">else</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;Not able to stop virtual machine {0}, cloud service will not be removed&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$VMPresent</span><span style="color: darkgray">.</span>Name)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: orangered">$AllVmsStopped</span> <span style="color: darkgray">=</span> <span style="color: purple">0</span>&#160;&#160; </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">else</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Warning</span> (<span style="color: darkred">&quot;No Vm found &quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$LinuxImageName</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$Counter</span><span style="color: darkgray">++</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">} </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">while</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$Counter</span> <span style="color: darkgray">-le</span> <span style="color: purple">6</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen">#Remove the cloud service now</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># only if we were albe to stop all running ones</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$AllVmsStopped</span> <span style="color: darkgray">-eq</span> <span style="color: purple">1</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># is it present</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$CloudServicesPresent</span> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureService</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Continue</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$CloudServicesPresent</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: orangered">$ResultRemoveCloudService</span> <span style="color: darkgray">=</span> <span style="color: blue">Remove-AzureService</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-Force</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">else</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Warning</span> (<span style="color: darkred">&quot;No {0} cloud service found&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$CloudServiceName</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">else</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;Not able to stop virtual machine, cloud service will not be removed&quot;</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoCaption"><em><font size="1">Figure 17: Clean-up Script</font></em></p>    <h2><a name="_Toc416864657"></a><a name="_Create_Linux_Host"></a>Create Linux Host VM</h2>    <p class="MsoNormal">&#160;</p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen">#CreateHostLinuxVirtualMachine</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># The Subscription name that we want to create our environment in</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubscriptionNameId</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;your subscriber id here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Storage account name. This should already be created</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$StorageAccountname</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;portalvhds0mll57sg9hvjd&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Cloud Service name. This service should exist.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$CloudServiceName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;insert-name-of-your-cloud-service-here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Instance size</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$InstanceSize</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;Medium&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux Admin Username </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$password</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;insert your password here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux Admin Password</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$username</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;insert your username here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux image name</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LinuxImagename</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;ubuntuhost&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Load the keys for us to login to </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LoadSettings</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Import-AzurePublishSettingsFile</span> <span style="color: darkred">&quot;NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Important to specify the CurrentStorageAccountName, especially otherwise you might get Storage not accessible error when creating linux machines. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Set-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-CurrentStorageAccountName</span> <span style="color: orangered">$StorageAccountname</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Select-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Get the image from Azure repository that we want to create. Its the Ubuntu 14_04_LTS variant. We can speed up the creation script by caching the name. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># the name obtained is </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$UbuntuImage</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2_LTS-amd64-server-20150309-en-us-30GB'</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Configure VM by specifying VMName, Instance Size, ImageName, AvailabilitySet and specify AzureSubnet</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$VMNew</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureVMConfig</span> <span style="color: navy">-Name</span> <span style="color: orangered">$LinuxImagename</span> <span style="color: navy">-InstanceSize</span> <span style="color: orangered">$InstanceSize</span> <span style="color: navy">-ImageName</span> <span style="color: orangered">$UbuntuImage</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Add the username and password to the VM creation configuration</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$VMNew</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">|</span> <span style="color: blue">Add-AzureProvisioningConfig</span> <span style="color: navy">-Linux</span> <span style="color: navy">-LinuxUser</span> <span style="color: orangered">$username</span> <span style="color: navy">-Password</span> <span style="color: orangered">$password</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Create and start the VM. Remember, it won't be fully provisioned when the call returns.&#160;&#160;&#160; </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$Result</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: orangered">$VMNew</span> <span style="color: darkgray">|</span> <span style="color: blue">New-AzureVM</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Write-Host</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: darkred">&quot;Created VM Image {0}, return value = {1}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$LinuxImagename</span><span style="color: darkgray">,</span> <span style="color: orangered">$Result</span><span style="color: darkgray">.</span>OperationStatus )</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 7pt; font-family: &quot;Lucida Console&quot;">&#160;&#160;&#160;&#160; </span></p>    <p class="MsoCaption"><em><font size="1">Figure 18: Create Linux Host Script</font></em></p>    <h2><a name="_Toc416864658"></a><a name="_Get_Public_Endpoints"></a>Get Public Endpoints of a VM</h2>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># GetPublicEndPointOfaVM</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># The Subscription name that we want to create our environment in</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubscriptionNameId</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt; insert your subscription id here&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Cloud Service name. This service should exist.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$CloudServiceName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt; insert cloud-service-name here &gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Linux image name</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LinuxImagename</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt; insert image name here &gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LoadSettings</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Import-AzurePublishSettingsFile</span> <span style="color: darkred">&quot;NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Set-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Select-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionId</span> <span style="color: orangered">$SubscriptionNameId</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$VMEndpoints</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureVM</span> <span style="color: navy">-ServiceName</span> <span style="color: orangered">$CloudServiceName</span> <span style="color: navy">-Name</span> <span style="color: orangered">$LinuxImagename</span> <span style="color: darkgray">|</span> <span style="color: blue">Get-AzureEndpoint</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$VMEndpoints</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkblue">foreach</span>(<span style="color: orangered">$item</span> <span style="color: darkblue">in</span> <span style="color: orangered">$VMEndpoints</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: orangered">$VMEndpoints</span><span style="color: darkgray">.</span>Name<span style="color: darkgray">.</span>Equals(<span style="color: darkred">'SSH'</span>))</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-host</span> (<span style="color: darkred">&quot;{0}.cloudapp.net:{1}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$CloudServiceName</span><span style="color: darkgray">,</span> <span style="color: orangered">$item</span><span style="color: darkgray">.</span>Port)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Lucida Console&quot;">&#160;</span></p>    <p class="MsoCaption"><em><font size="1">Figure 19: Get Public Endpoints of a VM Script</font></em></p>    <h2><a name="_Toc416864659"></a><a name="_Creating_Azure_File"></a>Creating Azure File Share and uploading file</h2>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># creating Azure file share and uploading the certificate file to it.</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># CreateAzureFileStorageScript</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$SubscriptionName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;Insert-your-Subscription-name-here&gt;&quot;</span> <span style="color: darkgreen"># just go for one subscription</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$LoadSettings</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: blue">Import-AzurePublishSettingsFile</span> <span style="color: darkred">&quot;NinadKNew.publishsettings&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Set-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionName</span> <span style="color: orangered">$SubscriptionName</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen"># Wow this Select-AzureSubscription is more important than anything else. </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: blue">Select-AzureSubscription</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: navy">-SubscriptionName</span> <span style="color: orangered">$SubscriptionName</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Stop</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$StorageAccountname</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;&lt;insert-your-file-storage-name&gt;&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$AffinityGroup</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxdistros&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: darkgray">!</span><span style="color: orangered">$GetStorageAccount</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: darkgreen"># Storage account does not exists, let’s create one</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: orangered">$GetStorageAccount</span> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureStorageAccount</span> <span style="color: navy">-StorageAccountName</span> <span style="color: orangered">$StorageAccountname</span> <span style="color: navy">-Label</span> <span style="color: darkred">&quot;PS Created&quot;</span> <span style="color: navy">-AffinityGroup</span> <span style="color: orangered">$AffinityGroup</span> </span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160; <span style="color: blue">Write-host</span> (<span style="color: darkred">&quot;Storage account {0} created status = {1}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$StorageAccountname</span><span style="color: darkgray">,</span> <span style="color: orangered">$GetStorageAccount</span><span style="color: darkgray">.</span>OperationStatus)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkgreen">#lets get the storage context now</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$AzureSampleShare</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;linuxshare&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$ShareDirectoryName</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span> <span style="color: darkred">&quot;share&quot;</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: orangered">$StorageContext</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> <span style="color: darkgray">=</span><span style="color: blue">New-AzureStorageContext</span> <span style="color: navy">-StorageAccountName</span> <span style="color: orangered">$StorageAccountname</span> <span style="color: navy">-StorageAccountKey</span> (<span style="color: blue">Get-AzureStorageKey</span> <span style="color: navy">-StorageAccountName</span> <span style="color: orangered">$StorageAccountname</span>)<span style="color: darkgray">.</span>Primary <span style="color: navy">-Protocol</span> <span style="color: blueviolet">Https</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: darkblue">if</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;"> (<span style="color: orangered">$StorageContext</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">{</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: orangered">$ExistingStorageShare</span> <span style="color: darkgray">=</span> <span style="color: blue">Get-AzureStorageShare</span> <span style="color: navy">-Name</span> <span style="color: orangered">$AzureSampleShare</span> <span style="color: navy">-Context</span> <span style="color: orangered">$StorageContext</span> <span style="color: navy">-ErrorAction</span> <span style="color: blueviolet">Continue</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: darkblue">if</span> (<span style="color: darkgray">!</span><span style="color: orangered">$ExistingStorageShare</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; {</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: orangered">$ExistingStorageShare</span> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureStorageShare</span> <span style="color: navy">-Name</span> <span style="color: orangered">$AzureSampleShare</span> <span style="color: navy">-Context</span> <span style="color: orangered">$StorageContext</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Start-Sleep</span> <span style="color: navy">-s</span> <span style="color: purple">30</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">Write-Host</span> (<span style="color: darkred">&quot;New Azure Storage Share created, name = {0}&quot;</span> <span style="color: darkgray">-f</span> <span style="color: orangered">$AzureSampleShare</span>)</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: darkgreen"># create a share directory name</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: orangered">$NewAzureStorageDirectory</span> <span style="color: darkgray">=</span> <span style="color: blue">New-AzureStorageDirectory</span> <span style="color: navy">-Share</span> <span style="color: orangered">$ExistingStorageShare</span> <span style="color: navy">-Path</span> <span style="color: orangered">$ShareDirectoryName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; }</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: darkgreen"># upload our file</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: blue">Set-AzureStorageFileContent</span> <span style="color: navy">-Share</span> <span style="color: orangered">$ExistingStorageShare</span> <span style="color: navy">-Source</span> <span style="color: blueviolet">C:\Azure\Linux\NinadKNew.publishsettings</span> <span style="color: navy">-Path</span> <span style="color: orangered">$ShareDirectoryName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: darkgreen"># check that the file has been uploaded. </span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">&#160;&#160;&#160;&#160; <span style="color: blue">Get-AzureStorageFile</span> <span style="color: navy">-Share</span> <span style="color: orangered">$ExistingStorageShare</span> <span style="color: navy">-Path</span> <span style="color: orangered">$ShareDirectoryName</span></span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: #f2f2f2; text-autospace: "><span style="font-size: 8pt; font-family: &quot;Courier New&quot;">}</span></p>    <p class="MsoNormal" style="margin-bottom: 0pt; background: white; text-autospace: "><em><font size="1">Figure 20: Creating Azure File Share and uploading file Script</font></em></p>    <h1><a name="_Toc416864660">References</a></h1>    <p class="MsoListParagraphCxSpFirst" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">1.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160; </span><a href="https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/">Install and configure Azure Cross-Platform Command-Line Interface</a></p>    <p class="MsoListParagraphCxSpMiddle" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">2.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160; </span><a href="https://blogs.technet.com/b/uktechnet/archive/2013/11/12/running-a-remote-desktop-on-a-windows-azure-linux-vm.aspx">Running a remote desktop on Windows Azure Linux VM</a></p>    <p class="MsoListParagraphCxSpMiddle" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">3.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160; </span><a href="https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-linux-use-ssh-key/">How to use SSH with Linux on Azure</a></p>    <p class="MsoListParagraphCxSpMiddle" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt"><span class="MsoHyperlink"><span style="text-decoration: none">4.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><a href="https://channel9.msdn.com/Blogs/Open/Shared-storage-on-Linux-via-Azure-Files-Preview-Part-1">Shared folder on Linux via Azure Files</a></p>    <p class="MsoListParagraphCxSpLast" style="margin-bottom: 8pt; line-height: 107%; text-indent: -18pt">5.<span style="font: 7pt &quot;Times New Roman&quot;">&#160;&#160;&#160;&#160;&#160;&#160; </span><a href="https://blog.kloud.com.au/2014/02/23/best-practices-for-managing-azure-subscriptions-in-windows-azure-powershell-cmdlets/">Best Practices for Managing Azure Subscriptions in Windows Azure PowerShell Cmdlets</a></p>    <p class="MsoNormal"></p>    <p class="MsoNormal"></p> </div>]]></content:encoded>
    </item>
  </channel>
</rss>