Chapter 1. Before you begin

Azure is one of the largest public cloud computing providers for services such as virtual machines (VMs), containers, server-less computing, and machine learning. We won’t dive into all 100 or more Azure services in this book, but you’re going to learn about the core services and features that cover most of what you need to start building and running solutions in Azure. We’ll look at a common example of how to build and run a web application, and you’ll see how to use some of the core infrastructure and platform services that can make your job easier.

With Azure, you don’t need a magic wand to predict how many servers or how much storage you need over the next three years. No more delays as you gain budget approval, wait for new hardware to ship, and then rack, install, and configure everything. You don’t need to worry about what software versions or libraries are installed as you write your code.

Instead, select a button and create whatever resources are needed. You only pay for each minute those resources are running, or the amount of storage space or network bandwidth used. When you don’t need the resources anymore, you can power down or delete them. If you suddenly need to increase the amount of compute power by a factor of 10, select a button, wait a couple of minutes, and it’s there. And all of this is managed by someone else, freeing you to focus on your applications and customers.

1.1. Is this book for you?

The IT industry is in a bit of a transition period when it comes to job titles. You may refer to yourself as an IT pro, a software developer, a system administrator, or a DevOps engineer. If you want to learn the core skills needed to build and run secure, highly available applications in the cloud, you’re in the right place. In generic terms, you probably fall into the IT operations or development side of things. The truth is, there’s a lot of crossover, especially when working in cloud computing. It’s important to understand the core infrastructure and platform services to build and run applications that best serve your customers.

This book introduces some of these core concepts in Azure and provides the skills needed to make informed decisions. You should have some prior experience with VMs and know the basics of networking and storage. You should be able to create a basic website, and understand what an SSL certificate or a database is. We’ll take a quick look at new and upcoming technologies such as containers, the Internet of Things, machine learning, artificial intelligence, and server-less computing. Both self-described “developers” and “IT pros” should find some neat new areas to learn about!

1.2. How to use this book

I like sandwiches, so lunch is a great time for me to play with cool new technology. You may be a night owl who has some extra time in the evening, or you may be an early-morning person (what’s wrong with you?!) who can work through a chapter at breakfast. There’s no right or wrong time to learn, but if you can set aside about 45 minutes, you should be able to read a chapter and complete its exercises. Each chapter covers something new, so give yourself time to absorb each day’s lesson.

1.2.1. The main chapters

The book is broken into four parts, which is convenient if you believe there are four weeks in a month:

  • Part 1 (chapters 15) covers some of the core Azure resources. If nothing else, try to follow these chapters in order to have a solid understanding. You can then focus on the other chapters that most excite you.
  • Part 2 (chapters 612) covers availability and scale. You’ll learn how to automatically scale resources in and out, load-balance traffic, and handle maintenance events without downtime. To learn about running highly available applications on a global scale, this section is for you.
  • Part 3 (chapters 1316) is for the security geeks. It covers things like how to encrypt VMs, store SSL certificates in a secure vault, and back up and restore your data.
  • Part 4 (chapters 1721) covers a mix of cool areas to give a taste of what Azure can do for you and your customers. We’ll look at automation, containers, the Internet of Things, and server-less computing. Pick something that interests you, and have fun!

1.2.2. Try it now

Do you just want to read, or do you want to roll up your sleeves and play with Azure? Throughout the book are little tasks that let you quickly try something new. If you have the time, try them. Most of the hands-on time comes in a lab exercise at the end of the chapter, but there’s a lot of value in breaking up the reading by trying new concepts along the way.

1.2.3. Hands-on labs

Each chapter wraps up with a hands-on lab exercise. Some chapters, like this one, have a lab exercise in the middle of the chapter. These lab exercises are where you learn how all the pieces of Azure come together and can start to build some mental muscle memory. Grab your keyboard and mouse, and begin building something awesome!

1.2.4. Source code and supplementary materials

This book’s source code, along with accompanying scripts, templates, and supporting resources, can be found at www.manning.com/books/learn-azure-in-a-month-of-lunches and on the book’s GitHub repo at https://github.com/fouldsy/azure-mol-samples. In addition, you can participate in the book’s forum at https://forums.manning.com/forums/learn-azure-in-a-month-of-lunches.

