An alternative to the GUI installation is the command line.
To run the Datadog Agent in your Azure instances as an extension, use the command that matches your environment. Replace <SITE_PARAMETER> with your Datadog account site parameter value in the Datadog sites page, and <DATADOG_API_KEY> with your Datadog API key.
The Azure Extension can accept both normal settings and protected settings.
The normal settings include:
Variable
Type
Description
site
String
Set the Datadog intake site, for example: SITE=
agentVersion
String
The Agent version to install, following the format x.y.z or latest
agentConfiguration
URI
(optional) URI to the Azure blob containing the Agent configuration as a zip file.
agentConfigurationChecksum
String
The SHA256 checksum of the Agent configuration zip file, mandatory if agentConfiguration is specified.
The protected settings include:
Variable
Type
Description
api_key
String
Adds the Datadog API KEY to the configuration file.
Note: If agentConfiguration and api_key are specified at the same time, the API key found in the agentConfiguration takes precedence. Also note that if an API key is set on the target machine, it’s not possible to change it with Set-AzVMExtension.
Specifying a configuration URI
This example shows how to specify a configuration for the Datadog Agent to use.
The Datadog Agent configuration URI must be an Azure blob storage URI.
The Datadog Windows Agent Azure Extension will check that the agentConfiguration URI comes from the .blob.core.windows.net domain.
The Datataog Agent configuration should be created from the %PROGRAMDATA%\Datadog folder.
Note: Once the Datadog Agent is installed, the configuration can only be changed when upgrading to a newer version.
Set a specific version of the Agent
This example shows how to specify a version of the Agent to install. By default the Datadog Windows Agent Azure Extension will install the latest version of the Datadog Agent.
Note: Downgrades are not supported, so it’s not possible to install a lower version of the Datadog Agent than the one currently installed on the target machine. To install a lower version of the Datadog Agent, uninstall the previous version first by removing the Datadog Windows Agent Azure Extension on the target machine. Removing the Datadog Windows Agent Azure Extension does not remove the Datadog Agent configuration.
az vm extension set --publisher "Datadog.Agent" --name "DatadogLinuxAgent" --version 7.0 --settings '{"site":"datadoghq.com", "agentVersion":"latest"}' --protected-settings '{"api_key":"<DATADOG_API_KEY>"}' --no-auto-upgrade-minor-version
More information on the syntax to set Azure instance extensions can be found in the [Azure Extension CLI reference][1].
The Azure Extension can accept both normal settings and protected settings.
The normal settings include:
Variable
Type
Description
site
String
Set the Datadog intake site, for example: SITE=
agentVersion
String
The Agent version to install, following the format x.y.z or latest
agentConfiguration
URI
(optional) URI to the Azure blob containing the Agent configuration as a zip file.
agentConfigurationChecksum
String
The SHA256 checksum of the Agent configuration zip file, mandatory if agentConfiguration is specified.
The protected settings include:
Variable
Type
Description
api_key
String
Adds the Datadog API KEY to the configuration file.
Note: If agentConfiguration and api_key are specified at the same time, the API key found in the agentConfiguration takes precedence. If an API key is set on the target machine, it’s not possible to change it with the api_key setting.
Specifying a configuration URI
This example shows how to specify a configuration for the Datadog Agent to use.
The Datadog Agent configuration URI must be an Azure blob storage URI.
The Datadog Linux Agent Azure Extension checks that the agentConfiguration URI comes from the .blob.core.windows.net domain.
The Datataog Agent configuration should be created from the /etc/datadog-agent/ folder.
az vm extension set --publisher "Datadog.Agent" --name "DatadogLinuxAgent" --version 7.0 --settings '{"site":"datadoghq.com", "agentVersion":"latest", "agentConfiguration":"https://<CONFIGURATION_BLOB>.blob.core.windows.net/<FILE_PATH>.zip", "agentConfigurationChecksum":"<SHA256_CHECKSUM>"}' --protected-settings '{"api_key":"<DATADOG_API_KEY>"}' --no-auto-upgrade-minor-version
Install on Azure Arc
To run the Datadog Agent in your Azure Arc instances as an extension, use the command that matches your environment.