Some basic Azure Questions - asp.net

I'm currently in the process of building our ASP.NET C# 3.5 Web site and I have been looking at Azure as our possible hosting environment and I had a couple of questions that I couldn't really find answers for on their website. I would appreciate if someone could help me get these figured out.
1) If I setup a single cloud server with my ASP.NET application & SQL server database, and the server went down, Would my application automatically get brought over to a new cloud server and continue to run? Or, am I required to manually move the data over to a new cloud server?
2) In the future, when I need to maintain more instances to handle the load, How hard is it to configure the database and sessions to work across all of the instances?
3) Do I still get remote desktop access on the cloud servers?
4) Are there any other cloud hosting provider that you would recommend over Azure for Windows hosting?

Yes, there is automatic failover and backup
You change a number in a config file, and click save
Not currently
I haven't done a ton of research, but Azure is pretty impressive. It all depends on what your needs are.

If you're a powershell guy, you can write a powershell to swap out the config files for you, there's a pretty good walk through to do that here: http://channel9.msdn.com/learn/courses/Azure/Deployment/DeployingApplicationsinWindowsAzure/Exercise-2-Using-PowerShell-to-Manage-Windows-Azure-Applications/
If you're a cmd file guy, you can use the csmanage.exe to swap config files, downloadable here: http://code.msdn.microsoft.com/windowsazuresamples.

Related

Best way to deploy classic asp webapp with sqlite database?

I have a classic ASP front end which serves to collaboratively enter data into a sqlite database, meant to be used later in an android app. I need to deploy this ASP webapp onto an online server with sqlite odbc installed, because the only other option I know is to use my own computer as a server, and I don't think it would be a good idea to keep my fairly modest PC always on for 3 months or so.
The problem is, I can't find any server (preferably free) fitting these requirements.
Any ideas?
For example, is it possible to host just the sqlite file somewhere, and have the asp script (which I will then install on all the users' machines) access it remotely? I've looked around, and I've found a solution (for MS Access), but it involves changing user permissions on the server machine, which I won't be able to do.
Ok, I came up with a good solution:
I imported my database into MS Access (from Access -> external data -> ODBC database -> follow the steps to choose your database). It works well with my ASP front-end after a few minor modifications.
I can now use any ASP hosting service as they all support MS Access.
When I'm done, I can convert it back to sqlite using this excellent program (SQLite2009Pro - it's actually free despite what the name may imply). I've tested the converted database with my android app and it works flawlessly.
Hope this helps anyone who's still stuck using ASP like me.

How to enable User to surf during ASP.NET DLL upload

I am using ASP.NET as the backend for windows phone browser. Sometime I need to make changes on the ASP.NET Pages WHILE users are surfing the website. I want to know how can I provide un-interrupted service to user in such a way they can surf during ASP.NET DLL uploading process:
Assume
say, there are a few ASP.NET (DLL) in production WebServer in such a way that all aspx pages in the one Folder and all DLL(s) in bin-folder.
page(1).aspx , page(1.2).aspx , page(1.n).aspx from DLL(1) and page(2.1).aspx, page(2.2) from DLL(2)
default.aspx from DLL(1)
Question
What will happen if I upload the updated DLL(2) to the production server and leave DLL(1) as it is :
Can user call the deafult.aspx?
Will user still be able to call aspx pages from DLL(1) during the uploading process?
I am a big fan of Martin Fowler's Blue Green Deployment methodology (link).
The idea is simple, have two very similar environments setup (staging & production). You make changes to your code, deploy it on staging, do your testing and then swap staging with production via a simple router configuration.
It has worked great for us so far.
The answer to both the questions is YES
You need Microsoft Web Deployment Tool. Please find more details on below link
How to deploy an ASP.NET Application with zero downtime
Are you hosting within a clustered server environment? If your not, I would be more concerned about a single point of failure rather than interrupting clients briefly during a release.
That said, the update process in such an environment is much better if your fearful of disturbing your users.

How to avoid chaotic ASP.NET web application deployment?

