<?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>Azure Cloud</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ileong/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ileong/feed.xml</link>
    <description>Useful tips and thoughts</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:44:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Autoscaling using custom image</title>
      <link>https://docs.microsoft.com/archive/blogs/ileong/autoscaling-using-custom-image</link>
      <pubDate>Wed, 22 Feb 2017 14:33:47 GMT</pubDate>
      <dc:creator><![CDATA[I_vanl]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ileong/?p=55</guid>
      <description><![CDATA[With recent announcements like Managed Disks and Images, I thought it would be cool to put a script...]]></description>
      <content:encoded><![CDATA[With recent announcements like Managed Disks and Images, I thought it would be cool to put a script together. It will provision a VM Scaleset using a custom image that is captured from an existing server with existing applications and add autoscaling to it!

The general steps are to
<ol>
 	<li>take a copy of the existing virtual machine. I use Azure Storage Explorer as my favourite tool.</li>
 	<li>run sysprep and generalise it. "Sysprep /generalize /shutdown /oobe"</li>
 	<li>run the powershell to set it generalise.
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Set-AzureRmVm -ResourceGroupName $rgName -Name $vm.Name Generalized</p>
</li>
 	<li>In Azure Portal, Images, create a new image pointing it to the generalised VM.</li>
 	<li>in Azure Portal, Templates (Preview), add the attached custom deployment template and deploy it</li>
</ol>
Once the VM Scaleset is provisioned, you can see the Overview for the autoscaling information.

RDP into the VM using the public IP address shown but set the port to 50000.

Then download a CPU Stress tool and run it. After a few minutes, autoscaling will provision more instances.

This is a <a target="_blank" href="https://msdnshared.blob.core.windows.net/projects/vmsscustomimage.json">POC script</a> so feel free to modify it.

Let me know if you have any questions.

-- I-van;]]></content:encoded>
    </item>
    <item>
      <title>Renaming a vhd or blob file</title>
      <link>https://docs.microsoft.com/archive/blogs/ileong/renaming-a-vhd-or-blob-file</link>
      <pubDate>Thu, 18 Feb 2016 18:17:11 GMT</pubDate>
      <dc:creator><![CDATA[I_vanl]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ileong/?p=41</guid>
      <description><![CDATA[Here is another useful script I use when the portal or Storage Explorer doesn't have the ability to...]]></description>
      <content:encoded><![CDATA[Here is another useful script I use when the portal or Storage Explorer doesn't have the ability to rename files. Remember to replace all the highlighted in red and italics with the correct names. Warning: This creates a copy with the new name and deletes the original blob.

<hr />

#obtain the storage account context
$Context = New-AzureStorageContext -StorageAccountName "<span style="color: #ff0000"><em>storage1</em></span>" -StorageAccountKey "<span style="color: #ff0000"><em>ExampleKeyk1213hi2</em></span>" #obtain the access key from settings of the storage account.
Start-AzureStorageBlobCopy -SrcContainer "<span style="color: #ff0000"><em>SourceContainerName</em></span>" -DestContainer "<span style="color: #ff0000"><em>DestinationContainerName</em></span>" -SrcBlob "<span style="color: #ff0000"><em>SourceVMOS.vhd</em></span>" -DestBlob "<span style="color: #ff0000"><em>NewVMOS.vhd</em></span>" -Context $Context -DestContext $Context
Remove-AzureStorageBlob -Container "<span style="color: #ff0000"><em>SourceContainerName</em></span>" -Context $Context -Blob "<span style="color: #ff0000"><em>SourceVMOS.vhd</em></span>"

<hr />

&nbsp;
<div id="disclaimer"><span class="descriptionSubSectionTitle"> Disclaimer:</span> The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.</div>]]></content:encoded>
    </item>
    <item>
      <title>Registering and launching a VM from a vhd file</title>
      <link>https://docs.microsoft.com/archive/blogs/ileong/registering-and-launching-a-vm-from-a-vhd-file</link>
      <pubDate>Thu, 18 Feb 2016 18:03:40 GMT</pubDate>
      <dc:creator><![CDATA[I_vanl]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ileong/?p=32</guid>
      <description><![CDATA[Once a vhd file is uploaded or migrated to the target blob container, you may be wondering how to...]]></description>
      <content:encoded><![CDATA[Once a vhd file is uploaded or migrated to the target blob container, you may be wondering how to register and launch the VM. Here is the powershell script which I use. This method doesn't require sysprep.

Disclaimer: Note that there are no warranties and these and other scripts are shared for personal use only. If you do find any improvements or bugs, please provide comments and feedback.

Steps: Launch Powershell ISE. Copy and paste the script below. Replace the highlighted text in red with the correct names before executing the script.

<hr />

Login-AzureRMAccount
Select-AzureRmSubscription -SubscriptionName <span style="color: #ff0000"><em>SubscriptionName</em></span>
$resourceGroupName = "<span style="color: #ff0000"><em>ResourceGroupName</em></span>"
$location = "<span style="color: #ff0000"><em>australiaeast</em></span>" #this is an example location for Australia East region
$vmName = "<span style="color: #ff0000"><em>TestVM</em></span>" # Specify the VM name
$virtualNetwork = "<span style="color: #ff0000"><em>VNet1</em></span>" # Specify the virtual network name
$publicIPAddressName = "<span style="color: #ff0000"><em>TestVMPIP</em></span>"
$networkInterfaceName = "<span style="color: #ff0000"><em>TestVMNIC</em></span>"
$vmSize = "<span style="color: #ff0000"><em>Standard_A1</em></span>"
# Specify the OS disk
$diskName = $vmName  #suggestion is to use the VM name
$osDiskUri = '<span style="color: #ff0000"><em>https://storage1.blob.core.windows.net/vhds/TestVMOS.vhd</em></span>' #you can obtain this from properties of the vhd file using Storage Explorer
$vnet = Get-AzureRmVirtualNetwork -Name $virtualNetwork -ResourceGroupName $resourceGroupName
$pip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName -AllocationMethod Dynamic -Location $location -Name $publicIPAddressName
$nic = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName -Location $location -Name $networkInterfaceName -PublicIpAddressId $pip.Id -SubnetId $vnet.Subnets[0].Id
$vm = New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic.Id
$vm = Set-AzureRmVMOSDisk -VM $vm -Name $diskname -VhdUri $osDiskUri -CreateOption Attach -Windows
$result = New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $location -VM $vm

<hr />

&nbsp;
<div id="disclaimer"><span class="descriptionSubSectionTitle"> Disclaimer:</span> The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.</div>
&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Moving, copying and uploading VHDs between Azure Subscriptions</title>
      <link>https://docs.microsoft.com/archive/blogs/ileong/hello-world</link>
      <pubDate>Tue, 09 Feb 2016 23:13:15 GMT</pubDate>
      <dc:creator><![CDATA[I_vanl]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/ileong/?p=1</guid>
      <description><![CDATA[Good day,

One of the easiest tools I found to move, migrate or upload VHDs between different or...]]></description>
      <content:encoded><![CDATA[Good day,

One of the easiest tools I found to move, migrate or upload VHDs between different or up to storage accounts is Storage Explorer found at the bottom of the page at https://azure.microsoft.com/en-us/downloads/. Its a simple copy and paste from source to destination blob vhds containers.

With this tool, you can right click to Get Shared Access Signature on the blob file to provide a time limited secure link to download the file for example.

Next up is I will share a powershell script on registering and launching the VM once you have migrated the vhd file to the target container.

&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>