Skip to content

Azure Extenstion Installer

Azure Extension Installer

Goal

Deploy the Dynatrace extension effortlessly to your Azure webapps without pipeline changes or deployment adjustments.

The installer will:

  • run a preflight check on the options entered to ensure they are valid.
  • query the webapp(s) for current state of the Dynatrace extension.
  • provide you with a ‘todo’ list based on current state.

By default, it will stop here. If an implementation mode is enabled it will continue:

  • (Optionally) stop the webapp(s).
  • install the Dynatrace extension on the webapp(s).
  • configure the extension with your tenant information.
  • Restart/recycle & confirm successful implementation.
  • provide you with a report.

Prerequisites

Script download

Download directly in a azure cloud shell:

Terminal window
curl -L http://suchcodewow.io/manifests/dtextinst.ps1 > dtextinst.ps1

Or download here.

From Dynatrace you’ll need:

  1. Your dynatrace tenant URL (the URL where you access Dynatrace i.e. https://xyz.live.dynatrace.com/)
  2. A dynatrace PAAS token.

From Azure you’ll need:

  1. the resource group containing your webapps.
  2. the webapps must be based on Windows (Azure requirement to use extensions).
  3. (Optional) a specific webapp to target in the resource group.
  4. the webapp service plan name.

You’ll need a Powershell cloud shell -or- a powershell session with the azcli tools installed.

Usage

The script supports -parameters or you can save settings in the settings block of the script (directly under the Param block).

ParameterScript SettingRequired?Details
-url$iUrl=yesYour dynatrace tenant i.e. https://xxx.live.dynatrace.com/
-token$iToken=yesa Paas token
-group$iGroup=yesThe Azure resource group with your webapps
-webapp$webapp=(Optional) Specify a single webapp in your resource group to install the Dynatrace extension
-mode [install/recycle/stop]Parameter onlySwitches from ‘what-if’ to implementation mode. See below for more detail

Implementation mode

Using the -mode parameter enables the script to make changes. Use in conjunction with one flag below.

  • -mode install will install and configure the extension only.
  • -mode recycle same as install but will recycle the webapp when configuration complete.
  • -mode stop stops the webapp prior to install/configure. Starts the webapp when configuration complete.

Examples

To see a todo list of what would happen in the ‘app-group-3’ resource group, run something like:

Terminal window
./dtextinst.ps1 -group app-group-3 -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33Csa

Scoping to the single webapp ‘Service2’ would be something like:

Terminal window
./dtextinst.ps1 -group app-group-3 -webapp Service2 -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33Csa

To deploy the extension to app-group-3 by stopping the webapps prior to installation use:

Terminal window
./dtextinst.ps1 -group app-group-3 -webapp Service2 -mode stop -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33Csa