the next door (so called) geek

@rakkimk | your next door geek | friend | blogs mostly on technology, and gadgets.

Azure Powershell examples – Create VM with VNet, custom VHD name

Microsoft Azure Portal gives you a lot of flexibility in terms of creating the VMs, to choose the gallery images, from your custom images, add them to Virtual Network, etc. There are a few features that are available only in Azure Powershell for now. For example, if you want to give a custom name for your VHD file that would be created for the VM that holds your OS drive, you need to use Azure Powershell only at this time.

You can use New-AzureVMConfig cmdlet to create a new VM config, and specify the -MediaLocation  parameter to specify the name of the VHD file that you want to be created for this VM. If you don’t specify the name, then you would see a random named VHD file created in your storage account that is set as the storage for the your Subscription. You can use the Set-AzureSubscription cmdlet to set the current storage account name with the -CurrentStorageAccountname parameter.

Set-AzureSubscription -SubscriptionName <sub-name> -CurrentStorageAccountName <storageaccountname>

However, if you want to name your VHD name yourself, you could choose to use the -MediaLocation parameter in the New-AzureVMConfig cmdlet. Here is a quick example:

$vmconfig = New-AzureVMConfig -Name "<vm-name>" -InstanceSize ExtraLarge -ImageName <image-name> -MediaLocation “” | Add-AzureProvisioningConfig -Windows -AdminUsername <adminname> -Password <password> | Set-AzureSubnet ‘Subnet-1’

$vmconfig | New-AzureVM -ServiceName "<service-name>" -VNetName "<vNet-name>" -Location “<Geo location Name>”

Hope this helps!

Azure xplat CLI tool 0.8.10 released with Reserved IP features

Today, a new version (0.8.10) of the Azure CLI xplat tools is released, and you can download it from here. This new version has the support for the Reserved-IP, both for creating the Reserved IPs, as well as creating new VMs with the reserved IP. Here are the quick commands:

Create a reserved IP address

azure network reserved-ip create [options] <name> <location>

Create a new VM using the reserved IP

azure vm create --reserved-ip ‘reserved-ip-name’ <dns-name> <image> <user-name> [password]

This feature was asked by one of our customers here. Azure SDK tools team did ship it with the new version now, impressive turn around time. Great example of listening to customer feedback, and acting more quickly. Kudos to the entire team!

Hope this helps!

Running LogParser directly on Azure Websites console

I saw some extra traffic on my website last week, and as an old school IIS guy I wanted to run Log Parser against my website logs. In Azure Websites, the traditional IIS logs are stored at %home%\Logfiles\http\RawLogs, those are of W3C format. Azure Web sites now has a lot of cool Site Extensions like ‘Analog HTTP Log Analyzer’, ‘IIS log file analyzer’ which gives you a report based on your website logs. However, there are certain times you want to run the log yourself running custom queries.

I wanted to run the sweet old LogParser against these logs, and started downloading the logs from the %home%\Logfiles\http\RawLogs. I was thinking why not run LogParser right in the box that’s hosting my Web site, since I’ve got the Kudu console, also from the new Azure Portal (preview) (cmd/powershell). Viola! I transferred the LogParser installation folder from my local machine (C:\Program Files (x86)\Log Parser 2.2) to my Azure Website (under D:\home\Diagnostics\LogParser), and it just worked!



Now, I can run any custom logparser script that I’m used to right inside the Kudu console, or from the new Azure preview Portal. Saves a lot of time, and of course bandwidth to download those files Smile

Learning Azure Service Management REST API through Powershell, and Azure CLI tools

Azure Service Management REST API is used by all the public tools provided by Microsoft to manage your Azure Subscription – Portal, New Portal, Powershell, X-Plat CLI. You can use the same APIs to build your own tools that would manage your Azure Subscription. Sometimes, it is little difficult to bring up all the necessary information needed to be passed on to the REST API call. MSDN documentation of all these REST APIs has all the information that you need. And, there are sometimes, you might need more help.

Read the complete post in my team blog.

Unable to setup AutoScale for Virtual Machines from the Azure Management Portal

You can set up AutoScale for your Cloud Services, Virtual Machines, Web Sites from the Azure Management Portal. For Virtual Machines, autoscale can be configured for each availability set. You can setup AutoScale for your availability set only if:

  • You have only ‘Standard’ VMs in your Availability Set. Basic VMs cannot participate in AutoScaling.
  • Your ‘Standard’ VMS are of same size.


