This document discusses considerations for deploying ASP.NET and MVC applications to Microsoft Azure. It compares Azure Websites and Cloud Services, noting that Websites are easier to use as they don't require Azure SDK tools but lack features like staging environments. It also covers Azure SQL, noting it supports most but not all T-SQL and has different backup strategies than on-premises SQL Server. The document recommends starting with Azure Websites and migrating to Cloud Services only if needed, and keeping in mind that Azure is continuously evolving.
ICT role in 21st century education and its challenges
Deploying asp.net and mvc applications to azure
1. Deploying ASP.NET and MVC
applications to Azure
Glyn Darkin, Solutions Architect
18/04/2013
Our Awards:
2. What should you be mindful of as a developer if you are
considering Azure as a hosting platform?
3. Outside the scope of this discussion
•
Building for the Cloud
•
Cloud Service Worker Roles
•
Big Data
•
Mobile Services
4. Microsoft Azure for ASP.Net
SaaS
Websites
Media
Add-Ons
PaaS
Cloud
Services
Service
Bus
Distributed
Cache
IaaS
VMs
Storage
Network
Hyper-V
5. Azure Website vs. Cloud Service Web Role
Comparison Matrix
Feature
Access to services like Caching, Service Bus, Storage, SQL Azure Database
Support for ASP.NET, classic ASP, Node.js, PHP
Shared content and configuration
Deploy code with GIT, FTP
Near-instant deployment
Multiple deployment environments (production and staging)
Network isolation
Remote desktop access to servers
Ability to run programs with elevated permissions
Ability to define/execute start-up tasks
Ability to use unsupported frameworks or libraries
Support for Windows Azure Connect/ Windows Azure Network
Reference MSDN Blog
Web Sites
Web Roles
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
6. Is Azure the only PaaS that can host ASP.NET?
•
There will be others
•
It’s a race to the bottom
•
Our Solutions should be portable
7. Websites
Plain Vanilla Website
•
Replicates a Shared Hosting Platform but with elastic scalability
•
Can deploy a plain vanilla ASP.NET website
•
No SDK dependencies
•
No IDE dependencies
•
You can deploy your site to other hosting providers
– AWS, AppHarbour, Rackspace
•
10 free sites with the domain http://seotools.azurewebsites.net
•
Entity framework is fully supported with migrations
8. Cloud Service
Web Role
•
1 Cloud Service represents a single virtual machine
•
Part of a Cloud Solution
•
Requires the Azure SDK & tools to be installed
•
Uses a VIP to switch between a Staging & Production instance
–
•
Your code needs to reference the Azure SDK
–
•
Staging DNS creation & resolution can be SLOW
Therefore your product is not portable
Local development emulator
–
–
Learn to hack using shared resources
–
•
Very slow code, test, debug cycle
Is not the same as Azure, there are differences so be warned!!!!
No local disk access
9. Things you need to keep in mind
Part 1
•
You need to use the Session State provider for Windows Azure Caching
–
•
You don’t have write access to the file system
–
•
TempData uses Session State
You will need to store uploaded files in either Blob storage or SQL
You are running behind a load balancer
–
Requests that last longer than 60secs are killed
10. Things to keep in mind
Part 2
•
There is no SMTP server in Azure
–
–
•
User a Service link SendGrid or MailGun
User Message Bus to send message on premise and email from there
Logging/Trace output
–
Websites: Tracing output is stored against the website on disk & can be accessed via FTP
•
–
Cloud: Tracing has to be coded & configured & is stored in Table Storage
•
•
Or Streamed into Visual Studio Output Window!!!
It can be queried in Visual Studio
Configuration
–
–
•
Websites: Web.config with transformations
Cloud: ServiceDefinition.csdef and ServiceConfiguration.environment.cscfg
Images
–
Push your images to the Azure CDN
11. Deployment
Website
Cloud Service
Direct from TFS
Yes
Yes
Git, Mercurial, FTP
Yes
No
MSBuild, Powershell
Yes
Yes
Visual Studio*
Yes
Yes
Deployment Pipeline
No
Yes
* You should never be deploying from Visual Studio
12. Demo
The default MVC website
•
Windows Azure Website
– http://version1.azurewebsites.net/
•
Windows Azure Cloud Service
– http://version2.cloudapp.net/
14. Windows Azure SQL
Same Same but different
•
Fully managed database environment
•
Not all T-SQL supported in Azure
•
SQL Management Studio not fully supported
•
SQL Server replication not supported
•
Backup strategy is a little different – SYNC instead
•
Full-Text Search not supported
•
Full list of unsupported features
•
If you want to scale your database then KISS
•
BCP from the command line is fastest way to get all your data in
•
MS SQL Server Migration Wizard - http://sqlazuremw.codeplex.com/
http://msdn.microsoft.com/en-us/library/windowsazure/ff394115.aspx
15. Conclusion
Recommendations
•
Websites uses everything you already know
•
CloudServices you have to learn new stuff
•
Start with Websites and migrate to a Cloud Service when you need to
•
Keep in mind that Azure is a moving target
•
Windows Azure SQL requires a very simple approach
– Great for developers, not so much for the SQL DBA
•
You can always just spin up a VM for a legacy app