The course is part of these learning pathsSee 1 more
Azure is Microsoft’s Cloud Computing platform. It is an amalgamation of services for creating, deploying and managing applications that run in Microsoft’s secure worldwide data centers. The set of services can make virtually any software solution possible, from large retail targeting a global audience to CPU-intensive, scientific data calculations, to simple data backups. Almost any software that can be imagined can be written to take advantage of Azure services and can run in the Microsoft Cloud.
In this course, we will review the categories of services available in Azure today, then select some of the more commonly used services for a closer look. We will wrap up with a conceptual overview of how we can combine many Azure services to build a more ambitious solution. By the end of the course, you should have a general appreciation for the breadth of available services and start to see how they can be composed to create more powerful business solutions.
This course is for developers, operations engineers, and other IT professionals. Viewers should have a basic understanding of the cloud and cloud terminology.
The Learning Objectives for the course are:
● Learn what categories of Azure services exist and what problems they address.
● Learn the most common Azure services and how to use them now.
● Learn how you can combine Azure services.
Welcome and Introduction: These brief lectures will introduce you to the instructor and let you know what you'll be covering.
Azure Services: A description of how to build your first service.
Service Catagories: Overview of the 14 categories of Azure Services
Services Drill Down: A look at Websites, SQL Database, and Storage
Managing Services: This lesson includes a Security Center demo and a Command Line Interface demo.
Putting it Together: Tying all that you've learned into some real-life examples.
Conclusion: A wrap-up of what you've learned.
In this next lesson, we'll look briefly into a few services to give you a closer look. We'll first look at Websites, a feature within the Azure Web Apps service. Websites make it easy to deploy, run, secure, scale, monitor, and generally manage all kinds of websites. Many technologies are supported. ASP.net, Python, Node.js, PHP, Java, and there's a new offering in preview: Ruby on Rails.
For this demo, we'll create a Ruby on Rails website. We won't show how to create a Ruby on Rails website from scratch. Instead we'll use a basic Rails site that we've previously created. Our basic Rails website will show a list of books from our Azure bookstore. Recall the virtual machine we created earlier with MySQL running on it. We'll use that database to provide the data to our website. The Rails website is already expecting the database schema that we used earlier, so to get it up and running, we have two additional steps.
The first step is simply to deploy our website. This will deploy our Rails website on a Linux virtual machine in a docker container. We don't really need to worry about a lot of that, because it's a managed service for us, and we can deploy directly from our source code environment. The second thing we need to do is provide a database connection string to our website so that it can find and access the data in the MySQL database. We will also show how to do that. Afterwards, we'll create another database, simply to illustrate that we could drive the same basic Azure bookstore website from an alternative backend database. Just to bring the point home, if you want a MySQL database running in a VM, that's an option.
If you prefer a database that's managed for you, such as Azure SQL Database shown here, that's also an option. You are in control. You choose the individual services that meet your needs, and assemble them as you see fit. Azure is a toolbox for you, you choose the tools that meet your needs. Let's go back to the portal, and deploy this Rails bookstore application in Azure. Here we are back in the Azure portal. Just to show another route through the portal, we'll go into the Azure App Services area to create our Web App. Click add. And we have a menu of options.
One option is to choose a Web App, another option is to choose a Web App plus an Azure SQL Database all in one step. Just to show the Linux side of Web Apps, we're going up here to the search box, we're gonna type in "preview" to emphasize that we're looking for a preview feature, and we're gonna choose Web Apps on Linux. Normally I wouldn't show a preview feature. The point to take away is that there's gonna be managed support for docker containers within Azure Web Apps. A very powerful feature. So we click create here. We'll call it "azurebookstoreonrails."
We'll create a resource group by the same name. We've already created an app service plan, so we'll just use that. Now we're gonna configure our container. You can see that we can configure our container to use Node.js, PHP, .Net Core, and Ruby. We'll choose Ruby here. And create. So after a few seconds, our Rails container was created and deployed, although our website is not yet running in it. Let's configure that. The first thing we wanna do is tell Azure where to find the code.
There are various ways we can deploy our code, but here we wanna use continuous deployment. Choose deployment options. Configure. We'll configure this to use GitHub. I previously authorized my account so I don't need to do that again. I basically told GitHub that it was okay to create web hooks back to Azure. Let's choose the project that we wanna deploy, and this cloud bookstore. This is the Azure bookstore, Ruby on Rails application. The master branch is what we want, and for the rest we'll just choose defaults. And just a few seconds later, it is deployed.
But the Rails app doesn't know where to find our database yet. So let's configure that. Let's do that, that is an application setting. In the case of dot net applications we might use this Connection Strings area. But since this is a Rails app, it's used to finding its connection information under App Settings. The Rails application will be looking for an environment variable called DATABASE_URL, with a value that looks something like this, mysql2://username, real password that I won't show here, the IP address of the Linux VM on which MySQL is running, and the port number, we're using the standard 3306 port for MySQL, and then this is the database name, within the database server. We save this.
Now when our Ruby on Rails web application running within this Azure Web App as a website asks its local environment what its database URL is, the Azure runtime environment will make sure that the answer given is the one that I've typed into the portal. So this allows us to store this information within the Azure portal, and not chucking it into source code. And in fact I can redeploy the code without having to also redeploy the credentials. This is very convenient. Another service available in Azure is the Azure key vault, which is an even more secure way to manage credentials like a MySQL database username and password.
Now let's go look at the running application. Here we've switched to the running Azure bookstore application, running in Ruby on Rails on an Azure Web App in a docker container running Ruby on Rails. And as you can see, it contains the two books that I entered into the MySQL database in an earlier lecture, and of course since it's a very trivial application, this is all it shows. But that's all we need to show, and you can build on that. Now let's go back to the Azure portal, and we'll see what it would be like to create a new Azure SQL database. Click add. Give the database a name.
Let's give the database the name "azurebookstoredb." Use the same name for the resource group. We'll create a blank database, and the blank database will make it easy for us to go in and create a schema that has the simple Azure bookstore database schema, similar to what we saw in the MySQL database. We need to create an azure SQL database server to hold our SQL database. So we'll ask it to do that. Get rid of the server name, again we'll use the same name for simplicity. If we had a multi-tenant Azure bookstore database, we might be interested in SQL elastic pulls, but we'll leave that as default. We'll leave the default pricing tier and other defaults and we'll hit create.
The bell icon at the top of the portal here shows notifications, so we can glance in there to see that the deployment for our SQL database has started, but it's still in progress. We have another notification telling us that our deployment has succeeded. We can dismiss that. And we see our Azure bookstore DB database now exists. We can go in, check out the portal experience here. You can see we have a monitoring dashboard. Lots of options for performance monitoring, some security features. Geo-replication can be easily turned on with some mouse clicks. A couple things to point out. There's a firewall.
In order for me to access this with a SQL tool, like SQL Server Management Studio or other SQL access tools, I'll wanna make sure that there's a firewall rule that allows me in. So I will simply add a client IP rule here. And this is my current IP address. I will save that. One zero eight seven two zero three one six eight. So just to prove it, I jump over to google and ask what my public IP address is, and it tells me "188.8.131.52." And that was the IP Address that it also detected. So now it's given me access through the firewall to access the database. So now that we've set a firewall rule, the next thing I wanna do is get the database connection string, so I'll click on this. And depending on my programming language, it gives different forms of the database connection string.
But basically, for an application that uses ADO.net, this is an example of a database connection string. But for any language you can derive the correct connection string. I know my username and password, it doesn't provide them here. But those are the username and password I typed in earlier. So using this, I can provide a database connection string to a tool like SQL Server Management Studio, or to my Ruby on Rails Azure bookstore application. Either way, I'll have access to this Azure SQL database. That's almost all I wanted to show here, but let's quickly go down to one final thing, which is the database size. And we can alter the size of our database if we wish.
We're currently at the smallest tier, which is basic, which is about five US dollars per month. And we can go all the way to the highest premium level, which starts at 116 dollars per month. But we can give it more database throughport units. More horsepower. And more storage, say, if we max these out. In this tier. And we can see we're up to 930 dollars per month. And you can go higher. But we'll cancel out of this, 'cause we're done. I just wanted you to see that you can easily scale your database. That's all we wanna show in Azure SQL databases.
Hopefully you're confident that with this information, you could connect your web application to this database. We have one final thing we wanna show. Let's go to the Azure storage accounts. And we see that we already have two storage accounts created. These were created for us when we created the MySQL Virtual Machine. Let's go into one and take a look. So this is standard performance, so it's not a premium performance level. It's locally redundant storage, which means that it's replicated within the data center.
There's also zone redundant storage, which is replicated within the geographical region, which means a different data center in the same region, for added protection. And there's also an option to replicate to another region, which is a minimum of hundreds of miles away from the primary region. So for example, if your primary is in Dublin, Ireland, the geo-replica would be in the Netherlands. If your primary is in Chicago in the United States, the geo-redundant copy would be in San Antonio in the United States.
That's all we wanna say about Azure storage accounts for now. Let's look at a couple of other services before we leave the portal for good. We've spent a little time in app services, in SQL databases, we've even created a SQL database. We've created a virtual machine, a Linux virtual machine that happens to have a MySQL database running on it. We've created some network resources. And we've created some storage accounts. We didn't really dig into it, but Azure active directory is also part of our solution, because that's what we log into the portal with.
About the Author
Bill Wilder is a hands-on architect currently focused on building cloud-native solutions on the Microsoft Azure cloud platform. Bill is CTO at Finomial which provides SaaS solutions to the global hedge fund industry from the cloud, co-founded Development Partners Software in 1999, and has broad industry experience with companies of all sizes – from modest startups to giant enterprises. Bill has been leading the Boston Azure group since founding it in 2009, has been recognized as a Microsoft MVP for Azure since 2010, and is author of Cloud Architecture Patterns (O’Reilly Media, 2012). He speaks frequently at community events, and occasionally at conferences, usually on topics relating to cloud, cybersecurity, and software architecture.