Skip to content

A) Azure Specific

Azure Overview

Instamation on Azure (Azure Web App)

Our company has instructed us to build and deploy a modern quoting service.

We’ve developed Instamation (tm) and chosen to deploy it as an Azure Web App for easy scalability and configuration.

Deploy

  1. In the Azure Console, go to “App Services.”
  2. Type your class id (sessionX#) into the filter top right.
  3. You should see just ONE web app and click to select. It will be in the format scw-webapp-[classname].
  4. Select the Deployment Center (blue highlight) then External Git as the source (green highlight).
    awa1
  5. Copy the following service repository link into the repository field:
Terminal window
https://github.com/suchcodewow/instamationsvc
  1. Type main for the branch (blue highlight) then Save (green highlight). awa2
  2. Go back to the overview page (blue highlight) and click the default domain (green highlight) to see your new service. awa3
  3. The deployment will likely take a minute or two. You might see a boilerplate message the first time you click- or it might not respond. When successfully deployed, you should see a simple json response simlar to:
Terminal window
{"status":"ready","appname":"scw-webapp-[classname]"}

When this appears, it means your service is working! You are ready to move to the next step.

Dynatrace Extension

  1. In the inset-menu, click on Extensions within the Development Tools section.
  2. Click Add in the main window. Search/Find Dynatrace Oneagent and select it: extension1
  3. At the bottom of the panel, check the agreement box, then click Add.
  4. Hang tight for a few seconds until it loads, then click the small browse box: extension2
  5. Briefly switch to Tab #1. In Pepper, choose the option for Dynatrace: Token Details. You might need to scroll up slightly to see the output.
  6. Using the image below as a guide, fill in the environment ID, token, and then the server URL. extension3
  7. Click Install OneAgent and hang tight until you see Enjoy monitoring from Dynatrace. at the top of the screen.
  8. In the Overview page of your web app, click the Restart button.

Dynabank & Azure Web App

  1. In Tab #6 showing the Instamation service API response, copy the URL from the address bar.
  2. In Dynabank, Log-in using any random name provided with the orange button top right.
  3. Click the orange button top right and click Operations. dynabankwebapp1
  4. In the Estimation Service URL box, paste in the URL of the Instamation service, then click save.
  5. Confirm it worked by checking for a successfully configured message. The App Name should reflect your user id (sessionX#). (The value is retrieved directly from your web service to make sure it worked.) dynabankwebapp2
  6. New Collecticare quotes will now automatically by quoted by the Instamation Service. You can check on it by going to Administration: dynabankwebapp3
  7. Review new Collecticare quotes on the first administration panel. Instead of quotes showing up in the new state, they will show as quoted instead: dynabankwebapp4

Diagnostic settings

  1. Back in Tab #3, scroll down to diagnostic settings and click (green box).
  2. Click Add Diagnostic Setting. dynabankwebapp1
  3. Click App Service Application Logs (green box) and click Stream to Event Hub (blue box).
  4. Make sure the hub namespace matches below & select the shown event hub. dynabankwebapp1
  5. Click save in the top left corner.

Hands On: API Mgmt

Deployment

Once the Dynabank business teams confirmed initial success of Instamation, our next goal is to configure it to use Azure API Management.

  1. In Tab #3 Azure Portal, search for ‘APIM’ and click on API Management services.
  2. Click on the APIM for your region in the format scw-[region]-apim.
  3. Click on API’s from the inset-left menu: apim1
  4. And then click on App Service. apim2
  5. Click the Browese button.
  6. Type in your id (sessionX#). You should see ONE matching App Service. Select the App Service & click select at the bottom.
  7. Copy the name provided into the API URL suffix box. Your Base URL should look something like:
Terminal window
https://scw-useast2-apim.azure-api.net/scw-webapp-colossalcactus
  1. Click Create.
  2. Find your API in the list, click on it (blue highlight), and then click Settings at the top of the details box to the right (green highlight): apim3
  3. Uncheck the Subscription required option box (blue highlight). Click Save (green highlight). This will allow all connections to reach your Instamation service. apim4
  1. Before leaving this screen, find the Base URL of your service and copy it.
  2. Confirm it worked by pasting this URL into a new tab of your browser. You should see your service respond just fine behind the apim!
  3. In your Dynabank Operations portal (click orange button top right -> Operations), you can replace the Instamation Web App with the APIM version and click save. You should receive the same succesfully configured message.

Hands On: Azure Log Forwarder

With metrics and traces automatically ingested and baselined, our company wants to include logs as well. The Collecticare development teams use logs to write out critical business information like policy estimates and quoting decisions.

Deployment

  1. In Tab #1, run the Pepper command to retrieve Dynatrace token information.
  2. Drag-select all EXPORT commands shown. Right-click and copy. Press ENTER to quit Pepper.
  3. At the BASH command prompt, paste the EXPORT commands and press ENTER.
  4. Copy the Log Forwarder function below & paste it into the terminal window.
Terminal window
wget -q https://github.com/dynatrace-oss/dynatrace-azure-log-forwarder/releases/latest/download/dynatrace-azure-logs.sh -O dynatrace-azure-logs.sh && chmod +x ./dynatrace-azure-logs.sh \
&& ./dynatrace-azure-logs.sh --deployment-name $DEPLOYMENT_NAME --target-url $TARGET_URL --target-api-token $TARGET_API_TOKEN --resource-group $RESOURCE_GROUP --event-hub-connection-string $EVENT_HUB_CONNECTION_STRING --require-valid-certificate true
  1. It will take a few minutes to deploy all resources.

Hands On: Azure Monitor

Deployment: Service Principal

  1. On Tab #1 in the terminal, exit Pepper if it is running.
  2. Run the command below to generate a Service Principal/App Registration:
Terminal window
az ad sp create-for-rbac --name $DEPLOYMENT_NAME --role reader --scopes /subscriptions/9939cbf8-8de6-49a1-a641-b664b214838f --query "{ClientID:appId,TenantID:tenant,SecretKey:password}"
  1. In Tab #4 Dynatrace, Open the Settings App —> Cloud and Virtualization —> Azure.
  2. Click on Connect New instance.
  3. Choose a name for the connection.
  4. Add the ClientID, SecretKey and TenantID that exported from the Terminal Command line /Azure CLI.
  5. Click Connect. That’s it!
  6. Open the Azure App in Dynatrace to see all resources.

Bonus Hands On: Grail!

Introduction

The deployment of Instamation by Dynabank after the Collecticare acquisition was a great success technical success.
With Dynatrace, we have full visibility into the entire quoting process and can see that quotes are fast and error free.

A big win!

Except that… the underwriting department is in a complete PANIC! troubleshoot The automated instamation quoting system has produced quotes for $1 on extremely expensive items that will cause serious financial problems for Dynabank.

We can easily double-check that all quotes work technically. What could be going on?

Logs and Business Events on Grail

With the Grail framework powering Log and Business Event ingestion, we can quickly dive into problems in business flows beyond technical issues.

  1. Download this Grail notebook template.
  2. On Tab #4 Dynatrace, open the Notebooks App.
  3. Click to create a new notebook.
  4. On the left inset panel, choose Upload.
  5. We’ll step through each example to see how Grail powers solutions beyond technical issues.