Apostol Apostolov

Practical thoughts about software

Changing the Web Hosting Plan of Windows Azure Website

I recently needed to change the Web Hosting Plan of one of my Azure Websites. I keep all my Websites in a single hosting plan so I can manage and scale them more easily. However I accidently created a new website under a new Hosting Plan and because of that the website’s scaling was managed separately from the other sites.

To be able to manage them together I needed to put them in the same hosting plan. Unfortunately Azure websites does not provide this via the management portals at the moment. The only way for now is via Azure PowerShell.

There is actually a tutorial that describes the process of changing the Web Hosting Plan but the last part of it(the one with the hash table) didn’t work so I am posting the commands that worked for me. Substitute all the parameters that are in <angle brackets> with the corresponding values.

First install Azure PowerShell. Then use the following commands to initalize:

Switch-AzureMode AzureResourceManager

Add-AzureAccount

Then select the proper subscription(optional – if we have multiple Azure subscriptions)

Select-AzureSubscription '<name of the subscription>'

Then if we want we could look at the resource group of your websites(you can find the resource group name in the new Azure Portal under Browse>Resource Groups):

Get-AzureResourceGroup <name of resource group>

Then we get the information about the website(the one that we need to move) and set it to a variable(in our case $r)

$r=Get-AzureResource -Name <name of the website> -ResourceGroupName <resource group of the website> -ResourceType Microsoft.Web/sites -ApiVersion 2014-06-08

We can see the values of $r by calling

$r

Then we set only the properties of $r to a new variable $p

$p=$r.Properties

Of Course – we could see the newly set properties with the command

$p

Then we set the properties ‘serverFarm’ and ‘webHostingPlan’ to the corresponding values that we want – the Web Hosting Plan that we need to move to. If you’re not sure what is the name of the plan that you need to move to – we could check it out with the Get-AzureResource  cmlet that we wrote above, executed against a website that is inside the desired Web Hosting Plan.

$p.serverFarm="<name of web hosting plan>";$p.webHostingPlan="<name of web hosting plan>";

And finally it’s time to overwrite the values in our website by passing $p as PropertyObject of the command

$r2=Set-AzureResource -Name <name of the website> -ResourceGroupName <resource group of the website> -ResourceType Microsoft.Web/sites -ApiVersion 2014-06-08 -PropertyObject $p

If there are no errors we could check if the state of the website’s configuration is the desired one by calling

$r2

And that’s all. Now our website is in the same Web Hosting Plan as the rest of the websites and we could manage it more easily!

Tags:

Published at

Originally posted at

Configuring Azure Website Domain

A while ago I wrote about how to configure Azure website’s domain. That information however is a little outdated after the publishing of the new features of Windows Azure. I’ll now explain how to configure a A-record domain name for an Azure Website.

The domain for an Azure website could be configured only if the website is either in Shared on Reserved instance in Azure. So the first thing to setup is that. Go to “Scale” tab in the website’s properties and choose “Shared” or “Reserved” box under “Web Site Mode”.

web-site-mode

After that you must go in the “Manage Domains” button in the bottom of the page  and add the domain name you want to register under “Domain Names” label.

domain-name-and-ip

From this screen you must also copy the IP Address provided under “THE IP ADDRESS TO USE WHEN CONFIGURING A RECORDS” label.

After that you must go to your Domain provider and configure a A-record key that points to the IP you’ve copied from the Azure portal. I’m using a service called DNSimple to manage my domain names which I found through a recommendation by Scott Hanselman on one of his latest podcasts. I find the service very nice. Far better from other providers I’ve used.

The key for the A Record should look like the first row in this picture:

domain-keys

Also you could configure a URL redirect(the second row from the picture above) from your base URL to your “www.” URL like I did so that if someone wants to type “http://apostol-apostolov.com” they’ll be automatically redirected to “http://www.apostol-apostolov.com” or if you want the base URL to be your main one you could configure the base URL as A record and the ”www.” URL as a redirect to you base URL.

And that is all. We’ve now configured a domain with A Record pointing to a Windows Azure Website.

Tags:

Published at