I just posted a new blog in my new team’s MSDN blog. Read the complete post here.

Stay updated on Microsoft Azure - blogs, service status, news

Everyone wants to know what’s happening on their area of interest. Being up to date is a necessity in this new world of Cloud Computing, where you see various things happening every minute, new services getting released, old services getting updated with incremental changes, announcements, price reductions, and whole a lot more. I’ll try to list down a few ways in which you could be stay updated on various things around Microsoft Azure Platform.

Blogs for Microsoft Azure

I’m pretty sure I’m missing many other blogs. If you have any other in your list, post it via the comments below. I’ll update the post. How are you going to read these blogs is up to you. I personally subscribe to all of them in my favorite RSS reader application, NextGen Reader available for both Windows and Windows Phone. Of course, if you aren’t aware, your favorite email client, Office Outlook could do for your subscriptions too. You could also like Microsoft Azure on Facebook to see the updates in your FB feed.

Videos on Microsoft Azure

Azure Friday, and Tuesdays with Corey are certainly my favorites. You could subscribe it as an RSS feed too, or in any of your favorite podcasts application. Did I say that I watch a few of these in my TV? Yes, I did.

What are your feedback channels?

The awesome product is always in the making. Products gets better with the community feedback. Microsoft Azure has the general feedback site where you could submit your feedbacks. I’m pretty sure various teams at Microsoft looks, and act on these feedbacks.

Of course, various folks are in Twitter. While not an official channel, you have a great chance to be updated on their online updates, a few related to technology, I should warn you ;) Find them yourself, and follow. I do follow a lot of people. David Ebbo, Azure Websites Development Lead has created this twitter list of people from Websites team. You could subscribe to the list too. You could also search for #azure in Twitter lists to see more of those.

Where can you seek help on Microsoft Azure?

For online forum support from the experts, you could always reach out to sites like StackOverflow, or MSDN Forums. While not an official site, here is one which you could use to see the various features and their support status. For Azure Support Options, you can see your options here. Depending on the support plan that you choose, you could get a support person like me directly to talk to you over phone/email to answer your questions, solve your technical problems, help you with migrating your applications to Microsoft Azure. Let me know if you need any help in running your applications in Microsoft Azure! @rakkimk is my twitter handle if you want to send me a quick tweet.

Alright! Stay updated. Dance now :-)

What are your options to host your web application with Microsoft Azure?

Microsoft Azure is growing. All it’s services are getting huge adoption. Currently, there are 3 types of Microsoft Azure services that our customers can use to host their web applications.

    1. Hosting your web application inside IIS, from Azure Virtual Machine.
    2. Hosting as a Web Role using Cloud Services.
    3. Hosting as a Azure Website.

I’ve tried all the above for my personal hosting needs, and I thought of putting this little page that might lists most (but not all) features associated with each service, and what you can do. I’m not going to suggest you which one to use for your hosting needs, because all these 3 offerings are created for specific set of customers with specific set of needs. Depending on how much you want to pay, versus how much control that you need, you could select one of these. Here is one more blog which does comparison of features available.

Hosting your web application inside IIS, from Azure Virtual Machines

This service offering gives you all the power that you had with your on-premises deployments. You own the VM, so you do own the updates to the VM as well. You manage the host names inside IIS, you have to setup the host header within IIS, just like you do in your on-premises hosting. It’s your box. Anything that runs perfectly in your corporate server, it should run here. So, if you have any additional software that you need to install, and manage the updates to the Operating System yourself, this is it! Go for it. At the time of writing, a standard Medium VM instance (2 x 1.6GHz CPU, 3.5GB RAM, 490GB Storage) will cost you $0.18/hr, or $133.92/month.

Hosting as a Web Role using Cloud Services

Hosting as a web-role, cloud service saves you from managing the Operating System updates. Still, you own the application – you could RDP to the VMs, and perform anything that you might do in an on-premises server, only thing to remember is these are stateless Virtual Machines allocated to you. So if you stop, and start your deployment, you might be allocated a different VM, and so on. Here, you own the code, application updates, etc, but leaving the OS updates to Microsoft. At the time of writing, the same standard Medium VM instance (2 x 1.6GHz CPU, 3.5GB RAM, 490GB Storage) will cost you $0.16/hr, or $119.04/month.

