Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Hosting nancy with azure
Hosting Nancy with Azure
This almost isn't worth writing, since there is little extra work to do in order to host Nancy on Azure. Azure VMs now run full-trust IIS and so are capable of running just about anything IIS can locally. However there are some Azure specific things you have to do to actually create an Azure project and deploy it to the cloud. While these things are not Nancy specific, I will post the walkthrough here for the convenience of people who want to try it.
First set up Nancy to run under ASP.NET as documented . Again there is nothing special to deploying ASP.NET sites to Azure as it supports full IIS deployments. I'll briefly describe the steps but anyone deploying to Azure for the first time should be sure to walk through the Azure Cloud Service and ASP.NET on how to setup an Azure project and deploy it.
These steps should help you set up your project to run locally on your DevFabric and once that's working you'll be ready to deploy Nancy to Azure.
- Create an Microsoft Azure Cloud Service project in your Solution
- Add an ASP.NET Web Role Project
- Configure the Nancy to run under ASP.NET hosting exactly as outlined here
- Profit!!! (Seriously, that's it)
That's all there is to setting up, now first write a little hello world handler and map it to
Get["/"] (feel free to copy the source code from the sample included with Nancy). Press F5 and the Azure DevFabric should spin up and should open your web browser to your main page.
If everything is working you should see your Hello World result and we are now ready to deploy. Again refer to the Windows Azure Training Kit on how to deploy to your Windows Azure account (of course you need to have an account first).
I apologize, as this may seem that this isn't a step-by-step walkthrough, but I promise there is no tricks or gotchas to look out for (at least that I've seen).
Hosting Nancy on "Azure WebApp"
If you're trying to host it on the Azure WebApp (it's not Cloud Server, but a kind of virtualized web application server), the previous steps aren't necessary. Here are the steps which will deploy it to Azure WebApp
- Right Click on your Nancy Project
- Click "Publish"
- ??? (VS will do it's magic here)
- Profit!! (Seriously, that's it)