Deploying and mvc applications to azure


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Deploying and mvc applications to azure

  1. 1. Deploying ASP.NET and MVC applications to Azure Glyn Darkin, Solutions Architect 18/04/2013 Our Awards:
  2. 2. What should you be mindful of as a developer if you are considering Azure as a hosting platform?
  3. 3. Outside the scope of this discussion • Building for the Cloud • Cloud Service Worker Roles • Big Data • Mobile Services
  4. 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. 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. 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. 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 • Entity framework is fully supported with migrations
  8. 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. 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. 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. 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. 12. Demo The default MVC website • Windows Azure Website – • Windows Azure Cloud Service –
  13. 13. Comparison of the file structures
  14. 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 -
  15. 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
  16. 16. Q&A &
  17. 17. Links • Azure Storage Explorer – Blob, Table, Queue • CloudBerry Storage Explorer – Blob with Sync