Page 28 - MSDN Magazine, November 2018
P. 28

AZURE SERVICE BUS
Web Site Background
Processing with Azure
Service Bus Queues
Will Stott
I was working at the United Kingdom Collaborative Trial of Ovarian Cancer Screening (UKCTOCS), when I ran into a problem. Tasked with demonstrating a logistic regression classifier I had developed for a trial project, I began to build a simple, low-budget Web site to support it. But I needed the site to both support long-running background processing and start up the classifier server on-demand.
It was a two-pronged challenge, and one that I was able to tackle using key Microsoft technologies. In this article, I’ll explore how I leveraged Azure Functions and Service Bus queues to enable back- ground processing, while in a future piece I’ll dive into the Azure Container Service and how it enabled on-demand provisioning of
server resources. In that second article I’ll show you how to pro- grammatically start and terminate an Azure Container using the Azure.Management.Fluent API.
As for the underlying Web site and its database, they’re host- ed on Azure as a standard Web App based on ASP.Net Core 2.1 MVC, Entity Framework and SQL Server. Most readers should be able to construct what’s required from the system overview shown in Figure 1 and the OvaryVis model shown in Figure 2. Really, the project is just a Web Form that captures three integers representing measurements made of an ovary, saves them in a database record, and displays a results page that shows whether or not the classifier judges the dimensions to be consistent with those of an ovary.
Recreating the project in this article doesn’t require much more than rudimentary Web development skills. I do assume that you’ve already created the ASP.NET Core 2.1 MVC Web App and its SQL Server da- tabase, as well as the associated Azure Resources (which are described in the companion article). In terms of tools, you’ll need Visual Studio 2017 v15.7 with .NET Core 2.1 SDK and the Web development work- load. You’ll also need an Azure Subscription, but you can get what you need for free if you’re a new customer. All the source code and instruc- tions for creating the Azure resources for the solution shown in Figure 1 are available at the GitHub repository (bit.ly/2NSiIuh).
Overview
A Web App, like the one developed for this article, supports multi- ple users by deciding what each of them wants and then returning
This article discusses:
• Using Azure Service Bus Queue and Azure Functions to implement background processing for a Web App
• Using Entity Framework to provide database access to an Azure Function
• Provisioning resources using Azure Cloud Shell
Technologies discussed:
Azure Service Bus Queue, Azure Functions, Azure SQL Server, Azure Web App, ASP.NET Core 2.1, Entity Framework Core, C#, Visual Studio 2017
Code download available at:
bit.ly/2NSiIuh
22 msdn magazine


































































































   26   27   28   29   30