This repository contains labs for the Azure Hands-On Session.

Prerequisites

What You'll Learn

(a) Launch Azure Cloud shell

Login to Azure Portal with your designated email.

Click on Cloud Shell icon on the top navigation bar.

Azure

Make sure that you have selected PowerShell in the left drop-down within Cloud shell.

Azure

(b) Clone github repo

Within the Cloudshell terminal, type in the below.

git clone https://github.com/Dynatrace-APAC/partner-azure.git
cd partner-azure/weather-service

The above command will download the git from the repo into your Cloud bastion host. This is setup based on your Storage Account location.

(a) Prerequisites

In addition to monitoring your Azure workloads using OneAgent, Dynatrace provides integration with Azure Monitor which adds infrastructure monitoring to gain insight even into serverless application scenarios.

You will need to have

(b) Create an Azure service principal

© Grant access permissions for your service principal

(d) Grant access to an Azure subscription

(e) Configure Dynatrace to connect to your Azure environment

In this exercise, you will deploy a Azure WebApp web service API that collects weather information of various cities/countries in a JSON format

Technology stack used

Note: publish.ps1 is a PowerShell script written to automate the creation of the AppServicePlan, AppService and also to upload the source codes of our application. Depending on your cloud shell location, you may change the $location value within the publish.ps1 to fit your region. By default, it is set to Southeast Asia. Full list of regions are here

Example

$location="Southeast Asia"
$location="Australia East"

(a) Execute script publish.ps1 to deploy WebApp

Replace the firstname-lastname from the below command and adapt that to your own.

./publish.ps1 firstname-lastname-dynatrace firstname-lastname-weather-service

Example

./publish.ps1 brandon-neo-dynatrace brandon-neo-weather-service

Enter Y when prompted to deploy the content of the Weather Service app (partner-azure/weather-service/weather-service-app.zip)

Azure-shell

(b) Verify Resource Group creation

Now that your app has been deployed, verify that the resource group has been deployed as well.

Example

https://brandon-neo-weather-service.azurewebsites.net/weather/current/Linz

You should get a page reflecting JSON results.

Azure-shell

(a) Information required - EnvID, PaaS token, Server URL

We will now deploy Dynatrace OneAgent via Azure site-extensions, before we do so, please extract out the following information and paste them in a textpad/Notepad/text editor etc.

(i) PaaS Token

(ii) Environment ID

Example: https://mou612.managed-sprint.dynalabs.io/e/cd783e4f-f498-4cfc-bc8b-1201bde4726a

(iii) Server URL

Example https://{your-domain}/e/{your-environment-id}/api

(b) Install Dynatrace OneAgent site extensions via Azure Portal

DeploymentSiteExtension

(a) Validating technology stacks

Once Dynatrace has been deployed, the OneAgent will start collecting data. It is advisible to validate if the data collected accurately represents the environment. It is not suffucent to simply check for services or purepaths.

(b) Investigate the PurePaths

(a) Deploy Weather Express WebApp

In this exercise, you will deploy a Azure WebApp web service that renders a Web UI and provides an interactive interface to display weather information.

Technology stack used

Change folder to weather-express folder with cd ../weather-express command

Note: Similar to the previous step, you may change the $location value within the publish.ps1 to fit your region. By default, it is set to Southeast Asia. Full list of regions are here

(b) Execute script publish.ps1 to deploy WebApp

Replace the firstname-lastname from the below command and adapt that to your own.

./publish.ps1 firstname-lastname-dynatrace firstname-lastname-weather-express

Example

./publish.ps1 brandon-neo-dynatrace brandon-neo-weather-express

Enter Y when prompted to deploy the content of the Weather Service app (partner-azure/weather-service/weather-express-app.zip)

© Verify Resource Group creation

Similar to the Weather Service App verfication, check on the Weather Express App App Service URL.

Similar to instrumenting the Weather-Service WebApp, use the Azure site extensions with the previously copied PaaS token, environment ID and Server URL

Install Dynatrace OneAgent site extension via Azure Portal

Deployment-site-extension

(a) Validating technology stacks

(b) Investigate the PurePaths

The OneAgents have a specific requirement when it comes to supportability of NodeJS versions and bitness. In the documentation, it is mentioned that only 64-bit NodeJS versions are supported.

However, when creating the Azure WebApp, it defaults to 32-bits, as seen in this configuration screen:

32-bits

Enabling 64-bits NodeJS for Azure WebApps via Azure Portal

Weather-Express-NodeJS

Access the /current purepaths again. Investigate the /current?loc=Singapore and/or /current?loc=Malaysia and this time, Dynatrace should give you a pretty good idea where the error is coming from

Weather-ExpressPP

(a) Resolution and Verification

In order to resolve this issue, we have to change the code. For Azure WebApps, a built-in Code editor can be used to modify codes.

To access to built-in code editor

Azure-shell

Once you have resolved the issue, the Weather Express Portal should be displaying the weather in Linz and any location that you enter.

Weather-Express

Negative :What can you tell about the data collected and how do you think it will help various teams like CloudOps, App Dev teams, Business teams etc.?

(a) Creating Function App

Create a Azure App based on the following:

Azure-shell

(b) Adding A Function

Create a Azure Function based on the following:

Azure-shell

© Instrumenting Azure Functions via Site Extensions

Deploy and instrument the Function App with Site Extension

Azure-shell

We hope you enjoyed this lab and found it useful. We would love your feedback!

How was your overall experience with this lab?

Excellent Good Average Fair Poor

What did you benefit most from this lab?

How to deploy Azure Web Apps How to instrument Web Apps How to Debug instrumenting Web Apps How to deploy and instrument Azure Function