Upload
glyn-darkin
View
122
Download
3
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
Our Awards:
Deploying ASP.NET and MVC
applications to Azure
Glyn Darkin, Solutions Architect
18/04/2013
What should you be mindful of as a developer if you are
considering Azure as a hosting platform?
Outside the scope of this discussion
• Building for the Cloud
• Cloud Service Worker Roles
• Big Data
• Mobile Services
Microsoft Azure for ASP.Net
Hyper-V
VMs
Cloud Services
Websites Media Add-Ons
IaaS
PaaS
SaaS
Storage Network
Service Bus
Distributed Cache
Azure Website vs. Cloud Service Web Role
Reference MSDN Blog
Comparison Matrix
Feature Web Sites Web Roles
Access to services like Caching, Service Bus, Storage, SQL Azure DatabaseYes Yes
Support for ASP.NET, classic ASP, Node.js, PHPYes Yes
Shared content and configurationYes No
Deploy code with GIT, FTPYes No
Near-instant deploymentYes No
Multiple deployment environments (production and staging)No Yes
Network isolationNo Yes
Remote desktop access to serversNo Yes
Ability to run programs with elevated permissionsNo Yes
Ability to define/execute start-up tasksNo Yes
Ability to use unsupported frameworks or librariesNo Yes
Support for Windows Azure Connect/ Windows Azure NetworkNo Yes
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
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
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
– Staging DNS creation & resolution can be SLOW
• Your code needs to reference the Azure SDK
– Therefore your product is not portable
• Local development emulator
– Very slow code, test, debug cycle
– Learn to hack using shared resources
– Is not the same as Azure, there are differences so be warned!!!!
• No local disk access
Things you need to keep in mind
Part 1
• You need to use the Session State provider for Windows Azure Caching
– TempData uses Session State
• You don’t have write access to the file system
– 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
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
• Or Streamed into Visual Studio Output Window!!!
– Cloud: Tracing has to be coded & configured & is stored in Table Storage
• 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
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
Demo
The default MVC website
• Windows Azure Website
– http://version1.azurewebsites.net/
• Windows Azure Cloud Service
– http://version2.cloudapp.net/
Comparison of the file structures
Windows Azure SQL
http://msdn.microsoft.com/en-us/library/windowsazure/ff394115.aspx
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/
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
Q&A
H H&
Links
• Azure Storage Explorer
– Blob, Table, Queue
• CloudBerry Storage Explorer
– Blob with Sync