From 7a4a9a1df31ce13143a455fca80db46b2866c849 Mon Sep 17 00:00:00 2001 From: Ava Silver Date: Wed, 11 Oct 2023 11:36:54 -0400 Subject: [PATCH] [AZI-1884] added azure deploy script subscription level --- .../azure-integration/azuredeploy.json | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/azure/deploy-to-azure/azure-integration/azuredeploy.json b/azure/deploy-to-azure/azure-integration/azuredeploy.json index e659c2906..faf660dc9 100644 --- a/azure/deploy-to-azure/azure-integration/azuredeploy.json +++ b/azure/deploy-to-azure/azure-integration/azuredeploy.json @@ -320,6 +320,55 @@ "azPowerShellVersion": "8.1", "scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure/filtering\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"client_id\"=$Env:clientId; \"tenant_id\"=$Env:tenantName; \"namespace\"=$Env:namespace; \"filters\"=$Env:appServicePlanFilters} | ConvertTo-Json )" } + }, + { + "condition": "[not(empty(parameters('containerAppFilters')))]", + "type": "Microsoft.Resources/deploymentScripts", + "apiVersion": "2020-10-01", + "name": "[concat('datadog-app-filter-script-', parameters('newguid'))]", + "location": "[parameters('location')]", + "kind": "AzurePowerShell", + "dependsOn": [ + "[resourceId('Microsoft.Resources/deploymentScripts', concat('datadog-integration-script-', parameters('newguid')))]" + ], + "properties": { + "environmentVariables": [ + { + "name": "datadogApplicationKey", + "secureValue": "[parameters('datadogApplicationKey')]" + }, + { + "name": "datadogApiKey", + "secureValue": "[parameters('datadogApiKey')]" + }, + { + "name": "datadogSite", + "value": "[parameters('datadogSite')]" + }, + { + "name": "containerAppFilters", + "value": "[parameters('containerAppFilters')]" + }, + { + "name": "namespace", + "value": "container_app" + }, + { + "name": "clientId", + "value": "[parameters('servicePrincipalClientId')]" + }, + { + "name": "tenantName", + "value": "[subscription().tenantId]" + } + ], + "retentionInterval": "PT1H", + "timeout": "PT2M", + "containerSettings": {}, + "cleanupPreference": "Always", + "azPowerShellVersion": "8.1", + "scriptContent": "Invoke-WebRequest -SkipCertificateCheck -ContentType \"application/json\" -Method Post -Uri \"https://api.$Env:datadogSite/api/v1/integration/azure/filtering\" -Headers @{\"Accept\"=\"application/json\"; \"DD-APPLICATION-KEY\"=$Env:datadogApplicationKey; \"DD-API-KEY\"=$Env:datadogApiKey} -Body (@{\"client_id\"=$Env:clientId; \"tenant_id\"=$Env:tenantName; \"namespace\"=$Env:namespace; \"filters\"=$Env:containerAppFilters} | ConvertTo-Json )" + } } ], "outputs": {