Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(azure): Copy CreateUiDefinition.json to CreateUIDefinition.json to temporarily use both #704

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 286 additions & 0 deletions azure/deploy-to-azure/azure-integration/CreateUIDefinition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "location",
"type": "Microsoft.Common.TextBox",
"label": "Location",
"defaultValue": "global",
"toolTip": "Resources location",
"visible": false
},
{
"name": "infoBox1",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "The selections above define where this template will be deployed. It has no impact on which subscriptions will be monitored by Datadog. You will define the subscription(s) you would like to monitor with Datadog in the 'Datadog Configuration' tab."
}
},
{
"name": "armio",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "POST",
"path": "/providers/Microsoft.Management/getEntities?api-version=2020-05-01"
}
}
],
"steps": [
{
"name": "servicePrincipal",
"type": "Microsoft.Common.Section",
"label": "Service Principal",
"elements": [
{
"name": "createAppReg",
"type": "Microsoft.Common.Section",
"label": "Create Datadog App Registration",
"elements": [
{
"name": "infoBox1",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "The following steps involve navigating away from this template. Please read them carefully before continuing.\n\n1. Select the option to create a new app registration, and click 'Change Selection'.\n2. Give it a name and select any account type.\n3. Click 'Register'. This will open a new page to create a client secret.\n4. Click ‘+ New Client Secret’ to add a Client Secret.\n5. Copy the Value of the Client Secret.\n6. Click the close (X) button in the top-right corner to return to this template screen.\n7 Paste the value of the Client Secret in the corresponding field on this template."
}
},
{
"name": "ServicePrincipal",
"type": "Microsoft.Common.ServicePrincipalSelector",
"label": {
"servicePrincipalId": "Service Principal Id",
"password": "Client secret",
"sectionHeader": "Service Principal"
},
"toolTip": {
"servicePrincipalId": "Service Principal Id"
},
"defaultValue": {
"principalId": "<default guid>",
"name": "(New) default App Id"
},
"constraints": {
"required": true,
"validationMessage": "Must be a valid client secret"
},
"options": {
"hideCertificate": true
},
"visible": true
}
],
"visible": true
}
]
},
{
"name": "datadogConfig",
"type": "Microsoft.Common.Section",
"label": "Datadog Configuration",
"elements": [
{
"name": "datadogIntegration",
"type": "Microsoft.Common.Section",
"label": "Datadog Organization",
"elements": [
{
"name": "textBlock1",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "To fill out the fields below, copy the API and Application keys from your Datadog org. If you launched this template from the Azure integration config page, refer back there to select and copy the keys. Otherwise, you can find your API and App Keys in the Access section of the Organization Settings.",
"link": {
"label": "Learn more",
"uri": "https://docs.datadoghq.com/account_management/org_settings/"
}
}
},
{
"name": "datadogApiKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Datadog API Key",
"confirmPassword": "Re-enter Datadog Api Key"
},
"toolTip": "Your Datadog API key",
"constraints": {
"required": true,
"validationMessage": "Must be a valid API Key"
},
"options": {
"hideConfirmation": true
},
"visible": true
},
{
"name": "datadogApplicationKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Datadog Application Key",
"confirmPassword": "Re-enter Datadog Application Key"
},
"toolTip": "Your Datadog Application key",
"constraints": {
"required": true,
"validationMessage": "Must be a valid Application Key"
},
"options": {
"hideConfirmation": true
},
"visible": true
}
],
"visible": true
},
{
"name": "datadogSite",
"type": "Microsoft.Common.DropDown",
"label": "Datadog Site",
"defaultValue": "US1",
"toolTip": "The datadog site where you usually login. For US3, search for and install the Datadog Resource from the Azure Marketplace instead of using this form",
"constraints": {
"allowedValues": [
{
"label": "US1",
"value": "datadoghq.com"
},
{
"label": "US3",
"value": "us3.datadoghq.com"
},
{
"label": "US5",
"value": "us5.datadoghq.com"
},
{
"label": "EU1",
"value": "datadoghq.eu"
},
{
"label": "AP1",
"value": "ap1.datadoghq.com"
},
{
"label": "US1-FED",
"value": "ddog-gov.com"
}
],
"required": false
},
"visible": true
},
{
"name": "integrationConfig",
"type": "Microsoft.Common.Section",
"label": "Integration Configuration",
"elements": [
{
"name": "subscriptionsList",
"type": "Microsoft.Common.DropDown",
"label": "Subscriptions to monitor",
"toolTip": "The list of subscriptions to monitor",
"filterPlaceholder": "Select one or more subscriptions to monitor",
"filter": true,
"multiselect": true,
"selectAll": true,
"defaultValue": "[map(filter(steps('basics').armio.value,(i) => and(not(equals(i.type,'Microsoft.Management/managementGroups')),not(and(equals(i.properties.permissions,'noaccess'),equals(i.properties.inheritedPermissions,'noaccess'))))),(item) => item.properties.displayName)]",
"constraints": {
"allowedValues": "[map(filter(steps('basics').armio.value, (i)=>and( not(equals(i.type, 'Microsoft.Management/managementGroups')), not(and(equals(i.properties.permissions, 'noaccess'),equals(i.properties.inheritedPermissions, 'noaccess'))) )), (item)=> parse(concat('{\"label\":\"', item.properties.displayName, '\",\"value\":\"', item.name, '\"}')))]",
"required": false
},
"visible": true
},
{
"name": "textBlock1",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "Metrics will be collected for all Azure resources by default. Optionally, you can limit metric collection for Virtual Machines, Virtual Machine Scale Sets and App Service Plans using tags in order to control your Datadog costs.",
"link": {
"label": "Learn more",
"uri": "https://docs.datadoghq.com/account_management/billing/azure/"
}
}
},
{
"name": "hostFilters",
"type": "Microsoft.Common.TextBox",
"label": "Host Filters",
"defaultValue": "",
"toolTip": "This comma-separated list of Azure tags (in the form key:value) defines a filter that we will use when collecting metrics from Azure. Only hosts that match one of the defined labels will be imported into Datadog. The rest will be ignored. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Hosts matching a given label can also be excluded by adding ! before the label. Example: datadog:monitored,env:production,!env:staging,instance-type:c1.*",
"constraints": {
"required": false
},
"visible": true
},
{
"name": "appServicePlanFilters",
"type": "Microsoft.Common.TextBox",
"label": "App Service Plan Filters",
"defaultValue": "",
"toolTip": "This comma-separated list of Azure tags (in the form key:value) defines a filter that we will use when collecting metrics from Azure. Only App Service Plans that match one of the defined labels will be imported into Datadog. The rest will be ignored. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Hosts matching a given label can also be excluded by adding ! before the label. Example: datadog:monitored,env:production,!env:staging,instance-type:c1.*",
"constraints": {
"required": false
},
"visible": true
},
{
"name": "containerAppFilters",
"type": "Microsoft.Common.TextBox",
"label": "Container App Filters",
"defaultValue": "",
"toolTip": "This comma-separated list of Azure tags (in the form key:value) defines a filter that we will use when collecting metrics from Azure. Only Container Apps that match one of the defined labels will be imported into Datadog. The rest will be ignored. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Hosts matching a given label can also be excluded by adding ! before the label. Example: datadog:monitored,env:production,!env:staging,instance-type:c1.*",
"constraints": {
"required": false
},
"visible": true
},
{
"name": "automute",
"type": "Microsoft.Common.CheckBox",
"label": "Automute",
"toolTip": "Whether or not to use automute for hosts",
"defaultValue": "true"
},
{
"name": "cspm_enabled",
"type": "Microsoft.Common.CheckBox",
"label": "Cloud Security Management",
"toolTip": "When enabled, Datadog performs configuration checks across your Azure environment by continuously scanning every resource. Use Datadog's executive reporting summaries to track conformance to industry benchmark criteria."
},
{
"name": "custom_metrics_enabled",
"type": "Microsoft.Common.CheckBox",
"label": "Collect Custom Metrics",
"toolTip": "This option will enable custom metric collection from all Application Insights instances within the scope of this configuration. These custom metrics will appear in datadog under the namespace <b>application_insights.custom.&lt;METRIC_NAME&gt;</b>.<br> Note that <a target='_blank' href='https://learn.microsoft.com/en-us/azure/azure-monitor/app/standard-metrics/'>Standard</a> App Insights metrics are collected automatically and are available under the <b>azure.insights_components.*</b> namespace."
}
],
"visible": true
}
]
}
],
"outputs": {
"location": "[location()]",
"servicePrincipalClientId": "[steps('servicePrincipal').createAppReg.ServicePrincipal.appId]",
"servicePrincipalObjectId": "[first(steps('servicePrincipal').createAppReg.ServicePrincipal.objectId)]",
"servicePrincipalClientSecret": "[steps('servicePrincipal').createAppReg.ServicePrincipal.password]",
"subscriptionsList": "[steps('datadogConfig').integrationConfig.subscriptionsList]",
"datadogApplicationKey": "[steps('datadogConfig').datadogIntegration.datadogApplicationKey]",
"datadogApiKey": "[steps('datadogConfig').datadogIntegration.datadogApiKey]",
"datadogSite": "[steps('datadogConfig').datadogSite]",
"hostFilters": "[steps('datadogConfig').integrationConfig.hostFilters]",
"appServicePlanFilters": "[steps('datadogConfig').integrationConfig.appServicePlanFilters]",
"containerAppFilters": "[steps('datadogConfig').integrationConfig.containerAppFilters]",
"automute": "[steps('datadogConfig').integrationConfig.automute]",
"cspm_enabled": "[steps('datadogConfig').integrationConfig.cspm_enabled]",
"custom_metrics_enabled": "[steps('datadogConfig').integrationConfig.custom_metrics_enabled]"
}
}
}