Ok, so here's the thing.
I'm developing an existing (it started being an ASP classic app, so you can imagine :P) web application under ASP.NET 4.0 and SQLServer 2005. We are 4 developers using local instances of SQL Server 2005 Express, having the source-code and the Visual Studio database project
This webapp has several "universes" (that's how we call it). Every universe has its own database (currently on the same server) but they all share the same schema (tables, sprocs, etc) and the same source/site code.
So manually deploying is really annoying, because I have to deploy the source code and then run the sql scripts manually on each database. I know that manual deploying can cause problems, so I'm looking for a way of automating it.
We've recently created a Visual Studio Database Project to manage the schema and generate the diff-schema scripts with different targets.
I don't have idea how to put the pieces together
I would like to:
Have a way to make a "sync" deploy to a target server (thanksfully I have full RDC access to the servers so I can install things if required). With "sync" deploy I mean that I don't want to fully deploy the whole application, because it has lots of files and I just want to deploy those new or changed.
Generate diff-sql update scripts for every database target and combine it to just 1 script. For this I should have some list of the databases names somewhere.
Copy the site files and executing the generated sql script in an easy and automated way.
I've read about MSBuild, MS WebDeploy, NAnt, etc. But I don't really know where to start and I really want to get rid of this manual deploy.
If there is a better and easier way of doing it than what I enumerated, I'll be pleased to read your option.
I know this is not a very specific question but I've googled a lot about it and it seems I cannot figure out how to do it. I've never used any automation tool to deploy.
Any help will be really appreciated,
Thank you all,
Regards
Have you heard of the term Multi-Tenancy? It might be worth look that up to see if that applied to your "Multiverse" especially if one universe is never accessed by another...
See:
http://en.wikipedia.org/wiki/Multitenancy
http://msdn.microsoft.com/en-us/library/aa479086.aspx
UPDATE:
If the application and database is the same for each client (or Tenant) I believe there are applications that may help in providing the same code/db as an SaaS application? ie another application/configuration layer on top that can handle the deployments etc?
I think these are called Platform as a Service (PaaS) applications:
see: http://en.wikipedia.org/wiki/Platform_as_a_service
Multi-Tenancy in your case may be possible, depending on client security requirements, with a bit of work (or a lot of work):
Option 1:
You could use the one instance of the application, ie deploy the site once and connect to a different database for each client. You would need to differentiate each client by URL to isolate content/data byt setting a connection string for each etc. (This would reduce your site deployments to one deployment)
Option 2:
You could create both a single instance of the application and use a single database. You would need to add a "TenantID" to each table and adjust all your code to accept a TenantID to ensure data security/isolation. Again you wold need to detect/differentiate the Tenant based on the URL to set the TenantID for the session used for every database call. (This would reduce your site and database deployment to one of each)

Top 10 gotchas using shared hosting with ASP.NET

I have recently started using a shared-host for my clients so see project progress or to play with a new technology for myself. I seems like every time I deploy a new project that runs fine locally, I run into something new on the shared-host.
Do you have a shared hosting deployment checklist?
What are the common problems you run into when deploying to a shared host?
Medium Trust. If you are developing code to go into a shared host, you should set your local application to run in medium trust otherwise you can almost guarantee you'll get security issues with code that executes fine in full trust but dies in a medium trust environment.
This MSDN article explains about medium trust in more detail:
http://msdn.microsoft.com/en-us/library/ms998341.aspx
They don't always offer you direct access to the database (Enterprise Manager / Management Studio).
You end up using some weird web GUI for creating database entities, which does not accept otherwise valid SQL syntax and you have to update all your queries and stored procedures to accommodate their custom changes and restrictions.
One of mine is file IO permission problems. An example being writing to a file on the web server from ASP.NET. You have to use a provided online tool to allow permission to do more than reads.
No preview site.
That is, a host based path to your web application without actually pointing the DNS to it.
Example:
http://www234.your-shared-host.com/preview/user/bla/default.aspx (don't try it, it's just an example..)
Inconvenient cancellation procedure
In some of the shared hosts I used, I found out that for cancellation I must make a phone call. Nothing over the web, not even an email.
I bet the host thinks most people won't bother calling until it's really needed. They're right.

ASP.NET Web App Distribution

What is the simplest way to distribute an asp.net web application? I tried to look at some of the open source asp.net projects out there to see how they distribute their apps and how they do updates and they seem rather complicated to me (not for myself to perform but for non-technical users). A lot of them entail backing up the entire installed project, deleting specific folders and save parts of their web.config. I am hoping to find a solution that will make the update process specifically as simple as possible.
Thanks.
I am working on a project with a similar requirement now. We decided to use WiX to create an installer that can be run on the server or machine where the site is installed. WiX is incredibly powerful, but takes a bit to get the hang of.
There are plenty of other open source, and paid installer technologies as well. Here is a post with some info on a few.
CommunityServer provides a setup msi that will create a virutal directory, generate the SQL database and populate it with default data. Updating for point releases though is still a manual process involving an update.sql file and having everyone download then merge binary and static file changes.
They probably could have created an update msi too, but because so many people customize CommunityServer, it is probably better to let people merge changes themselves.
Do you mean in terms of breaking up the functionality into tiers that could be handled on separate machines, e.g. having 3 servers for a 3-tier architecture where one is the DB server, one handles middleware and the other handles the requests in ASP.Net? Another point here would be in going from a web server to multiple web servers in terms of scaling up.
Or are you referring to deployment?
It's a web application, man. Serve it publicly, require registration, and move on. Isn't that the point of the web application?

Resources