Originally posted at

The experience of Windows Azure websites

Some time ago I wrote about Windows Azure and the experience of hosting configuring an website with a real domain in Azure. The information I posted in that blog post is a little outdated so I thought to update it a bit with more information about the experience I had with Azure since then.

I am using Azure for about  5-6 months now and I’m very pleased with what I get for my money. But let me start from the beginning.

When I started using Azure the only option to hook up a real domain name to a website hosted in Azure was to have a reserved instance and also the only WAY to hookup the domain was to use a CNAME.  So to host my 2 personal apps that only I use and to host this blog meant that I have to pay around 60 €/month for 1 small reserved instance. Now that was a little high so I struggled a bit between paying that rate for a single, not much used website and having the ability to change and deploy the website in seconds.

I was half month paying for reserved instance when I when Scott Gu’s posted the new improvements for Windows Azure. The update consisted of several things, but the ones I cared were the introduction of Shared instance and the ability to hook up a domain name to Shared instance with a A-record. The Shared instance’s cost is 10€/month and the Reserved instance’s cost is around 60€/month. The trick is that with the Shared instance you pay 10€/month once-per-website and the Reserved instance you pay around 60€/month for all your websites.  So if you have more than 6 websites on a Shared instances you may as well buy one Reserved instance for all of them.

With these changes I’m now paying around 10€/month for a Shared instance for my blog and all my personal apps are on free instances(which every account has a limit of 10). So for me the cost dropped from 60€ to 10€ month, and that’s a pretty nice deal for all the features that Azure offers like easy website creation and administration,  one-click deployments from Git and Visual Studio and the one-click scaling of a website on multiple instances.

Windows Azure makes it cheap if you don’t have much traffic(Shared instance) and easy to scale when you start growing and start to become big(multiple Reserved instances). What more do you need?

Tags:

Published at

Originally posted at

Custom domain to Windows Azure website

Disclaimer: The information in this post is a little outdated. Check out the more up-to-date information about configuring Windows Azure Websites with Domain.

Some time ago Windows Azure team posted a new 'version' to the the service.  I was and still am very thrilled about the new features they put in there. I like  the new interface very much and just love the TFS and GIT automatic deployments. Like the Azure team knew what would make the developers happy and more productive and they put it in there.

Naturally I began porting one of my sites(applications) on Windows Azure. I followed the procedure as it was described in the very detailed tutorials. If you haven’t tried it you should. It so natural and easy to use that I makes a big smile on your face.

Then I decided to point my domain to the Windows Azure website. So I searched the web to find some info and there was a good explanation in Azure’s blog. Now let me say – I’m not very good with managing domains etc.  Just a little less than a year ago I bought my first domain and made some tests with it. Never used it much as a whole.

And here was my first disappointment – we CAN point a domain to our hosted sited but only if they’re on a RESERVED instance. It seems that shared instances cannot have a custom domain.  It’s  good that the Azure team wants to fix that and will implement CNAME for shared instances in the future though. Hooray!

So next thing for me was to try switching to reserved mode and trying to attach the domain to a CNAME.  Following the explanation on Azure’s blog  – I made a CNAME configuration on my domain provider. I attached to apostol-apostolov.azurewebsites.net – the app that I was testing the domains with. Then I made so all the subdomains redirect to ‘www’ and I made  ‘www’ to be a CNAME pointing to apostol-apostolov.azurewebsites.net . The configuration looked like that:

cname

And then I typed my www.apostol-apostolov.com and  - well, I hit a wall.

server-error

So now what? I searched a little bit but every article out there had the explanation – make a reserved instance and point the domain with CNAME to the server alias and that is all. Maybe because I have little experience with domains I don’t know what I’m missing.

Finally after I was poking around a couple of hours I figured it out.

hostnames

You have to add the domain you’re pointing to the list of hostnames of your website. And voila! You have a fully functional site with domain in the new Windows Azure.

Now I’m thinking of making a little test  for a week or two on “how much will the reserved instance cost me”. And “how much will Windows Azure make my life easier on a daily basis”.

Tags:

Published at

Originally posted at