ASP.NET Live Website Replication Ideas - asp.net

I have a Dedicated Windows Server 2012 lets call it 'A' where my ASP.NET 4.5 website is up and active on IIS 8. Due to the many downtime issues, I want to now move my website to Azure.
I created an Azure VM with an identical environment and copied all files and database. However I am unable to get the website up and running (2 days now) on the VM.
Is there a way using which I can replicate the exact environment that I had in Server 'A'?

You can copy your existing VM (if it is in VHD format) to Azure. See https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-createupload-vhd/ for more information.
If your server is a physical, you can use something like https://www.microsoft.com/en-us/download/details.aspx?id=42497 to do a conversion, and then upload that to Azure.
Lastly, using services such as chef, puppet, or DSC to ensure that server configurations are standard across machines.

Related

Setting up an IIS server

I need some help here. I have a website in asp.net and a database in my local machine, and I'm setting up a testing enviroment so that I can access the site and the database from outside the local network and make tests. I want to set up a server in my windows 10 using IIS to publish the site, and I already know how to publish a asp.net site through Visual Studio and IIS manager. My only issue now is to make it available outside my network. Is there a easier way of doing this than having to buy a domain and a hosting service?
You could create a free azure app:
https://azure.microsoft.com/en-gb/pricing/calculator/#app-service1
You can run a single website (asp.net) and not need to register a domain it will give you a link publicly available on the web.
Whoops, sorry, the database wouldn't be free however the basic version is not expensive. This is in fact what I run for my own test cases.
In order to host at home, you would need to ensure that you had a static IP address and that port 80 was opened to allow traffic in and out.
https://serverfault.com/questions/1058/how-do-i-set-up-a-web-server-out-of-my-home

Tool to check if all website pages are working without error in ASP.Net?

Presently i am working on a website it has around 50 pages and links. I need to make sure that all the pages are running fine before deploying to production. Is there any tool so that i can check on local machine that no page is displaying an error message of any kind.
Note:- i am making website using ASP.Net, SQL Azure, Window Azure.
You can try this - http://www.relsoftware.com/wlv/
I'm not pretty sure what do you want to check. If it's related with your business logic you have to check by yourself, or by some unit test framework. For windows azure deployment verification, I would like to recommend you to do as below:
1, Since you said you are using Windows Azure and SQL Azure, please have two server for testing. One to simulate the windows azure environment, installed Win08 x64 (R2 if you are using Azure OS 2.x), .NET Fx 4.0 (or 3.5.1 if you are using 3.5 SP1), Windows Azure SDK, IIS with URL rewrite. Do NOT anything else on this machine, for example VS, Win SDK etc. On another machine to simulator SQL Azure, just install SQL Server 08 R2.
2, Deploy your azure application on the first machine using CSPack, CSRUN, etc. and connect to the SQL Server on the other machine, test your application. If you are using storage service, firstly using the local emulator on the first machine.
3, Change to use real azure storage and test.
4, Change to use real SQL Azure and test.
5, Deploy your application on azure staging slot and test.
6, Swap to production slot.
In SDK 1.5 and later the Azure VS Tool have a feature to help you to verify if there's any assemblies you referenced in your project are missing on azure VM. So you can set them as Copy Local = True. There's also a website help you to verify the assemblies http://gacviewer.cloudapp.net/
Not entirely sure on what errors you might want to check, but if you just only want to check for broken links then there is a tool called Xenu that could help you. It will traverse all of the links and send back nice HTML reports on the broken links.
Would ELMHA help here?
http://code.google.com/p/elmah/
Check out Wades post for Azure usage: http://www.wadewegner.com/2011/08/using-elmah-in-windows-azure-with-table-storage/

Windows Azure: Can I just use it like a standard Windows 2008 Server?

I've created an Azure server instance. I've deployed a simple application to it. As part of the deployment process I enabled Remote Desktop Connections.
I have some standard ASP.net applications that run on Windows, is there something to stop me deploying these applications manually to IIS using Remote Desktop. I've read so much about having to migrate standard ASP.net apps to Azure. I don't want to this as we will have customers who will still use Windows Server 2003/2008 so I don't want to have to maintain 2 versions.
Well, as I understand it, in theory you could deploy stuff using remote desktop. But when the instance shuts down/restarts you'll lose it all (unless you've built it into your startup scripts) and have to re-load everything each time. The main reason they suggest you have at least two instances is so that when one shuts down for updates etc there is always at least one other running.
The "Windows Azure Accelerator for Web Roles" project allows you to create an Azure web role which then enables you to use web deploy for all your other web sites - I'm guessing that will be a whole lot better approach and is definitely worth a look. Also, I believe smarx.com is a good place to browse for info and ideas.
Using a startup task and the Azure Bootstrapper you can download, unzip, install almost any kind of 3rd party software that supports either xcopy deployment (just copy the files) or an unattended(silent) install.
Assuming you aren't using Azure storage or anything like that, there shouldn't be any difference with the IIS application. If you are using anything specific to Azure, you can use the RoleEnvironment.IsAvailable to test if you are running inside Azure or not. That will return true for the emulator as well. If you want to use Azure storage from both, you can add the settings in the web.config to use if not running in Azure.