1.3. Creating your lab environment

This book isn’t heavy on concepts and architecture—it’s more about hands-on time with the Azure platform. To do this, you need an Azure account.

1.3.1. Creating a free Azure account

Azure offers a free trial account that’s good for 30 days and provides up to $200 of free credit. This free credit should be enough to make it through all the chapters and exercises, with room to explore a little and have fun along the way! There are also many Azure services and features that remain free, even after your trial period ends.

Try it now

Follow along with the steps in this section to create your free Azure account.

1.  Open your web browser to https://azure.microsoft.com/free, and select the Start Free button, as shown in figure 1.1.

Figure 1.1. To follow along with all the exercises in this book, create a free Azure account if you don’t already have one.

2.  When prompted, sign in to your Microsoft account. If you need a Microsoft account or want to create a new one, choose the Create a New Microsoft Account link.

3.  Once signed in to a Microsoft account, complete the prompts to create a free Azure account, as shown in figure 1.2:

  1. Enter your personal details in the About Me section.

    • To help minimize abuse and fraud, provide a phone number to verify your identity by text message or phone call.
    • A credit card is also required for identity verification, but there’s no catch here. Your account doesn’t start billing you until after 30 days or when use up your $200 free credit. It won’t automatically transition to a pay-as-you-go subscription at the end of your trial.
  2. Review and accept the Azure subscription agreement and privacy policy, and then select Sign Up.
Figure 1.2. Complete Azure account sign-up information

3.  It may take a few minutes to get your Azure subscription ready. Once the sign-up process finishes and the Azure portal loads, take the quick tour to learn how to move around.

Your dashboard—the home page of the portal—looks empty right now. But in the next chapter you’ll dive into creating your first VM, and it will start to look like figure 1.3!

Figure 1.3. The Azure portal, ready for you to create your own applications and solutions

Is free truly free?

Azure has a Marketplace that contains hundreds of prebuilt images (the basis of VMs) and solutions you can deploy. We use some of these Marketplace offerings throughout the book, and it’s a great way to quickly deploy an entire application suite.

Not all of these Azure Marketplace offerings are free—some third-party publishers combine licensing or support costs into the solution you deploy. For example, a VM that you deploy from Red Hat may incur an additional fee that covers the Red Hat support agreement and license. These charges aren’t covered by your free trial credit; only the base VM usage is covered.

The exercises in this book only use resources that remain within the free trial. But if you go off exploring other cool Marketplace offerings in Azure, pay attention to what you build. Any solution that includes additional fees should clearly spell it out before you deploy!

1.3.2. Bonus lab exercise: Create a free GitHub account

GitHub is a free web service that many organizations and individuals use to manage projects such as code, templates, and documentation. Azure has hundreds of free templates and script examples that you can use and contribute to. This is one of the strengths of the open source community—sharing and giving back to others.

Some of the exercises in this book use resources from GitHub. You don’t need a GitHub account to do any of this, but if you don’t have an account, you won’t be able to save any modifications and begin to build your own collection of templates and scripts. Creating a GitHub account is an optional but highly recommended, part of building your lab environment:

1.  Open your web browser to www.github.com. To create a free GitHub account, provide a username, email address, and password.

2.  You’ll receive a validation message from GitHub. Select the link in the e-mail to activate your account.

3.  Check out some of the Azure repositories that provide sample resources:

  1. Azure Quickstart templateshttps://github.com/Azure/azure-quickstart-templates
  2. Azure CLIhttps://github.com/Azure/azure-cli
  3. Azure DevOps utilitieshttps://github.com/Azure/azure-devops-utils
  4. Learn Azure in a Month of Lunches book resourceshttps://github.com/fouldsy/azure-mol-samples

1.4. A little helping hand

This book can’t cover everything Azure offers. Even if I tried, by the time you read this chapter, I bet there will be something new in Azure! Cloud computing moves quickly, and new services and features are always being released. I may be a little biased, but as you start to explore Azure and want to learn about additional services, the excellent https://docs.microsoft.com/azure site is the best place to start. Every Azure service is documented with quickstart examples, tutorials, code samples, developer references, and architecture guides. You can also access both free and paid support options if you need help along the way.

