C#, .Net and Azure
This website is now officially up and running (I copied some valuable older posts to make it less empty).
Instead of using a virtual machine with IIS I tried using azure web apps to host the website this time.
It's a lot less hassle than setting up a VM with IIS and there's even a free tier (up to 10 free web apps).
However if you want SSL or custom domain names (instead of <name>.azurewebsites.net) you'll have to use the paid version.
The setup was mainly painless thanks to this tutorial.
I did run into an issue with Powershell not wanting to install the azure component.
I initially followed this tutorial to setup azure in powershell.
But I had to execute these commands in order:
Install-Module AzureRM Install-Module Azure Install-Module Azure -AllowClobber
Otherwise the installer would fail with "cannot download from url 'some microsoft url'".
After the short hickup I was able to setup run through the remaining tutorial easily.
Since my page is statically generated all I had to do was upload it.
The only "dynamic" component of my page was the 404 page and using the web.config with "customErrors" section (like I always did with IIS) did not work for me. Instead I always got the internal server error:
"The resource you are looking for has been removed, had its name changed or is temporarily unavailable."
After a bit of messing around I got it to work with the httpErrors section as described here.
The web.config looks like this:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <httpErrors errorMode="Custom"> <clear /> <error statusCode="404" path="/404/" responseMode="ExecuteURL" /> </httpErrors> </system.webServer> </configuration>