Hosting as a Azure Website

Azure Websites is another one way that you could host your websites with Microsoft Azure. It is so far the easiest way to host the websites, and you don’t have to worry about the Operating System updates. To some extent, you also need not to worry about your Application Updates, since there are ways to connect your application deployment to your source control, or even Dropbox folder that will sync to the production. It has one click swap to production vs staging slots, and many more cool features. The newest WebJobs adds more background processing power to your websites. It’s like adding a new Worker Role to your existing Cloud Services offering, only that adding WebJobs doesn’t cost you anything extra since that runs in the same machine as your website. At the time of writing, the same standard Medium VM instance (2 x 1.6GHz CPU, 3.5GB RAM) will cost you $0.20/hr, or $148.80/month.

For all your pricing related queries, try this page in the official site. There are various tier offerings that you should take a look, which would match your needs, and the budget.

Hope this helps!

Auto Install IIS in the Microsoft Azure VM that you are creating

The world is moving fast, actually faster! You too want to do things faster, right? Why wait until the VM is created, provisioned, available over RDP, login, etc to do a few initial stuff. Of course, you can upload your custom VM image, and bring up a Virtual Machine from the image, but few times you may also want to do it afresh.

In TechEd 2014, Scott announced a lot of updates to Microsoft Azure. One of my favorite is the ability to run custom scripts on VM creation. Yeah, it’s more like your startup scripts that you are used to, but trust me, you will save a lot of times in doing a few repetitive things that you might want to do with your deployments.

To do this, first write a simple powershell script to install the IIS role (along with what all features you might want to have), and save it as a ps1 file in the local disk, or you can upload to your Azure Storage, and pull it from there. The later step is better, so that you don’t need to rely on the local disk to have your scripts repository.

In my case, I just had the below command in my install.ps1 script file:

Add-WindowsFeature Web-Server –IncludeAllSubFeature

This installs all the sub features under the Web-Server. Security Statement : You should choose to install only those that you need, so that you reduce the surface area for the updates/attacks. Now, using this script is just simple from the Portal. You can choose to install the VM agent first, and then choose the “Custom Script” option, and choose the file that has the installation scripts. Here, you can be fancy. You can do all your other configuration stuff like opening firewall ports, changing website path, etc. It’s your VM. You own it!


Hope this helps! I’ll try to work on a few useful powershell scripts for your web-server scenario, and post it later. Keep coming!

Microsoft Azure. Rock on.

Azure Websites SCM site updated to have Single Sign-on

If you haven’t noticed, your Azure Website’s SCM site has been updated to work with Azure Single Sign-on. Earlier, it was prompting for a basic authentication prompt where you enter your publishing credentials, but now, you can just login using your Microsoft Account which you are using for your Azure Subscription.

For example, if I go to my site https://<mysite>, it shows me the below:


If I’m already logged into my Microsoft Account, say, I’m already on the Azure Management Portal, I don’t even see this if I’m going to the SCM site. It takes directly into the SCM site. However, in case if you need the basic authentication, you can append /basicauth in the url, like https://<yourwebsite> to get the basic authentication prompt.

Azure Websites – Viewing Site Configuration files from Kudu

Azure Websites Paas offering from Microsoft gives you more power to you. You could change a few default configurations that come with the platform by various means, for example, for PHP you can set a few settings in .user.ini, for any custom values for ApplicationHost.config, you can use XDT transforms. There are a lot of times, you want to check what are the default configuration files that are used for your Azure Website. You could easily get those files from the Kudu Console. To access the Kudu Console, navigate to, and login with your deployment credentials.

Once you are in the site, click on “Debug console” menu, and choose “CMD”, or Powershell. Both should open a file explorer, and a console window below. From the file explorer, you can click on the “Site Root” icon, the middle one, and then click on the “Config” folder.


This is the hidden place (well, not anymore) where you will find all the configuration files related to your website instance. So, you have there your applicatiohhost.config file, the rootweb.config file, and also the PHP.ini files for various PHP versions available for the website.

You could either view the file right there by clicking on the could download the file by clicking on the clip_image004 icon. Ofcourse, the below console you see there is powerful too. You could try your favorite command line utility in there. For example, I want to print out the last 10 lines of the configuration file.


And, yes, you can edit a few files right from this Kudu as well.

Well, you get the point! Have fun.