ASP.NET Web Forms Applications on Azure (or any cloud hosting) - asp.net

This is a pretty vague question but I'm struggling a bit to get my head around what is involved in cloud hosting.
Say for instance if I had an asp.net web app using:
- Webforms
- linq to sql
- an sql server database
- Calling some external restful webservices
What would need to be done to host it on a cloud service?
Are there specific code changes that would be required and do these need to be considered in the initial design?
Can sql server and linq to sql be used in this type of setup?
What platform if any would be best suited?

in it's most basic form, Azure is just a highly available web-hosting environment - if you have an ASP.Net web application, you can deploy it to cloupapp.net and it should work.
To try it out, get yourself a Vista/7 machine, download the Azure SDK and VS Tools, and create a new Azure application. There are 2 main parts at this point, the Cloud project, and an ASP.Net Web Application. The ASP.Net will have a "web-role" relationship with the Cloud project. This is as it sounds, it is the visual front-end to the Cloud application, that interacts with visitors.
You can, at this point, just leave it there - it's a normal ASP.Net application with very good hosting. Your SQL connection strings should work, though you may want to consider SQL Azure. You can also host WCF services.
As Manoj points out, Azure does have a different programming model which you can take advantage to produce very robust applications. Azure also has the concept of Worker Roles, which are similar to Managed Services, in that they perform processing without a public interface. Instead, your web-roles take the requests, place them on the Queues, and the worker-roles then pick them up, process and send back responses.
It's a very powerful system, which I haven't fully explored, but the good news is that you don't have to be an immediate expert in the whole system, but can create simple ASP.Net sites as web-roles, deploy those then expand from there.
Have a go, it's well worth it
Toby

AppHarbor is a .NET Platform-as-a-Service. We can host your ASP.NET websites more or less un-modified and without the Visual Studio plugins and other crud that Windows Azure requires.

It depends on what type of cloud hosting are you looking for. There is some cloud hosting which will just give you space for application data like Amazon. While Azure gives you complete application framework which supports your application to be hosted in cloud. But programming in cloud is different programming paradigm than in traditional web form. You will have some limited classes from .Net framework available but better resources for scalability.
You cant directly use sql server in azure application. What you can use SqlAzure services.

Just referring a book which i feel would provide you the answer
Cloud Computing Book
EDIT :
Check this microsoft link
Ramp Up

yes, it is supported and live demo of Asp.NET 4.5 Web Forms available on Microsoft azure websites... you can visit this link for detailed information
Create and deploy a secure ASP.NET Web Forms app with Membership, OAuth, and SQL Database to Azure App Service

Related

What specs should I use for my .NET webapp on Azure, or something similar?

So I'm pretty green to the industry, please excuse what I'm assuming is huge swaths of ignorance. I'm looking to develop an ASP.NET webapp (with a SQL Server db) as a kind of in-house tool for our employees, accessible from anywhere. We're a company with virtually no IT infrastructure, so these employees (~100) will be accessing this application from all around the country on what are basically personal computers. I don't ever expect there to be any more than 10 users using the webapp concurrently. The web app is going to be the frame for a series of tools I've been making for the head office guys, but from a central point that's easy for me to maintain.
We have our own domain, so that's taken care of.
I'd like to find a cloud-based tool that would pretty much just involve me deploying my code to it, and that's about it. I've take a look at Azure and that seems like the way to go, but I know if I present a price too high the bosses won't exactly be thrilled.
I was hoping some of you guys had some experience in setting these kinds of things up. Here's a series of questions I'm having a hard time coming up with an answer for:
Looking at the Azure cloud-based webapp, What da heck specs do I get? Is Standard S2 too much power, or nowhere near enough?
Do I need to purchase an Azure SQL Server thingo seperate to the Web App hosting, or does it come bundled in?
How the heck do I deploy my dang code?
I've been getting off pretty easily as I used to have a team behind me, and now I'm alone at a new company, there's not many people whose brains I can pick. I've had a call or two with a Microsoft employee, and they were helpful, but not entirely helpful enough. They keep assuming I know what I'm doing - I don't. So any help from anyone would be greatly appreciated!
You need to learn two services of Azure:
1.Azure Web app service:
Azure App Service is an HTTP-based service for hosting web applications, REST APIs, and mobile back ends. You can develop in your favorite language, be it .NET, .NET Core, Java, Ruby, Node.js, PHP, or Python. Applications run and scale with ease on both Windows and Linux-based environments.
This document will teach you develop web app with Azure SQL and deploy your app to Azure.
2. Azure SQL database:
Azure SQL Database is a general-purpose relational database, provided as a managed service. With it, you can create a highly available and high-performance data storage layer for the applications and solutions in Azure. SQL Database can be the right choice for a variety of modern cloud applications because it enables you to process both relational data and non-relational structures, such as graphs, JSON, spatial, and XML.
Azure SQL database is a cloud database. If you have the develop experience with SQL server, you will be familiar to it.
Azure App Service and Azure SQL database are independent, in Azure, which service you want to use, just pay for it.
You need an Azure Web app service to host your app, and you also need a Azure SQL database. Then you can develop the app with Azure SQL database.
Each service has the different price tier to meet the performance requirements of the user. You need to choose the most suitable for your company to save the money.
Hope this helps.