IIS, EC2, Web Farm, Web Deploy and ELB

I'm a developer now developing my startup. I really don't know much about IIS setup. I will host my startup on Amazon EC2. And I want to know how can I scale my application if my traffic increase. I been reading about MS Deploy and Web Farm Framework here: https://serverfault.com/questions/127409/iis-configuration-synchronization-for-web-server-farm . And I want a simple architecture, with not to much configuration. So I been looking an experience with an IIS web farm and Amazon ELBs. And I did not find any one.
So the question is:
It is possible to make a IIS web farm with Amazon ELBs?
Any experience on Ec2? IIS web deploy or WFF and/or without ELBs?
What you recommend for an easy web farm setup?
You can do almost anything you want with IIS on EC2. They are full servers (well window 2k8 datacenter edition) and you can open any ports you need to communicate between servers. Here is an explicit tutorial on how to set up WFF, for example, on EC2.
The question is, are you sure you need to build a web farm? If you simply want to have multiple servers running your code then you can accomplish this without anything more than IIS and the tools that EC2 provides.
You build your app so it uses shared resources (like a session state server, central location for storing user uploaded content), configure a server the way you like it, and capture a server image (AMI). You use this image when you configure AutoScaling to launch new instances based on server metrics (like CPU usage), and they would be automatically added to the load balancer when launched.
The last challenge is ensuring servers launched automatically are running your latest code. You can write a custom program to get the latest code from somewhere (like SVN) on server startup, or you can use something much simpler like Dropbox to handle the synchronization.

How do I setup WebDeploy on Windows 2003 / IIS6?

Webdeploy is an alternative to WebDav, FTP, and FrontPage extensions. It also acts as an alternative to DFS for replicating websites. I found instructions for configuring Windows 2008, but I'm unclear how to set up 2003 especially when multiple sites / IP Addresses are present.
It is possible to install Web Deploy Tool 1.1 on Windows 2003 for IIS6. Generally this tool is used for synchronization between remote/local sources. You can refer to the following article about how to use Web Deploy Tool 1.1 on Windows Server 2003:
Synchronize IIS 6.0 Web Sites
http://learn.iis.net/page.aspx/445/synchronize-iis-60-web-sites/
However, it's not possible to use this tool to enable publishing from Visual Studio 2010 to the webserver. The reason is that this method relies on ‘Web Management Service’, which is newly introduced in IIS 7. This service can be used when there are some users delegated to manage certain sites or applications on the server. However, this service does not exist on Windows Server 2003.
IIS Web Management Service (WMSvc):
http://technet.microsoft.com/en-us/library/cc735010(WS.10).aspx
I use WebDeploy (MSDeploy) on 2003 servers to ensure content, IP addresses, certificates, etc remain the same across a MS NLB cluster. I also created a batch file to automate most of the different functions based on what I want to do (Full Server replication, single website, content only). Here are my notes on using the tool that I posted on my company's internal blog:
MSDeploy (http://www.iis.net/download/webdeploy) is a tool developed by Microsoft to make migrating, deploying, copying, and backing up websites easier. It was developed for IIS 7, but most features work in IIS 6. It can also be used to move a website from IIS 6 to 7 although I have not tested this. Some things to keep in mind when using MSDeploy are:
MSDeploy must be installed on both source and destination servers
The “Web Deployment Agent Service” must be running on both source and destination servers
Application Pools for the website must be created on the destination server before using MSDeploy or it will fail. I think this is fixed in IIS 7, but I am not 100% sure
When deploying a website, MSDeploy will attempt to put the files in exactly the same path on the destination server. If the path doesn’t exist on the destination server (like if the source path is D:\website and the destination server doesn’t have a D: drive it will fail)
The migrated website will have the exact same configuration as it did on the source IIS server. Some settings you might want to change after the move/copy are the website IP address and home directory path. You will need to make those changes manually on the destination server.
The metabase keys will need to be edited on a per-server basis since they are unique for each server (unless you created the sites using MSDeploy, then it uses the same key string across servers). As more and more sites get deployed with MSDeploy, the key strings will become universal for all servers since the metabase keys will be the same on all servers.

Resources