(AZ-204 topic) Monitor, Troubleshoot, and Optimize Azure Solutions Flashcards
Test takers will be expected to be able to set up Monitoring through services like Azure Monitor & Application Insights to identify and troubleshoot issues with their Azure solutions. They will also be expected to understand how to optimize solutions using services like Content Delivery Networks, Azure Front Door, and Azure Cache for Redis. Questions for this domain comprise 15% of the total questions for this exam.
You’ve recently built a static website that leverages a Content Delivery Network (CDN) to help your site load quicker for users in farther regions. You want to ensure all connections enforce HTTPS. What is the most cost-effective and efficient method of ensuring all connections use HTTPS?
- Generate and assign a certificate for the Static Web App to use.
- Create a certificate in Azure Key Vault, and assign it to your Static Website and CDN Profile.
- Convert your Static Web App to an Azure Web App Service and utilize the Standard tier to enforce HTTPS.
- Create a custom domain and enforce HTTPS on your CDN Profile.
-Create a custom domain and enforce HTTPS on your CDN Profile.
You can set your CDN to utilize an SSL certificate from Microsoft as long as you assign your custom domain to your profile. Additionally, Microsoft will always use a secure connection for its custom URLs, but it’s unlikely you’d want to use that URL for your company’s web traffic.
You are developing a solution using Azure Web Apps and are designing an autoscaling rule. What property of the rule should you set to specify the amount of time to look back in metrics when determining if rules should be run (to avoid reacting to transient spikes)?
- ScaleActionCooldown
- ScaleActionDirection
- Threshold
- TimeGrain
-ScaleActionCooldown
ScaleActionCooldown is the amount of time to wait after a scaling operation, before scaling again.
You are developing a solution using a Web App and Application Insights. You would like to configure an Application Insights Usage Analysis feature in your Web App to compare the numbers of users who return to your Web App after purchasing a product with the number who return after no purchasing. Which Application Insights Usage Analysis feature supports this?
- Users, Sessions, Events
- User Flows
- Funnels
- Retention
-Retention
Retention helps you analyze how many users return to your app and how often they perform particular tasks or achieve goals.
You are developing a solution using a Web App and Application Insights. You would like to configure Application Insights sampling in the portal so that you can set a daily cap for usage and cost. Which sampling does NOT allow you to set a daily cap for usage and cost.
- Fixed-Rate Sampling
- Ingestion Sampling
- Metric Sampling
- Adaptive Sampling
-Adaptive Sampling
Adaptive sampling doesn’t allow you to set a daily cap for usage and cost.
You have a Web App that utilizes an Azure Web Application Firewall. All traffic to the Web App is routed through an Azure Application Gateway instance that is used by multiple Web Apps. The Web App address is azuredale.azurewebsites.net. All traffic has to be secured with SSL. How can you ensure traffic for azuredale.azurewebsites.net is secured via HTTPS?
- Force HTTPS for all traffic traveling through the Web Application Firewall.
- Configure an authentication certificate for azuredale.azurewebsites.net to the Azure Application Gateway.
- Convert the Web App to run in an Azure App Service environment.
- On the Azure Application Gateway HTTP setting, set the value of the override backend path option to azuredale.azurewebsites.net.
-On the Azure Application Gateway HTTP setting, set the value of the override backend path option to azuredale.azurewebsites.net.
This forces traffic to utilize HTTPS for all Web Apps leveraging the Gateway.
You are developing a solution using Azure Web Apps and are configuring autoscaling. How many rules will you need to be able to increase servers when CPU load is high and to decrease servers when CPU load is low?
2
You need 2 rules in place — 1 to increase based on CPU load, 1 to decrease based on CPU load.
Your company has recently begun operating in additional countries, requiring changes to multiple operations throughout your enterprise to allow for international availability. As a web developer, it’s fallen on you to ensure your company’s website provides a smooth experience to potential customers in your company’s new regions and ensure things like video content can be viewed efficiently. What option should you choose for your website to deliver this experience?
- Deploy a Content Delivery Network and place nodes in each region or the closest Azure region.
- Increase your Web App’s service tier to account for the additional load the new regions will create.
- Implement a new Web App in each region your company wants to be available in.
- Utilize Azure Media Services to ensure your video content is available to multiple regions.
-Deploy a Content Delivery Network and place nodes in each region or the closest Azure region.
A Content Delivery Network would allow you to cache popular content in nodes around the world to allow for a better user experience.
You need to investigate an HTTP 502 error happening with one of your web services. You need to investigate what is happening to your service and take appropriate steps to resolve the issue. Which command should you use first to collect data on the issue?
- az monitor activity-log
- az webapp log
- az container attach
- az ams live-output
-az monitor activity-log
This command will allow you to review events on your web service and track down potential culprits to your issue.
You are developing a solution using a Web App and Application Insights. You would like to configure Application Insights sampling in your Web App via the Python SDK. Which of the following Application Insights sampling types will NOT support this?
- Ingestion Sampling
- Adaptive Sampling
- Fixed-Rate Sampling
-Adaptive Sampling
Python SDKs do NOT support Adaptive Sampling.
You are working as a developer for the Nutex Corporation. You are responsible for an online e-store system using PHP 7.4. You are preparing for the Black Friday and Cyber Monday period. Your CEO is afraid that during these periods, MySQL DB will be overloaded and will not respond fast enough.
Which cloud design pattern do you propose to mitigate MySQL potential problems?
- Implement Sharding pattern
- Implement Cache-Aside pattern
- Implement Retry pattern
- Implement Competing Consumers pattern
-Implement Cache-Aside pattern
You would implement the Cache-Aside pattern. The Cache-Aside pattern is used to improve performance when loading data. This pattern is for storing data in memory to speed up MySQL queries. It also keeps consistency between data in the underlying data store and data held in the cache.
You would not implement the Competing Consumers pattern. This type of pattern is used for queue implementation and can be a part of a solution, but it does not resolve database problems.
You would not implement the Retry pattern. The Retry pattern improves the stability of an application by allowing an application to retry a failed operation when intermittent failures of connecting to a network resource or a service occur. However, this pattern will not resolve database problems, although it could resolve connection problems.
You would not implement the Sharding pattern. This pattern is used for splitting data across databases, disks, files, or partitions. This pattern can resolve database issues for SQL and NoSQL, but not MySQL.
You are the administrator of the Nutex Corporation. You have created an ASP.NET MVC web application in Visual Studio. You have added Application Insights Telemetry to your project.
Which of the following code lines tracks exceptions to an automatically applied code change to your FileConfig.cs file?
- filters.Add(new HandleErrorAttribute());
-“ProviderId”:
“Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider”
- instrumentationKey:”7812zdg”
- filters.Add(new ErrorHandler.AiHandleErrorAttribute());
- filters.Add(new ErrorHandler.AiHandleErrorAttribute());
You would use filters.Add(new ErrorHandler.AiHandleErrorAttribute());. The AiHandleErrorAttribute class is in the ErrorHandler folder. Everytime an exception is made, this class attribute will log the exception. You can also use the AiHandleErrorAttribute class as an exception filter.
You would not use “ProviderId”: “Microsoft.ApplicationInsights.ConnectedService. ConnectedServiceProvider”, because this change is in the ConnectedService.json file.
You would not use filters.Add(new HandleErrorAttribute()); because this is the line of code used to put the HandleError attribute in its basic state. It is used before adding Application Insights telemetry to the project.
You would not use instrumentationKey:”7812zdg” because the instrumentation key and its value are added to
the _Layout.cshtml file.
You want to create a Node.js console application which will use CDN. You have created a resource group. You have configured Azure Active Directory to provide authentication for the application. You have applied permissions to the resource group so that only authorized users from your Azure AD tenant can interact with the CDN profile. You have created a folder to store your application. The project will be initialized with a packages.json file.
You use ms-rest-azure and azure-arm-cd. In the app.js file, you add the necessary “requires” for your NPM
packages. You define the constants.
What is the next step?
- Assign the Reader role to the application.
- Create a CDN profile.
- Instantiate the CDN management client.
- Create CDN endpoints.
- Instantiate the CDN management client.
You would instantiate the CDN management client. With the code “var cdnClient = new cdnManagementClient(credentials, subscriptionId);”, you instantiate the CDN client variable.
Once you have added the “requires” for your NPM packages at the top of the app.js file and you have defined some contants for the method, you would instantiate the CDN management client by supplying credentials similar to the following:
var credentials = new msRestAzure.ApplicationTokenCredentials(clientId, tenantId, clientSecret);
var cdnClient = new cdnManagementClient(credentials, subscriptionId);
You would not create a CDN profile. You need to instantiate the CDN client before you can create a CDN profile.
You would not create CDN endpoints. You need to create the CDN profile before you can create CDN endpoints.
You would not assign the Reader role to the application. You would assign the CDN Profile Contributor role to the
service principal.
You are the administrator of the Nutex Corporation. You have a web application hosted in Azure. You have configured application insights to support exception reporting. To get diagnostic data specific to your app, you can insert code to send your own telemetry data. This data is displayed in a diagnostic search alongside the request, page view, and other automatically collected data. For that, you have several options.
Describe the following Trace Option.
TrackEvent()
TrackEvent() is used to count various events and is commonly used for monitoring usage patterns. The data it sends appears under Custom Events in a diagnostic search. You can use these events to filter your diagnostic searches because events are named and can carry string properties and numeric metrics.
You are the administrator of the Nutex Corporation. You have a web application hosted in Azure. You have configured application insights to support exception reporting. To get diagnostic data specific to your app, you can insert code to send your own telemetry data. This data is displayed in a diagnostic search alongside the request, page view, and other automatically collected data. For that, you have several options.
Describe the following Trace Option.
TrackTrace()
TrackTrace() allows you to send a “breadcrumb trail” to help diagnose problems. You can use this option to send longer data, such as POST information.
You are the administrator of the Nutex Corporation. You have a web application hosted in Azure. You have configured application insights to support exception reporting. To get diagnostic data specific to your app, you can insert code to send your own telemetry data. This data is displayed in a diagnostic search alongside the request, page view, and other automatically collected data. For that, you have several options.
Describe the following Trace Option.
TrackException()
TrackException() allows you to send stack traces. You can capture exceptions automatically or log exceptions explicitly.