Xamarin.Forms app SQL-server database options

I've been studying Xamarin.Forms with goal of building cross-platform mobile app in VisualStudio2015. I've got a perfectly acceptable public facing web site but native app(s) are what the boss thinks we need.
The current web app hosted on IIS 7.5 uses a separate project(DLL) for database access to an on-premises SQL Server 2008 instance. This VStudio project exposes domain objects to the calling ASP.NET webforms by executing various stored procedures using System.Data.SqlClient.
I know building the mobile native app itself with Xamarin.Forms is one part of the challenge but I am asking here for clarification about how to approach the database requirements:
Do I need to create some sort of web service that provides the same CRUD functions required by my current web site?
Xamarin documentation lists several options for consuming web services and the more I search and read about data access I conclude that a callable web service of some type is going to be required for my eventual native mobile app.
Is this assumption correct?
Yes. You generally want a webservice layer brokering requests between your mobile app (or any remote client) and your DB server. If you already have all your crud operations in a separate library that is utilized by your website, then a webservice would just be another set of endpoints that rely on the same CRUD library.

Can I deploy web-form asp.net web application to cloud?

I know such questions have already been asked many times, but I am here with my scenario. Kindly do not delete or vote to close.
I have an asp.net application with L2S and SQL 2008 R2 as backend
Using N-Layered architectured
Mostly normal crud operations to be performed.
Use of Sessions and View States
Manual Login / Logout(User and Roles management) , no .net Membership has been used.
No services used yet, might be a later part.
Third Party controls like Telerik or Infragistics also are in use.
I want to know:
Do i need to change entire application to Azure Web Application?
If not, is it possible to deploy it directly over the cloud , on MS or any other, as we normally do in IIS?
If not, Is there any third party migration tool available to make my plain old web application cloud-compatible, without affecting existing codes ?
I want cost effective and easy to go steps?
Thanks in advance
Yes that should be possible. You almost certainly do NOT have to change your whole application.
Linq2SQL is fine, I run an Azure site with L2S without any problems
You'll have to deploy your DB to a SQL Azure database. There are some restrictions, like all of your tables must have a primary key. A bigger list is here: http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx.
Also, when generating your SQL scripts, be sure to select SQL Azure as the database engine type: http://mooneyblog.mmdbsolutions.com/index.php/2011/09/22/generating-azure-friendly-sql-scripts/
What do your N-layers look like? If they are DLLs, it's fine. If they are web services, you'll need to create web roles for them. If they are windows services, you'll need to port them to a worker role.
Most crud and view state and manual authentication code is fine
For session, it depends on what you are doing (memory vs database). But you'll have the same challenges that you would have if you deployed to any web farm
For Telerik, I'm sure they have to have some support for Azure, and I don't think they would be doing anything crazy that would not work Azure. You should check out their website to verify compatibility.
Also, make sure you are not writing to the hard drive anywhere and expecting it to be there later, because instances can be started and stopped and reimaged at any point. If you're doing that, you'll need to change it to use something else like blob storage.
I have an ongoing series of blog posts that walk through some of the steps, which should help: http://mooneyblog.mmdbsolutions.com/index.php/category/azure/
Good luck!
I don't see any hassles to deploy your web application into the cloud.
You don't need to convert your entire application to anything else.
After all you can just try to deploy it now with the trial subscription in Windows Azure which is free for three months.
There is a fairly big stuff of new technology in Windows Azure such as service bus, azure storage, access control service, etc. However it's not necessary to use all them right now. It's prety easy just to move the existing app into the cloud.
You can deploy it to Azure web site.
That should be easier if you don't want to use SQL Azure and cloud storage.

Why use an Azure Cloud Service Project instead of an ASP.NET project with the Azure SDK?

