{"id":1914,"date":"2012-12-20T12:13:20","date_gmt":"2012-12-20T12:13:20","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2012\/12\/20\/new-tutorial-series-and-sample-application-for-asp-net-mvc-4-with-windows-azure-tables-blobs-and-queues\/"},"modified":"2012-12-20T12:13:20","modified_gmt":"2012-12-20T12:13:20","slug":"new-tutorial-series-and-sample-application-for-asp-net-mvc-4-with-windows-azure-tables-blobs-and-queues","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/new-tutorial-series-and-sample-application-for-asp-net-mvc-4-with-windows-azure-tables-blobs-and-queues\/","title":{"rendered":"New Tutorial Series and Sample Application for ASP.NET MVC 4 with Windows Azure Tables, Blobs, and Queues"},"content":{"rendered":"<p>On December 19 we published a new tutorial series and accompanying sample application that shows how to work with Windows Azure Storage tables, queues, and blobs in a multi-tier application that uses ASP.NET MVC 4 and ASP.NET Web API. <\/p>\n<p>The sample application is an email service that runs in a Windows Azure Cloud Service. The front-end is a web role that manages mailing lists, subscribers, and messages. The back-end is a pair of worker roles that handle scheduling and sending emails.&nbsp; <\/p>\n<p>There are five tutorials: one provides an overview of the application, one shows how to download and run the completed application, and three show how to build the application from scratch in Visual Studio.<\/p>\n<p>Here are links to the tutorials, with a sampling of what you can find in them:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/net\/tutorials\/multi-tier-web-site\/1-overview\/\" target=\"_blank\" rel=\"noopener\">.NET Multi-Tier Application Using Storage Tables, Queues, and Blobs &#8211; 1 of 5<\/a> <\/li>\n<ul>\n<li>Front-end overview including screen shots of web pages.<\/li>\n<li>Back-end overview including diagrams of application architecture.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/li>\n<li>Schemas and sample contents for Windows Azure tables used by the application.<\/li>\n<li>Explanations of how the application uses queues and blobs.<\/li>\n<li>A data diagram for the tables and queues.<\/li>\n<li>A discussion of relative merits of running the front-end as a web role in a Cloud Service vs. in a Windows Azure Web Site.<\/li>\n<li>A discussion of operating costs and options for minimizing costs.<\/li>\n<\/ul>\n<li><a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/net\/tutorials\/multi-tier-web-site\/2-download-and-run\/\" target=\"_blank\" rel=\"noopener\">Configuring and Deploying the Windows Azure Email Service application &#8211; 2 of 5<\/a> <\/li>\n<ul>\n<li>How to download, configure, and run the application.<\/li>\n<li>How to publish the application to the staging environment in your own Windows Azure account, and how to promote to production.<\/li>\n<li>How to limit access to the application in Windows Azure by specifying IP restrictions.<\/li>\n<li>How to use Azure Storage Explorer and Visual Studio to view data in Windows Azure development storage and Windows Azure Storage accounts.<\/li>\n<li>How to use either the automated or manual method to add Windows Azure Storage account credentials to the Visual Studio project.<\/li>\n<li>How to configure the application for tracing and how to view tracing data in Windows Azure Storage.<\/li>\n<li>How to scale the application by adding web or worker role instances.<\/li>\n<li>How to decrease project startup time by disabling development storage when you are using a Windows Azure Storage account.<\/li>\n<\/ul>\n<li><a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/net\/tutorials\/multi-tier-web-site\/3-web-role\/\" target=\"_blank\" rel=\"noopener\">Building the web role for the Windows Azure Email Service application &#8211; 3 of 5<\/a> <\/li>\n<ul>\n<li>How to create a solution that contains a Cloud Service project with a web role and a worker role. <\/li>\n<li>How to work with Windows Azure tables, blobs, and queues in MVC 4 controllers and views.<\/li>\n<ul>\n<li>How to handle basic CRUD operations.<\/li>\n<li>How to upload files and store them in blobs.<\/li>\n<li>How to handle changes to table data that involve changing the row key or the partition key of an entity.<\/li>\n<li>How to handle concurrency conflicts.<\/li>\n<li>How to set the retry policy to avoid subjecting the user to long wait times.<\/li>\n<\/ul>\n<li>How to use the new Storage Client Library (SCL) 2.0 API (project templates still give you the 1.7 API by default).<\/li>\n<li>How to reference an SCL 1.7 assembly in order to get diagnostic functionality that hasn&rsquo;t been added to SCL 2.0 yet.<\/li>\n<li>How to handle web role instance shutdown gracefully by overriding the OnStop method.<\/li>\n<li>How to create tables, queues, and blobs in code so that you don&rsquo;t have to create them manually.<\/li>\n<li>How to limit Windows Azure Storage transaction costs, increase efficiency, and implement atomic transactions by performing table operations in batches of up to 100 operations.<\/li>\n<li>How to run the web front-end in a Windows Azure Web Site instead of a Cloud Service<\/li>\n<\/ul>\n<li><a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/net\/tutorials\/multi-tier-web-site\/4-worker-role-a\/\" target=\"_blank\" rel=\"noopener\">Building worker role A (email scheduler) for the Windows Azure Email Service application &#8211; 4 of 5<\/a> <\/li>\n<ul>\n<li>How to create, query, and update Windows Azure Storage tables in a worker role.<\/li>\n<li>How to add work items to a queue for processing by another worker role.<\/li>\n<li>How to set the appropriate connection limit and configure diagnostics in the OnStart method.<\/li>\n<li>How to handle worker role instance shutdown gracefully by overriding the OnStop method.<\/li>\n<li>How to make sure that no emails are missed and no duplicate emails are sent if the worker role instance shuts down unexpectedly.<\/li>\n<li>How to test a worker role that uses Windows Azure Storage tables and queues.<\/li>\n<\/ul>\n<li><a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/net\/tutorials\/multi-tier-web-site\/5-worker-role-b\/\" target=\"_blank\" rel=\"noopener\">Building worker role B (email sender) for the Windows Azure Email Service application &#8211; 5 of 5<\/a> <\/li>\n<ul>\n<li>How to add a worker role to a Cloud Service project.<\/li>\n<li>How to poll a queue and process work items from the queue.<\/li>\n<ul>\n<li>How to make sure that only one worker role instance gets any given queue work item for processing.<\/li>\n<li>How increase efficiency and decrease transaction costs by getting up to 32 work items at a time.<\/li>\n<li>How to handle &ldquo;poison messages&rdquo; that cause exceptions when the worker role tries to process them.<\/li>\n<\/ul>\n<li>How to download text from blobs.<\/li>\n<li>How to send emails by using SendGrid.<\/li>\n<li>How to make sure that no emails are missed and no duplicate emails are sent if the worker role instance shuts down unexpectedly.<\/li>\n<\/ul>\n<\/ul>\n<p>Feedback is welcome; you can post comments here or on the tutorials themselves.&nbsp; One thing we know still needs work is the formatting of code blocks: the tutorials were written in Markdown, and we haven&rsquo;t found a way to copy and paste code from Visual Studio into Markdown that preserves line spacing and indentation when the Markdown is rendered into HTML.&nbsp; Suggestions for dealing with that issue are welcome also.<\/p>\n<p><b>&#8212; Tom Dykstra <\/b><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On December 19 we published a new tutorial series and accompanying sample application that shows how to work with Windows Azure Storage tables, queues, and blobs in a multi-tier application that uses ASP.NET MVC 4 and ASP.NET Web API. The sample application is an email service that runs in a Windows Azure Cloud Service. The [&hellip;]<\/p>\n","protected":false},"author":424,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[],"class_list":["post-1914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet"],"acf":[],"blog_post_summary":"<p>On December 19 we published a new tutorial series and accompanying sample application that shows how to work with Windows Azure Storage tables, queues, and blobs in a multi-tier application that uses ASP.NET MVC 4 and ASP.NET Web API. The sample application is an email service that runs in a Windows Azure Cloud Service. The [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/424"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=1914"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1914\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=1914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=1914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=1914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}