You're reading from Windows Server 2016 Automation with PowerShell Cookbook - Second Edition
Azure is Microsoft's cloud computing platform and is a competitor to Amazon's Amazon Web Services and other public cloud providers, Azure provides you with access to a huge range of features. Organizations can literally move their entire on-premises infrastructure into the cloud.
Azure features come at three levels:
- Infrastructure as a service (IaaS)
- Platform as a service (PaaS)
- Software as a Service (SaaS)
IaaS is, in effect, an instant computing infrastructure that you can provision, manage, and use over the internet or via a private network connection. IaaS includes the basic computing infrastructure components (servers, storage, networking, firewalls, and security) plus the physical plant required to run these components (power, air conditioning, and so on). In an IaaS environment, the servers are all Azure virtual machines (effectively Hyper-V VMs) and interact with the networking, security, and storage components.
PaaS is a complete deployment environment in the cloud, including...
There are two key things you need to do before you can begin to manage Azure features using PowerShell. The first is to obtain an Azure subscription. The second is to get access to the cmdlets you need to be able to access Azure (and Office 365's features).
Azure is a commercial service—each feature you use has a cost attached. Azure charges are based on resource usage. With an Azure VM, for example, you would pay to have the VM running, with additional charges for the storage the VM uses and for any network traffic. The charges for Office 365, on the other hand, are user based—a given user can use lots of email, for example, without incurring any additional charges. For details on costs for Azure, see https://azure.microsoft.com/en-us/pricing/, and for details of Office 365 charges, see https://products.office.com/en-us/business/compare-office-365-for-business-plans.
To use Azure's IaaS and PaaS features, you need to have an Azure subscription. There are many ways...
In the previous recipe, you created and used the basic Azure management environment by downloading the key cmdlets, logging in to Azure and having a brief look around. In this recipe, you create certain key Azure assets, including a resource group, a storage account, and tags. With Azure, all Azure resources are created within a resource group.
A storage account is a fundamental building block within Azure. ALL storage you use with any Azure feature always exists within a storage account. You create a storage account within one of the Azure regions you saw in the Using PowerShell with the Azure recipe. When you create your storage account, you also specify the level of resiliency and durability provided. There are several levels of replication provided within Azure which provide for multiple copies of the data that are replicated automatically in both the local Azure data center but also in other data centers. The extra resilience, which does come at a price...
Many Azure resources use Azure storage. In the Creating an Azure backup recipe in Chapter 5, Managing Server Backup, you saw how to use Azure storage to hold server backups. When you create an Azure VM, you store the VHD file in Azure storage. Azure storage accounts can hold a variety of types of data, with different mechanisms for managing each data type. Additionally, the storage account provides both scalability and data durability and resiliency.
Azure storage manages five distinct types of data:
- Binary Large Object (Blob)
- Table
- Queue
- File
- Disk
A blob is unstructured data you store in Azure. Blob storage can hold any type of data in any form. This could include MP4 movies, ISO images, VHD drives, JPG files, etc. Individual blobs reside with blob containers which are equivalent to file store folders, but with no nesting capability.
Blobs come in three types: block blobs, append blobs, and page blobs. Block blobs are physically optimized for storing documents to...
Azure provides a number of ways in which you can create rich web and mobile applications in the cloud. You could setup your own virtual machines, install IIS, and add your own web application. If your application needs to store data, you can create SQL Server VMs, or use Azure's SQL database feature—or any of the other database packages supported in Azure.
A simpler way is to create an Azure Web App. At one time, Azure offered what were termed websites. These were, as the name says, websites in which you could run your own application, or a host of others such as WordPress. These were single tier (possibly with a back-end database). However, Microsoft discontinued this feature and has replaced it with the more generic Web App feature.
Azure Web Apps enabled you to build, deploy, and manage rich websites and web applications. You can use frameworks such as .NET, Node.js, PHP, and Python in these applications and use any database software appropriate to your needs...
An Azure VM is essentially a Hyper-V VM that you run within Azure. There are some differences between Hyper-V VMs you create within Server 2016 (or Windows 10) and Azure VMs but they are minor. The ARM based cmdlets you use are a little different in style to Hyper-V cmdlets which may mean a bit of a learning curve.
At the time of writing, you can only use the VHD format for your virtual hard disks in an Azure VM although like many things in Azure this may change at some point in the future. Should you wish to move a Hyper-V VM into Azure that uses a VHDX hard disk file, you would need to convert the disk type to be a VHD.
In this recipe, you first create a virtual network. Your VM can have both a public IP address and a private VLAN based IP address. At the end of this recipe, you access the VM via the VM's public IP address. In a later recipe, you create a VPN and connect to the VM using the VPN addresses. You also create a NIC and give it a public...