I'm playing with Azure asp.net development. I use Visual Studio 2010, with Azure SDK and I'm a newbie to Azure cloud.
I created several apps and deployed them to my testing Azure Web Site. Everything works fine - ASP.NET Web Page, ASP.NET MVC3, even simple GridView binding to an Azure SQL database, which I created earlier and that I manage with Microsoft SQL Management Studio, using ADO.NET. It's really simple.
Now, I learned from some tutorials, that I need to use a Windows Azure Cloud Service Project to make sure that my application will work. But it works without this project, too. So what exactly do I need such a project in my solution for?
There are actually three different ways you could have gotten your ASP.NET app over to the cloud, and the confusion comes because you are seeing elements of two of those options.
A Windows Azure Web Site is just a single ASP.NET application running in Microsoft's data centers (versus on premises) so all of the configuration it needs is already part of the project itself (primarily the web.config), some being exposed via the Azure portal. In many ways, this is similar to web hosting providers.
A Windows Azure Cloud Service is a collection of multiple services, which could be web sites/services (Web Roles) or backend code (Worker Roles). The code for your Azure Web Site could also have been deployed exactly as is as a Web Role, but in that case it would be part of a larger application that potentially contains additional Web and Worker Roles. It's the Cloud Service project itself that provides the additional configuration of those web and worker roles (even if you have just a single role in the cloud service). The Cloud Service offering is considered Platform as a Service.
The other option, for completeness, is to create a Virtual Machine image yourself, install your ASP.NET site, and then have Windows Azure host the Virtual Machine. It's at the opposite end of the 'make it simple to deploy' spectrum, but you get a lot of control over what exactly is on the VM that you deploy. This is the Infrastructure as a Service offering from Azure.
I'm going to assume you're developing for Windows Azure Cloud Services (the foundation PaaS solution of Windows Azure). The Cloud Service project defines your application to the Windows Azure Fabric. If you don't already have one, then odds are your are running your application outside of the local Development Emulator. If you are going to deploy your solution to Windows Azure Cloud Services, you will need to create this project for your application so Windows Azure's Fabric (the secret sauce that will manage your application) knows how to manage the application.
And I'm going to assume the opposite to #BrentDaCodeMonkey - that you're developing for Azure Web Sites, and not Cloud Services - in which case you may have confused yourself with the tutorials, as I don't believe a Cloud Services Project is either necessary or advisable.

how much of a challenge is it to port a asp.net application to azure?

I have a partly developed asp.net application, but now the client wants it to be developed in azure. How much of the existing code can be used in developing the application in azure.
What challenges could we possibly encounter when we try to port an existing asp.net application to azure? Are there any other alternatives to azure in cloud computing?
For an asp.net application, you can certainly port that to Azure. Your core logic will port in a relatively straightforward manner, and you'll gain the many benefits Azure has to offer. With the June 2010 release, you'll also have .NET 4 support, along with IntelliTrace for debugging.
However, as you begin to plan your Azure migration, there are several considerations you'll need to think about (none of them insurmountable, and several relatively simple to deal with):
You have to deal with ASP.NET Session State management across your web role instances (which isn't supported out of the box, except for inproc). You'll also have to set up and use the role and membership providers (see here for more detail). EDIT: You now have access to both AppFabric Cache for session state as well as SQL Azure, part of the Universal Providers included with the Windows Azure SDK+Tools.
You have to examine your SQL backend for incompatibilities with SQL Azure (such as scheduled jobs,since there's no SQL Agent support). SQL Azure differences are documented here. You'll also need to consider the SQL Azure size limit of 50GB, which might require you to offload content to Azure blob storage. EDIT: You can run your SQL Server database through the SQL Azure Migration Wizard for compatibility-testing.
You need to configure logging and diagnostics, preferably with Trace output, so that you can retrieve this data remotely.
You need to think about how you'll monitor and scale your application. All information you might need for scaling is available to you (performance counters, queue lengths, etc.). Check out WASABI - the auto-scale application block, part of Enterprise Library. You can also subscribe to a service such as AzureWatch.
You'll need to think about caching, as there's currently no out-of-the-box caching implementation that runs across instances of your web role which is now provided as a service. Read details here, as well as an FAQ here.
Do you need SMTP support? If so, there are details you should read about here. SendGrid recently announced a free-tier promotion for Windows Azure.
Are you hosting WCF services as well? If so, check out this site for further details (specifically the Known Issues).
So: yes, there are some things you need to concern yourself with, but Azure is a great platform for hosting an asp.net application and you should strongly consider it.
It should be very easy to port your application to Azure--especially if you're using a SQL back-end. The code could run almost without modification. You'll need to create an Azure installation package for the project and configuration file.
If your application makes use of persistent storage (other than SQL Server), you may have to rework that code somewhat. However, the platform now has drive storage, which simulates a file system, so this should be fairly easy.
Another issue to watch out for is web.config. If you make heavy use of this for runtime customization, you'll have to rework that too. You can't deploy single files to your application in Azure, so the recommended approach is to migrate these sort of settings to the Azure config file.
The hardest thing you're likely to encounter is external applications. If your app relies on launching other processes, then this will require some serious redesign.
Azure now supports Web Sites as a deployment type. Basically this allows you to publish any standard Asp.net (and other supported like PHP etc) application to Azure and have it as a scalable server. See this article http://blog.ntotten.com/2012/06/07/10-things-about-windows-azure-web-sites/
Many of the benefits of Azure without having to introduce Azure specific code/Project to your existing application.
Also this question here What is the difference between an Azure Web Site and an Azure Web Role

Resources