1.5. Understanding the Azure platform

Before you get into the rest of this book, let’s take a step back and understand what Azure is and the services that are available. As I mentioned earlier, Azure is a cloud computing provider on a global scale. At the time of writing, there are 40 active Azure regions, with another 10 planned. Each region contains one or more datacenters. By comparison, the two other major cloud providers operate in 16 regions (AWS) and 15 regions (Google Cloud).

Cloud computing provides more than just compute resources. There are more than 100 services in Azure, grouped in families of related services such as compute, web + mobile, containers, and identity. With all these services, Azure covers many different service models. Let’s grab a slice of pizza for lunch to understand what this means: see figure 1.4.

Figure 1.4. Pizza as a Service model. As you move from homemade pizza, where you provide everything, to the restaurant model, where you just show up, the responsibilities and management demands change accordingly.

In the Pizza as a Service model, there are four options to choose from. As you progress through the models, you worry less and less about the process to eat a slice of pizza:

  • Homemade—You make the dough; add the sauce, toppings, and cheese; bake the pizza in your oven; get drinks; and sit down to eat at your dining table.
  • Take + bake—You buy a ready-made pizza. You just need to bake it in your oven, get drinks, and sit down to eat at your dining table.
  • Home delivery—You order a pizza delivered to your home. You just need to get drinks and sit down to eat at your dining table.
  • Restaurant—You want to go out and eat pizza with minimal effort!

Now that you’re hungry, let’s look at the more traditional model that involves some compute resources: see figure 1.5. This looks a little more like something you see in Azure. As you progress through the models, you manage fewer of the underlying resources and can focus more of your time and energy on your customers:

  • On-premises—You configure and manage the entire datacenter, such as the network cables, storage, and servers. You’re responsible for all parts of the application environment, support, and redundancy. This approach provides the maximum control, but with a lot of management overhead.
  • Infrastructure as a Service (IaaS)—You purchase the base compute resources from a vendor that manages the core infrastructure. You create and manage the VMs, data, and applications. The cloud provider is responsible for the physical infrastructure, host management, and resiliency. You may still have an infrastructure team to help support and deploy VMs, but they’re free from the time and cost of managing the physical equipment. This approach is good when you first start to move applications out of your own on-premises environment. The management and operations are often similar to an on-premises environment, so IaaS provides a natural progression for the business, IT, and application owners to become comfortable with the cloud.
  • Platform as a Service (PaaS)—You purchase the underlying platform stack from a vendor that manages the OS and patches, and bring your applications and data. Don’t worry about VMs or the virtual network, and your operations team can focus more of their time on application reliability and performance. This approach is often the beginning of the IT organization and the business becoming comfortable with running applications in the cloud. Your focus is on the applications and your customers, with fewer worries about the infrastructure to run those apps.
  • Software as a Service (SaaS)—You just need access to software, with a vendor providing everything else. Developers can build against an existing platform to provide customizations or unique features, without having to maintain a large code base. This approach is often daunting at first, but you likely already know of and use successful SaaS offerings such as Salesforce, Office 365, or the Google suite of Mail or Docs. You use e-mail, create documents or presentations, or manage customer contact information and sales information. Your focus is on the content that you create and manage, not how to make the application run.
Figure 1.5. Cloud computing service model

Most of what you create in Azure falls into the IaaS and PaaS areas. The main use cases include VMs and virtual networking (IaaS), or the Azure Web Apps, Functions, and Cosmos DB (PaaS) services. If you’re a developer, the PaaS solutions are probably the areas you’re most interested in, because Microsoft covers the infrastructure parts to let you focus on your code. IT pros may lean more toward the IaaS solutions to build out and control the Azure infrastructure.

Never stop learning

Don’t forget that even as a business moves from IaaS toward the PaaS model, the IT pro remains relevant! It’s important to understand what goes on underneath the PaaS layer when you design or troubleshoot a solution. If you’re an IT pro, don’t skip the chapters on PaaS solutions in Azure—there’s a lot you can add to your business and customers if you understand the transition to that deployment model.

