You are on page 1of 22
ano “Module 8: Implementing Azure Cloud Services Module 8: Implementing Azure Cloud Services Contents: Module overview Lesson 1: Planning and deploying Azure Cloud Services Lesson 2: Managing and maintaining Azure Cloud Services Lab: Implementing Azure Cloud Services Module review and takeaways Module overview Azure Cloud Services constitute another hosting model you can use to run web applications and web services in Microsoft Azure. These cloud services use a modular architecture thal allows you to scale your application to very large sizes while minimizing costs. In this module, you will see how to create, configure, manage, and monitor cloud services. Objectives ‘After completing this module, you will be able to’ Plan and deploy Azure Cloud Services. * Explain how to manage and maintain Azure Cloud Services Lesson 1: Planning and deploying Azure Cloud Services ‘Azure provides two main categories of hosting options for applications: infrastructure as a service (laaS) and platform as a service (PaaS). So far, this course has covered laaS-based Azure VMs and PaaS-based Aop Service, In this lesson, you will see how PaaS-based Azure Cloud Services differ from Azure App Service and ‘Azure VMs and how Azure Cloud Services allow you to create a modular, flexible, and highly scalable application architecture, You will also see how to configure Azure Cloud Services and deploy cloud service packages created by developers. Lesson objectives ‘After completing this lesson, you will be able to: Describe how Azure Cloud Services integrate with other Azure services to support applications. hips swuskpipe.conien-GB/Book/BookPrinViewiadd2oaS1-887e-4939-8673-2451231637017Documertid=108AnnotationFiterOwn=true 1722 ano “Module 8: Implementing Azure Cloud Services * Explain how to create and deploy Azure Cloud Services. * Describe how to manage Azure Cloud Services deployment environments. * Explain how to update Azure Cloud Services. Demonstration: Preparing the lab environment for the remainder in this module Perform the tasks in this demonstration to prepare the lab environment. The environment will be configured while you progress through this module, learning about the Azure services that you will use in the lab. Note: Important: The scripts used in this course might delete objects that you have in your subscription. Therefore, you should complete this course by using a new Azure subscription. You should have received sign-up delails and instructions for crealing an Azure leaning pass for this reason. Alternatively, you can create a new Azure trial subscription. In both cases, use a new Microsoft account that has not been associated with any other Azure subscription. This will eliminate the possibilty of any potential confusion when running setup scripts. ‘This course relies on custom Azure PowerShell modules including Add-20533DEnvironment to prepare the lab ‘environment for demos and labs, and Remove-20533DEnvironment to perform clean-up tasks at the end of the module. Azure Cloud Services as components of Azure Compute Networking Data & Storage Web & Mobile Virtual Machines Virtual Network Disk Storage Virtual Machine ‘Azure DNS Blob Storage Web Apps Scale Sets eee Application Cloud Services ose File Storage Mobile Apps ponte Tratfic Manager Queue Storage Logic Apps Container Registry Expresshaute Table Storage Content Delivery Container Load Balancer StorSimple Network Service Se Other services Azure AD MFA Site Recovery Key Vault Azure AD DS Automation _) +22 Avavtics__) (Network Watcher Azure Monitor —————_—_—, ee Azure Securit ‘Azure B2C Backup ‘Azure Advisor Center ‘Azure VMs is an laaS execution model that allows you to install and configure servers to run both stateful and stateless applications in the cloud. Azure App Service is a PaaS execution model that you can use to run stateless applications and services without maintaining underlying hardware, operating systems, and web servers. You have hips wus pipe.convlen-B/Book/BookPrinViewiadd2oa51-887e-4989-8673-2451231637017Documentid=108AnnotationFiterOwn=tue 22 ano “Module 8: Implementing Azure Cloud Services learned about these services earlier in this course. In this module, you will learn about another hosting model currently available in Azure, which is referred to as Azure Cloud Services, Note: In Azure, the term cloud service refers to either a cloud service that hosts classic Azure VMs or a cloud service that hosts web roles and worker roles, Both service types are specific to the classic deployment model, In this module, the term Cloud Services refers to the Azure service that contains web and worker roles. Any references to instances of this service will use the noncapitalized notation (cloud service) ‘You can use the Azure Cloud Services hosting model to host websites or web services. You can build these web services with a more modular architecture than Azure App Service provides. In particular, Azure Cloud Services ‘can divide the workload into web roles and worker roles. A web role provides front-end functionality, whereas a worker role typically handles background tasks. Just like Azure App Service, Azure Cloud Services allow you to scale out your applications to help ensure fault tolerance and provide scalability. However, you have extra flexibility with Azure Cloud Services, because you can scale each role independently of other roles in the same application. Note that despite this modularity, you can configure virtual machines hosting different roles to directly communicate with each other within the same cloud service, ‘Azure Cloud Services closely integrate with other Azure PaaS services and with services deployed by using the classic deployment model, For example, you can deploy a PaaS cloud service into a classic virtual network to allow direct communication with other Azure Cloud Services or classic Azure VMs. This also allows Azure Cloud Services lo communicate directly with Azure VMs deployed by using the Azure Resource Manager deployment model, as long as the classic VNET is connected to the virtual network hosting these virtual machines through a VNET-to- \NET connection or VNET Peering You can use a storage account or an Azure SQL Database instance to provide persistent storage for virtual machines running web and worker roles. This, in tur, allows you to facilitate scenarios that require preserving the session state, which should not be stored directly within Azure Cloud Services because of their stateless nature, ‘Temporary storage services (such as Azure Storage queues or Azure Service Bus queues) also provide a means of asynchronous messaging between web and worker roles. ‘Azure Cloud Services can also use Azure services such as Content Delivery Network, Azure Traffic Manager, and ‘Azure Active Directory, which enhance the capabilities of web applications and services. You implement these services to interact with Azure Cloud Services in a similar way as in virtual machines or App Service. ‘Azure Cloud Services are not fully compatible with services deployed by using the Azure Resource Manager deployment model. In particular, you cannot deploy a PaaS cloud service to a virtual network created by using the Azure Resource Manager deployment model. Azure Cloud Services overview hitpswwu.skpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 322 ano “Module 8: Implementing Azure Cloud Services aol oim Role TS elated PaaS oe cloud Role service Misc lte Traditionally, you could use three hosting models for running applications in Azure: laaS-based Azure VMs. This model involves running applications on Windows and Linux virtual machines. It offers the highest degree of control of the operating system, allowing you to install, customize, and run almost any application, providing that the resulting configuration does not rely on network or storage infrastructure functionality that is not currently supported in Azure. Such flexibility, however, comes with management overhead, because you, as the owner of the virtual machines, are responsible for the maintenance and updates of the operating system, the application, and any of its software dependencies. PaaS-based Azure App Service. This model eliminates the management overhead associated with laaS-based Azure VMs. It delivers a fully managed platform designed specifically to optimize the development, deployment, and running of web and mobile applications, These optimizations, along with the stateless nature of applications that this model supports, result in superior agllity. App Service also considerably simplifies the integration and automation of business processes in addition to the building, publishing, and consuming of cloud application programming interfaces (APIs). However, this simplicity and ease of use limit your flexibility to some extent. For example, this affects your ability to use App Service to implement muttitier applications, where the compute and web tiers must operate and scale independently. Your access to the virtual machines hosting App Service applications is also considerably more limited. For example, you cannot connect to them through Remote Desktop. * PaaS-based Azure Cloud Services. This model combines the advantages of laaS-based tps shwwn.slpipe.conen-SB/Book/Book?rintViewiadd2ea51-8876-4999-8673-sd51291697017Documertid=108AnnotationFiterOwn=itue 22 vente Module 8; Implementing Azure Cloud Services Azure VMs and PaaS-based App Service. It gives you direct access to the virtual machines hosting your applications, but at the same time, it relies on the platform to handle their maintenance and updates. It is well suited for supporting multi-tier applications by facilitating distinct roles, with the web role providing front-end services and the worker role handling background tasks. Because the Azure platform must provision virtual machines automatically for each tier, the entire configuration of the virtual machines must be defined by using a combination of compiled code and configuration files. Consequently, they are stateless and should not be used to store any data. Note: The differences among the hosting models just listed become less distinct as Azure services evolve. For example, Azure App Service includes the Premium service plan option called Azure App Service Environment, intended for multi-tier applications. This is possible because ofits ability to host multiple resource pools, with one of them providing front-end services and up to three handling background tasks. Similarly, Azure Resource Manager-based Virtual Machine Scale Set service, with its elasticity and superior scale-out capabilities, resembles Azure Cloud Services in many aspects This traditional arrangement is changing with the advent of microservices, which represent small, self-contained ‘components of individual applications. In particular, Azure Service Fabric is quickly emerging as anew PaaS. hosting model along with other compute platforms, such as containers or Azure Container Services. For example, Service Fabric is frequently referred to as PaaS 2.0 because of its support for both stateful and stateless services and its improved use of computing resources. The latter results from the more efficient distribution of application ‘components across multiple virtual machines. Containers provide another way to host applications in Azure. They enable running multiple applications fully isolated from each other on the same Azure virtual machine, further increasing resource utilization. In addition, containerization based on Docker and Windows Server Containers offers a standardized approach to application Packaging and deployment, best exemplified by Azure Container Service. You can also use containers in ‘combination with the microservices-based application hosting model. This allows you to capitalize on the benefits offered by each, including hyperscaling and increased density as well as isolation and standardized application management, Note: For a more comprehensive overview of compute hosting models in Azure, refer to the topic “Understanding compute hosting options provided by Azure” in Module 1, “Introduction to Microsoft Azure.” Roles in Azure Cloud Services ‘As mentioned earlier, in Azure Cloud Services, developers can divide the expected workload and the corresponding code into separate roles. Two types of roles exist: Web roles. A web role serves as the front end of a cloud service and runs on one or more virtual machines, with each one hosting a Microsoft Internet Information Services (IIS) web server. For example, in a web site based on Microsoft NET, the web role contains the web pages that make up the user interface for the web application. * Worker roles. A worker role typically handles asynchronous background processes. It also hips swwu.skpipe.conien-B/Book/BookPrinViewiadd2oa51-887e-4999-8673-245123163701?Documertid=108AnnotationFiterOwn=true 5/22 ano “Module 8: Implementing Azure Cloud Services commonly runs on one or more dedicated virtual machines. A web role commonly uses a worker role to complete resource-intensive, long-running, or continuous tasks You can configure each role to have multiple instances. By creating multiple instances for each role, you can scale out the cloud service and increase is resilience to failures. Web roles and worker roles enable flexible and efficient scaling. For example, if an application has one processor- intensive task, such as video processing, developers can separate that code into a worker role. When you deploy the cloud service, you can scale the processor-intensive task independently without having to scale out the entire application, which would unnecessarily increase the overall cost. Note: Create at least two instances of each role in your Azure cloud service. This helps ensure that an instance is available to respond to users if a single failure occurs. You need to create at least two instances of each role to qualify for the 99.95 percent uptime guarantee stipulated in the Azure service level agreements (SLAs). Instances of the same role run in separate fault domains and separate upgrade domains. is common to configure Azure Cloud Services to Because virtual machines hosting role instances are stateless, use a database to store any content that needs to be preserved. To implement such a database, you can run Microsoft SQL Server in an Azure virtual machine or deploy an Azure SQL Database instance, ‘You can create a cloud service by using a configuration file and an application package containing compiled code and a cloud service definition file, The next lesson explores the structure of Azure Cloud Service in more detail. Creating and deploying Azure Cloud Services PaaS cloud service Configuration =e oo —— — Visual Studio Visual Studio Azure portal Team Services hips sIwwuskpipe.convien-GB/Book/BookPrinViewiadd2oa51-887e-4999-8673-245123163701?Documentid=108AnnotationFiterOwn=irue 22. ano “Module 8: Implementing Azure Cloud Services Developers typically define the structure and applications that an Azure cloud service will host by using an Integrated Development Environment (IDE) such as Microsoft Visual Studio, The Azure software development kit (SDK) includes emulators that can run web roles and worker roles on developers’ computers in an environment that closely matches Azure. After a cloud service code is complete, the next step involves creating a cloud service in ‘Azure and deploying the code into it. Creating a PaaS cloud service To create a PaaS cloud service in the Azure portal, complete the following steps: 1. On the hub menu, click +New. 2. On the New blade, click Compute. 3. On the Compute blade, click Cloud service 4. Onthe Cloud service (classic) blade, specify the following settings: © DNS name: Any unique name © — Subscription: The name of your Azure subscription © Resource group: The resource group where the cloud service will reside © Location: The Azure region that will host cloud service instances 5. Atthis point, you have the option to upload the cloud service package file and the configuration file, and specify the production or staging environment where the cloud service instances will be deployed. Alternatively, you can create a PaaS cloud service by using the New-AzureService Azure PowerShell cmdlet, as shown in the following example. Note that this method does not allow you to specify the resource group or upload the package and configuration files when you create a cloud service. New-Azureservice ~ServiceName 'MyNewService’ -Location ‘East US" Deploying service code After you create a cloud service, you also need to deploy the compiled service code and the service configuration file that define the settings of web and worker roles. Three common ways to perform this deployment are: * From Visual Studio, by using the Publishing Wizard. To ease this deployment method, you can obtain a publish profile from Azure and import it into Visual Studio. This method uses Web Deploy to create and configure web roles. * From the Azure portal, by uploading a cloud service package and configuration file. Developers can create these files by using the Packaging Wizard in Visual Studio. Administrators can use these files to upload the service code and start the application. hips wu.skpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=iue 7/22 ano “Module 8: Implementing Azure Cloud Services * From Visual Studio Team Services, by configuring continuous deployment. If you choose this option, take care to ensure that untested code is not accidentally deployed to the production environment. Frequently, Visual Studio Team Services is configured to deploy code to a staging environment. After the staged code has been tested, administrators can move it to the production environment Note: In the lab, you will see how to deploy a cloud service by using the Azure portal Managing deployment environments for Azure Cloud Services * During development: + The cloud service runs on developers’ local computers +» The compute emulator runs cloud service code - The storage emulator stores blobs and other data + During staging: + The cloud service is deployed to a staging slot + Azure runs the code - Azure hosts the storage + For production: - The cloud service is deployed to a production slot + Azure runs the code + Azure hosts the storage A cloud service runs in different locations during development, testing, and production. In each organization, development teams work based on different project models, However, the following divisions are commonly used. During development Most developers run informal tests on their code as they develop it, These tests, which all the developers on the team run repeatedly as they modify code, are considered essential in many organizations. Because developers run these tests frequently, they code and run them in the IDE. At this stage, the code runs on the developers’ computers. For an Azure Cloud Service project, developers need an environment on their local computers that closely matches ‘Azure. The Azure SDK provides such an environment, This SDK has two important components, both of which start on the developer's computer in debugging mode: hips swwuskpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 22. ano “Module 8: Implementing Azure Cloud Services * The Azure compute emulator. Web roles and worker roles run within this emulator. * The Azure storage emulator. The emulator provides Blob storage, Queue storage, and Table storage services. During staging Staging is the last opportunity to test a project before it is deployed to production. The following tests are commonly performed at this stage * Acceptance testing. These tests check that the completed project satisfies the functional and nonfunctional requirements. Performance testing. These tests simulate user demand and determine the CPU, memory, and other resources that might be required to cope with the expected load. * Beta testing, A limited number of the final users of the project are granted access to the staging environment to try out the software and identify issues For an Azure Cloud Service project, the staging environment should be in Azure itself—so you must deploy the project. You can use a staging slot for this deployment. A staging slot is a deployment of a cloud service with the following characteristics: * Inthe Azure portal, it appears within a single cloud service, together with the production slot. * To access the cloud service in the staging slot, you use a URL that includes the GUID. For example, if your cloud service is found at http://myservice.cloudapp.net, the staging slot is found at http://GUID.cloudapp.net. You can determine the GUID by browsing the service's dashboard in the Azure portal. ‘Alternatively, you can create a separate cloud service for staging, By using a staging slot, when all the tests have passed, you can deploy the service to production by using a virtual IP (VIP) swap. In this operation, the staging and production slots are swapped, which means that the accepted new version is moved lo production without a new deployment of the code. During production The production environment is the final destination forthe cloud service code, This environment runs thoroughly tested and debugged code that your team has complete confidence in and services real user requests based on live data and configuration settings. Demonstration: Creating and deploying Azure Cloud Services In this demonstration, you will see how to: hips shwuskpipe.conien-GB/Book/BookPrinViewiadd2oa5!-887e-4939-8673-2451231637017Documentid=108AnnotationFiterOwn=tue 22 ano “Module 8: Implementing Azure Cloud Services Create a new PaaS cloud service by using Azure PowerShell Configure and package a cloud service project in Visual Studio. * Deploy a packaged cloud service project by using the Azure portal. Updating Azure Cloud Services «Uploading a new package and configuration file - Using continuous deployment for upgrades - Swapping deployments PaaS cloud service ‘After deploying the first version of a cloud service, developers tend to continue modifying the code, Changes can include new features, bug fixes, efficiency improvements, code that utilizes new features of the Azure platform, or code that implements user feedback. To deploy a new version of a cloud service to Azure, you must upload the compiled package file and configuration file in the same way that you did when deploying the first version, You can do this by using the Publishing Wizard in Visual Studio, by manually uploading the files in the Azure portal, or by using continuous deployment in Visual Studio Team Services. Regardless of the approach, you should use a staging slot to evaluate the functionality and performance of the new version before promoting it to production. Staging slots provide an extra advantage when deploying updated services. When you move the staged code into the production slot by performing a VIP swap, the older version of the service is automatically moved into the staging slot and not overwritten. In the event of any problem with the new version, you can easily roll back the deployment to the old version by swapping again. In addition, the VIP swap does not take a significant amount of time, eliminating potential downtime associated with the staging process, Note that unlike with App Service, staging functionality is implemented by using dedicated virtual machines, which means you have the option to test deployments without affecting the performance of the production services. tps shwwn.silpipe.conven-SB/Book/Book?rintViewiadd2ea51-8876-4999-8673-sd51291637017Documertid=108AnnotationFiterOwn=itue 10/22, ano “Module 8: Implementing Azure Cloud Services Lesson 2: Managing and maintaining Azure Cloud Services Developers create and modify code that defines Azure Cloud Services, but Azure administrators must be able to configure and manage their deployments. For example, administrators must ensure that a cloud service is able to accommodate expected and unexpected peaks in demand. In this lesson, you will see how to configure a cloud service by using configuration files and the Azure portal Lesson objectives At the end of this lesson, you will be able to: * Modify a cloud service by making changes to the service configuration file. * Explain how to manage endpoints and queues. * Describe how to add a cloud service to an Azure virtual network. * Explain how to configure the monitoring of Azure Cloud Services. * Describe how to monitor Azure Cloud Services. ‘When you deploy a cloud service to Azure, you upload two files: * The package file. This file contains the compiled code for web roles and worker roles. hips shwuskpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 11722 ano “Module 8: Implementing Azure Cloud Services * The configuration file. This file contains configuration settings that Azure uses when it starts instances of the roles of the cloud service. ‘The configuration file that is used in development is typically not appropriate for staging or production. Visual Studio automatically generates two versions of the fle: ServiceConfiguralion. Local.cscfg is for local development and ServiceConfiguration.Cloud, cscfg is for deployment to Azure, If you need to modify the configuration settings after development is completed, you can accomplish this in several ways: Edit the file directly. The configuration file is an .xmI file, so you can use any text editor to make changes. Edit many values in the Azure portal after deployment. Use the Visual Studio Publishing Wizard. Its friendly interface helps to simplify adjusting the parameters of connection strings. Example Service Configuration File «instances count="1" /> 'storageConnectionstring ‘UseDevelopmentstorage=true” /> instances count="1" /> ‘Data Soure hips swu.sklpipe.conien-B/Book/BookPrinViewiadd2oa51-887e-4999-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 12722 ano “Module 8: Implementing Azure Cloud Services The preceding example shows a typical configuration file used in the development environment, Only one instance of each role is configured, and connection strings use the Azure storage emulator and a local database. ‘A configuration fle used for an Azure deployment commonly includes custom values for the following parameters: Instance count, You should always use two or more instances of every role in the production environment, This considerably improves resilience and qualifies the service for the 99.95, percent uptime guarantee stipulated in the Azure availability SLAs. Use the Count attribute of the tag to specify the number of instances for each role. Database connection strings. You must ensure that the database connection strings point the cloud service to the production database. This database can be an Azure SQL Database instance or a SQL Server instance running in an laaS virtual machine. When using an Azure SQL Database instance, you can copy its connection string from its settings displayed in the Azure portal. Storage connection strings. If the service uses an Azure storage account, you must ensure that the storage connection strings point the cloud service to the production storage account. You can copy the connection string designating a storage account from its settings displayed in the Azure portal. Managing endpoints and queues + Direct communication + Input endpoints + Internal endpoints - Instance input endpoints * Queue-based communication - Azure Storage queues + Up to 64 KB in each message + Up to 500 TB of queue capacity + Seven days TTL for each message + Service Bus queues + Up to 1 MB in each message (depending on the service tier) + Up to 80 GB of queue capacity (depending on partitioning settings) + Unlimited message TTL Although web roles and worker roles in an Azure cloud service run on different virtual machines, you must ensure that they can reliably communicate. One way to accomplish this objective is to allow for direct connectivity, where hitpsswwuzskpipe.conien-B/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documentid=108AnnotationFiterOwn=true 13722 ano “Module 8: Implementing Azure Cloud Services one role calls an endpoint of another role. Another commonly used approach involves indirect communication through a queue, Software architects and developers typically choose the most-appropriate connectivity mechanism. However, as an administrator, you should be familiar with the different options available when configuring Azure Cloud Services. Direct communication Roles can communicate direclly. For example, a web role can service a user request by calling a method in a worker role, To enable this type of communication, you must create an endpoint in the destination role, There are three types of endpoints: Input endpoints, These external, load-balanced endpoints enable Azure services and any Internet-connected clients outside of the cloud service to call the role using a designated protocol (TCP, UDP, HTTP, or HTTPS) on a specific port. Internal endpoints. These endpoints enable roles within the same cloud service to directly communicate using a designated protocol (TCP, UDP, HTTP, or combination of these) on a specific port. Instance input endpoints. These endpoints enable Azure services and any Internet- connected clients outside of the cloud service to call a specific instance of a role using a designated protocol (TCP or UDP) on a specific port. You can administer endpoints in the cloud service configuration file. For example, the following XML cade defines an internal endpoint for a worker role, Worker Role Endpoint Definition The following XML code defines an external endpoint for a web role. Web Role Endpoint Definition Using Storage queues and Service Bus queues hips swuskpipe.conien-GB/Book/BookPrinViewiadd20a51-887e-4999-8673-245123163701?Documentid=108AnnotationFiterOwn=irue 14722, ano “Module 8: Implementing Azure Cloud Services Instead of using direct communication, developers and software architects might use a queue to temporarily store messages that roles send to each other. By using a queue, you can ensure that all messages reach their destination, because each role processes its respective messages in the queue asynchronously. Yau can also limit the possibility that the message processing task will consume all the resources of the role instances. For these reasons, a queue is a popular communication method. ‘Two commonly used types of queues that Azure offers are Azure Storage queues and Service Bus queues. ‘Typically, developers and software architects decide which queuing mechanism to use in a scenario. However, IT professionals should be aware of differences between these two options and be able to configure them in ‘combination with a cloud service. The following table lists basic differences between Azure Storage queues and Service Bus queues. Characteristic Storage queue Service Bus queue Maximum message size 64 kilobytes (KB) 256 KB or 1 megabyte (MB), depending on the service tier Maximum queue size 500 terabytes (78) 1 gigabyte (GB) to 60 GB, depending on paritioning settings Maximum message Tn | Seven aye Unlimited Additional Reading: For more information about the differences between Storage queues and Service Bus queues, see: Azure Queues and Service Bus queues - compared and contrasted at http://aka.msiWgyqSt. Adding a cloud service to an Azure virtual network cloud service Sacer rei By default, a cloud service is not directly accessible from any Azure VM or other cloud services in your Azure subscription, Instead, Azure VMs and other cloud services can access a cloud service in the same way that, external clients can—by using a public endpoint, hips shww.skpipe.convion-GB/Book/BookPrinViewiadd20a51-887e-4999-8673-245 12316370170 acumartld=108 Annotation FiterOun: ano “Module 8: Implementing Azure Cloud Services You can enable direct communication between an Azure cloud service, Azure VMs, and other Azure cloud services by deploying them into the same classic virtual network or across multiple, connected virtual networks. To learn more about Azure virtual networks, refer to Module 2, “Implementing and managing Azure networking.” Keep in mind that you cannot deploy an Azure cloud service into a virtual network provisioned by using the Azure Resource Manager deployment model. By deploying a cloud service into a virtual network, you can: Reduce the latency of communication between Azure cloud services and Azure VMs, because communication is direct and does not traverse public endpoints and an Azure load balancer. Enable on-premises clients to connect directly to a cloud service. This is possible if the virtual network has connectivity to your on-premises network through a site-to-site virtual private network (VPN) or ExpressRoute. To add a cloud service to a virtual network, you must add a section to the service configuration file, You must insert this section after all the roles have been defined in the file, Inthe following example, the service configuration file determines that the current cloud service will be added to the A. Datum HQ virtual network. Adding a PaaS Cloud Service to a virtual network Note: You must add one element to the element for every role in your cloud service. Demonstration: Scaling Azure Cloud Services In this demonstration, you will see how to: Set the default instance count for a cloud service. * Schedule a larger instance count for an expected load peak. hips wus pipe.convlen-B/Book/BookPrinViewiadd2oa51-887e-4989-8673-2451231637017Documentid=108AnnotationFiterOwn=tue 1622 ano “Module 8: Implementing Azure Cloud Services Note: The scheduled scaling technique allows you to adjust the number of instances of cloud service roles that are available during an expected increase in demand for the services provided by the cloud. service. After the peak period passes, instances are automatically de-provisioned to avoid any extra cost. ‘When you set the schedule, bear in mind that it can take a few minutes for each new instance to become available. Start your schedule before the expected peak period to ensure that the full capacity is reached in a timely manner. Coni iguring monitoring for Azure Cloud Services «Basic monitoring - Provides basic metrics: CPU percentage, data in, data out, disk read throughput, disk write throughput - Does not incur extra charges * Diagnostics monitoring + Requires a storage account » Requires a diagnostics connection string + Provides a much wider range of performance metrics: + application logs, Windows Event Logs, performance counters, infrastructure logs, ETW logs, crash dumps + Incurs storage costs Cloud services might need to support large numbers of users and continue to respond quickly even during increased demand. You should be able to monitor the performance of your service to help ensure that users have a satisfactory experience. ‘Azure provides built-in basic monitoring functionality for Cloud Services. You can use this to determine how a cloud service is using the resources of virtual machines hosting its role instances, Basic monitoring By default, Azure Cloud Services collect performance data that includes the following counters on a per-role basis: * CPU (percentage) * Disk read throughput (bytes/second) * Disk write throughput (bytes/second) * Network in (bytes) hips sIwu.skpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=tue 17/22 ano “Module 8: Implementing Azure Cloud Services * Network out (bytes) You configure monitoring separately for the production and staging deployments. agnostics monitoring When you enable diagnostics monitoring, you can collect a much larger range of counters. This allows you to gain a more detailed picture of the performance of instances and roles. Verbose monitoring stores data in table storage. Therefore, you must create a new storage account or designate an existing account that will store verbose monitoring data To configure diagnostics monitoring, you must enable and configure Azure Diagnostics for the cloud service, You ‘can accomplish this by using the following methods: * When developing a new cloud service, apply the intended configuration in the Diagnostics Configuration interface in Visual Studio, To implement this change, start by navigating to that role in Solution Explorer and displaying the role’s Properties window, In the Properties window, in the Diagnostics section, select the Enable Diagnostics check box, Specify the storage account that should host the diagnostics data, Click Configure to display the Diagnostics configuration dialog box. From here, you can specify individual sources of collected data, including application logs, Windows Event Logs, performance counters, infrastructure logs, Event Tracing for Windows (ETW) logs, and crash dumps. Other settings available within this dialog box include Disk Quota in MB, which designates the maximum amount of space that diagnostics data should occupy. Visual Studio saves the changes you make in the diagnostics.wadcfgx configuration file. Alternatively, you can modify the diagnostics.wadcfgx configuration file directly. In either case, your changes take effect the next time you run your project from within Visual Studio. The changes also apply to the target Azure cloud service once you deploy your code into Azure. When modifying an existing cloud service, in Solution Explorer, right-click the target role, and then click Update Diagnostics Settings. You will then see the same Diagnostics. configuration dialog box that is available when configuring diagnostics prior to a deployment. Starting with Azure SDK 2.6, you can use the service configuration file to specify the diagnosties storage account. This makes it simpler to assign different storage accounts for separate deployments of the same cloud service. Additional Reading: You will configure Azure Cloud Services diagnostics differently depending on the version of Azure SDK that you use to develop a Cloud Services project. For more information regarding this topic, refer to “Configuring Diagnostics for Azure Cloud Services and Virtual Machines” at https://aka.ms/aznxvo. hips shwuskpipe.conien-GB/Book/BookPrinViewiadd20a51-887e-4999-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 18/22 ano “Module 8: Implementing Azure Cloud Services Note: Basic monitoring does not incur additional charges. However, because diagnostics monitoring stores data in a storage account, it incurs extra costs for using the Azure Storage service. Monitoring Azure Cloud Services - Adding metrics to the monitoring table: 1. Choose a role 2. Choose a counter - Adding an alert to a metri Choose the cloud service, deployment, and role Set the condition and threshold Specify email addresses to receive the alert or a Webhook to which the alert should be routed ‘You can view basic metrics representing your monitoring configuration in the Azure portal. This allows you to Quickly determine the state of a deployment over the last hour, day, week, or a custom-defined time range. You can also add aloris to motrics that the portal displays. As part ofthe alert rule configuration, you can automatically send an email to arbitrary recipients or route an alert to a custom HTTP or HTTPS endpoint through a webhook. To add a metric to the monitoring table: 1. In the Azure portal, navigate to the cloud service that you want to monitor. On the cloud service blade, click the Monitoring pane. On the Metric blade, click Edit chart. On the Edit Chart blade, specify the monitoring time range. On the Edit Chart blade, select the check boxes next to the metrics that you want to view ‘on the monitoring chart. To configure an alert, use the following steps: 1. On the cloud service blade, click the Monitoring pane. hips swuskpipe.convien-GB/Book/BookPrinViewiadd2oaS1-887e-4989-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 19722, aivzote Module implementing Azure Cloud Services 2. On the Metric blade, click Add alert. 3. On the Add an alert rule blade, specify the following settings: © Resource. The resource that you want to monitor. © Name. A custom name that you want to assign to the alert. © Description. A custom description of the alert. © Metric. The metric that you want to monitor. © — Condition. Select from the greater than, greater than or equal to, less than, or less than or equal to options. © Threshold. A value to which the platform applies the condition over the period of time that you specify to determine whether to trigger the alert. © Period. The period of time during which the condition that you specified must be true in order for the alert to be triggered. © Email owners, contributors, and readers. Recipients of an email that the alert automatically generates. © Additional administra tor email(s). Email addresses that you can include as the recipients of the autogenerated email. © — Webhook. An HTTP or HTTPS endpoint to which the alert should be routed. ‘You can view diagnostics data directly from within Visual Studio, For a high-level overview, in Server Explorer, navigate to the role for which you enabled diagnostics, right-click the role, and then click View Diagnostics Data. This will display the Diagnostics Summary window, in which you can review the list of collected events. This. option also allows you to export data from individual sources into a comma-separated values (CSV) file. To access each log directly, in Server Explorer, navigate to the storage account that you designated when configuring diagnostics. Use the table viewer to explore diagnostics tables, To view IIS logs and custom logs, browse to the corresponding blob containers in the same storage account, Lab: Implementing Azure Cloud Services Scenario You want to evaluate the capabilities of Azure Cloud Services to host A. Datum web applications. Your development team has provided a simple cloud service project that you can use to test its functionality in Azure. You want to show how staging and production slots can be used to simplify the deployment of new versions of the cloud service. You also want to determine whether you can monitor the service to get clear information on resource usage. Objectives hips swwuzskpipe.convien-GB/Book/BookPrinViewiadd2oaS!-887e-4939-8673-245123163701?Documertid=10BAnnotationFiterOwn=irue 20/22, ano “Module 8: Implementing Azure Cloud Services At the end of this lab, you will be able to: * Configure and deploy a cloud service to Azure. * Deploy a cloud service for staging and enable Remote Desktop Protocol (RDP) access. Configure metrics and alerts to monitor the cloud service state. Note: The lab steps for this course change frequently due to updates to Microsoft Azure. Microsoft Learning updates the lab steps frequently, so they are not available in this manual. Your instructor will provide you with the lab documentation Lab setup Estimated time: 60 minutes Virtual machine: 20533D-MIA-CL1 User name: Student Password: PaSSw.rd Exercise 1: Deploying a cloud service Scenario You have been asked to test the deployment of a sample cloud service to Azure. Exercise 2: Configuring deployment slots and RDP Scenario ‘The development team has provided a second version of the cloud service you deployed. You want to determine how you can use deployment slots to stage and deploy new versions of cloud services. You will use the same configuration you used for the production service. Exercise 3: Monitoring cloud services ‘Scenario You have been asked to evaluate the network traffic used by the new version of the cloud service that you deployed to the production environment. To accomplish this, you will start collecting network-related monitoring metrics and configure an alert. Review question(s) Module review and takeaways hips shwuskpipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documertid=108AnnotationFiterOwn=irue 24122 ano “Module 8: Implementing Azure Cloud Services In module, you learned about: * Planning, creating, and deploying Azure Cloud Services. * Configuring cloud services by using configuration files or the Azure portal. w question(s) hips wus pipe.conien-GB/Book/BookPrinViewiadd2oa51-887e-4939-8673-245123163701?Documentid=108AnnotationFiterOwn=true 22/22

You might also like