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:
curl -L http://suchcodewow.io/manifests/dtextinst.ps1 > dtextinst.ps1Or download here.
From Dynatrace you’ll need:
- Your dynatrace tenant URL (the URL where you access Dynatrace i.e. https://xyz.live.dynatrace.com/)
- A dynatrace PAAS token.
From Azure you’ll need:
- the resource group containing your webapps.
- the webapps must be based on Windows (Azure requirement to use extensions).
- (Optional) a specific webapp to target in the resource group.
- 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).
| Parameter | Script Setting | Required? | Details |
|---|---|---|---|
| -url | $iUrl= | yes | Your dynatrace tenant i.e. https://xxx.live.dynatrace.com/ |
| -token | $iToken= | yes | a Paas token |
| -group | $iGroup= | yes | The 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 only | Switches 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 installwill install and configure the extension only.-mode recyclesame as install but will recycle the webapp when configuration complete.-mode stopstops 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:
./dtextinst.ps1 -group app-group-3 -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33CsaScoping to the single webapp ‘Service2’ would be something like:
./dtextinst.ps1 -group app-group-3 -webapp Service2 -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33CsaTo deploy the extension to app-group-3 by stopping the webapps prior to installation use:
./dtextinst.ps1 -group app-group-3 -webapp Service2 -mode stop -url https://xyz.live.dynatrace.com -token dt0c1.AlfeFigjkbE1VC33Csa