1.5.1. Virtualization in Azure

Virtualization is the real magic behind Azure. The IaaS, PaaS, and SaaS models use virtualization to power their services. The concepts of virtualization are nothing new, going all the way back to the mainframe days of the 1960s. In the mid-2000s, server virtualization in the datacenter started to gain momentum, and by now only a few workloads are deployed to bare-metal servers rather than being virtualized.

Entire books are dedicated to virtualization, but to give you a quick overview, virtualization logically divides physical resources in a server into virtual resources that can be securely accessed by individual workloads. A VM is one of the most common resources in cloud computing. A VM contains a virtual CPU (vCPU), memory (vRAM), storage (vDisk), and network connectivity (vNIC), as show in figure 1.6.

Figure 1.6. Virtualization in action on a physical host in Azure

In addition to physical servers, storage and networking are also now commonly virtualized, which allows the Azure platform to quickly define everything you need in software. No physical interaction or manual configuration of devices is required. You don’t have to wait for another team to provide an IP address, open a network port, or add storage for you.

At its core, Azure runs on Windows—sort of. A modified version of the Hyper-V hypervisor powers the compute servers. Hyper-V is a type 1 (bare-metal) hypervisor that has been available in Windows Server for a decade. And don’t worry, you can still run Linux as a fully supported, first-class workload! Microsoft is a huge contributor to the Linux community and kernel; some of the core software-defined networking in Azure is powered by a custom-built solution based on Debian Linux—Software for Open Networking in the Cloud (SONiC)—that Microsoft has made open source. You can take a virtual tour of Microsoft’s datacenters at www.microsoft.com/cloud-platform/global-datacenters.

1.5.2. Management tools

With so many Azure services, how do you use them? Any way you want! If you want to select everything in a web browser, there’s an awesome web-based portal. Comfortable with PowerShell? As you’d expect, there’s an Azure PowerShell module. There’s also a cross-platform command-line interface (CLI) tool that’s great if you’re on macOS or Linux. And developers can interact with Azure through REST APIs using a variety of common languages such as .NET, Python, and Node.js.

Azure portal

The Azure portal should work in any modern web browser, and it’s a convenient way to use Azure without installing anything on your computer. The portal is also a great way to learn how to create and manage resources by quickly seeing a visual representation of everything.

New features and services are constantly being added to Azure, so the portal may change ever so slightly from what you see in the screenshots in this book or online documentation and blogs. The wording on a button may change a little, or a new option may be added, but the core operations all remain the same. Welcome to the brave new world of cloud computing!

Azure Cloud Shell

If you want to get your hands on the keyboard and type in commands, the portal also includes the Azure Cloud Shell, shown in figure 1.7. This shell is a web-based interactive console that provides a Bash shell, the Azure CLI, and some preinstalled application development tools such as Git and Maven. There’s also a PowerShell version of the Cloud Shell that, as the name implies, provides access to the latest Azure PowerShell cmdlets.

Figure 1.7. The Azure Cloud Shell in the web-based portal

You can access the Azure Cloud Shell from a web browser on any computer without needing to install any tools at http://shell.azure.com. Editors like Visual Studio Code (http://code.visualstudio.com) provide Cloud Shell access within the application. There’s even an Azure app available for iOS and Android that allows you to use the Azure Cloud Shell straight from your iPhone.

With the Azure Cloud Shell, you always have access to the latest version of the CLI or PowerShell tools. Persistent storage is attached that allows you to create and save scripts, templates, and configuration files.

Local Azure CLI and PowerShell tools

Although there are advantages to the Azure Cloud Shell, you often need access to your local filesystem and tools. You can install the Azure CLI or Azure PowerShell locally so that you can work with local resources and Azure resources.

In this book, we mostly use the Azure CLI (technically, the Azure CLI 2.0). It may seem odd to choose this over Microsoft’s native PowerShell—the advantage is that samples and exercises can work both in the Azure Cloud Shell and locally on your computer, regardless of what OS you use. Although this isn’t part of setting up your lab environment, the following guides detail how to install the Azure management tools on your computer:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.132