From 4cc3849686ab5882084e06730b021d0bb102a98d Mon Sep 17 00:00:00 2001 From: Divesh Mavji <30622893+divesh987@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:16:44 +0000 Subject: [PATCH] Revert "Added failed requests alert and updated app connection string" --- azure-pipelines.yml | 4 +- azure/template.json | 133 +++++++++++++----------------- pipeline-templates/job/deploy.yml | 10 +-- 3 files changed, 59 insertions(+), 88 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d4ac5f97a7..302eed374d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,12 +28,12 @@ resources: - repository: das-platform-building-blocks type: github name: SkillsFundingAgency/das-platform-building-blocks - ref: refs/tags/2.2.25 + ref: refs/tags/2.1.28 endpoint: SkillsFundingAgency - repository: das-platform-automation type: github name: SkillsFundingAgency/das-platform-automation - ref: refs/tags/5.1.18 + ref: refs/tags/5.1.8 endpoint: SkillsFundingAgency pipelines: - pipeline: das-employer-config diff --git a/azure/template.json b/azure/template.json index 81bb19d21d..f0c4f44115 100644 --- a/azure/template.json +++ b/azure/template.json @@ -127,31 +127,6 @@ "minimumTlsVersion": { "type": "string", "defaultValue": "TLS1_2" - }, - "applicationInsightsConnectionString": { - "type": "securestring", - "metadata": { - "description": "Shared application insights connection string retrieved from the get-product-app-insights step" - } - }, - "applicationInsightsResourceId": { - "type": "string", - "metadata": { - "description": "Shared application insights resource ID retrieved from the get-product-app-insights step" - } - }, - "alertActionGroupResourceId": { - "type": "string", - "metadata": { - "description": "Alert group resource ID found in the management resources variable groups" - } - }, - "enableFailedRequestAlert": { - "type": "bool", - "defaultValue": false, - "metadata": { - "description": "Enables alerting on app insights failed requests" - } } }, "variables": { @@ -285,6 +260,33 @@ "[variables('resourceGroupName')]" ] }, + { + "apiVersion": "2021-04-01", + "name": "[concat(variables('workerV2AppServiceName'), '-application-insights-', parameters('utcValue'))]", + "resourceGroup": "[variables('resourceGroupName')]", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "templateLink": { + "uri": "[concat(variables('deploymentUrlBase'), 'application-insights.json')]", + "contentVersion": "1.0.0.0" + }, + "parameters": { + "appInsightsName": { + "value": "[variables('workerV2AppServiceName')]" + }, + "attachedService": { + "value": "[variables('workerV2AppServiceName')]" + }, + "logAnalyticsWorkspaceId": { + "value": "[resourceId(parameters('logAnalyticsSubscriptionId'),parameters('sharedManagementResourceGroup'),'Microsoft.OperationalInsights/workspaces',parameters('logAnalyticsWorkspaceName'))]" + } + } + }, + "dependsOn": [ + "[variables('resourceGroupName')]" + ] + }, { "apiVersion": "2021-04-01", "name": "[concat(variables('workerV2AppServiceName'), '-', parameters('utcValue'))]", @@ -329,7 +331,7 @@ }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", - "value": "[parameters('applicationInsightsConnectionString')]" + "value": "[reference(concat(variables('workerV2AppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value]" }, { "name": "FUNCTIONS_WORKER_RUNTIME", @@ -365,29 +367,31 @@ ] }, { - "condition": "[equals(parameters('enableFailedRequestAlert'), true())]", "apiVersion": "2021-04-01", - "name": "[concat('application-insights-', variables('workerV2AppServiceName'), '-alert-', parameters('utcValue'))]", - "type": "Microsoft.Resources/deployments", + "name": "[concat(variables('apiV2AppServiceName'), '-application-insights-', parameters('utcValue'))]", "resourceGroup": "[variables('resourceGroupName')]", + "type": "Microsoft.Resources/deployments", "properties": { "mode": "Incremental", "templateLink": { - "uri": "[concat(variables('deploymentUrlBase'),'application-insights-failed-requests-alert.json')]", + "uri": "[concat(variables('deploymentUrlBase'), 'application-insights.json')]", "contentVersion": "1.0.0.0" }, "parameters": { - "serviceName": { - "value": "[variables('workerV2AppServiceName')]" + "appInsightsName": { + "value": "[variables('apiV2AppServiceName')]" }, - "applicationInsightsResourceId": { - "value": "[parameters('applicationInsightsResourceId')]" + "attachedService": { + "value": "[variables('apiV2AppServiceName')]" }, - "alertActionGroupResourceId": { - "value": "[parameters('alertActionGroupResourceId')]" + "logAnalyticsWorkspaceId": { + "value": "[resourceId(parameters('logAnalyticsSubscriptionId'),parameters('sharedManagementResourceGroup'),'Microsoft.OperationalInsights/workspaces',parameters('logAnalyticsWorkspaceName'))]" } } - } + }, + "dependsOn": [ + "[variables('resourceGroupName')]" + ] }, { "apiVersion": "2021-04-01", @@ -457,7 +461,7 @@ }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", - "value": "[parameters('applicationInsightsConnectionString')]" + "value": "[reference(concat(variables('apiV2AppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value]" } ] } @@ -478,29 +482,29 @@ ] }, { - "condition": "[equals(parameters('enableFailedRequestAlert'), true())]", + "condition": "[parameters('deploySupportApp')]", "apiVersion": "2021-04-01", - "name": "[concat('application-insights-', variables('apiV2AppServiceName'), '-alert-', parameters('utcValue'))]", - "type": "Microsoft.Resources/deployments", + "name": "[concat(variables('supportAppServiceName'), '-application-insights-', parameters('utcValue'))]", "resourceGroup": "[variables('resourceGroupName')]", + "type": "Microsoft.Resources/deployments", "properties": { "mode": "Incremental", "templateLink": { - "uri": "[concat(variables('deploymentUrlBase'),'application-insights-failed-requests-alert.json')]", + "uri": "[concat(variables('deploymentUrlBase'), 'application-insights.json')]", "contentVersion": "1.0.0.0" }, "parameters": { - "serviceName": { - "value": "[variables('apiV2AppServiceName')]" - }, - "applicationInsightsResourceId": { - "value": "[parameters('applicationInsightsResourceId')]" + "appInsightsName": { + "value": "[variables('supportAppServiceName')]" }, - "alertActionGroupResourceId": { - "value": "[parameters('alertActionGroupResourceId')]" + "attachedService": { + "value": "[variables('supportAppServiceName')]" } } - } + }, + "dependsOn": [ + "[variables('resourceGroupName')]" + ] }, { "condition": "[parameters('deploySupportApp')]", @@ -568,7 +572,7 @@ }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", - "value": "[parameters('applicationInsightsConnectionString')]" + "value": "[if(parameters('deploySupportApp'), reference(concat(variables('supportAppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value, '')]" } ] } @@ -588,31 +592,6 @@ "[variables('resourceGroupName')]" ] }, - { - "condition": "[and(equals(parameters('enableFailedRequestAlert'), true()), parameters('deploySupportApp'))]", - "apiVersion": "2021-04-01", - "name": "[concat('application-insights-', variables('supportAppServiceName'), '-alert-', parameters('utcValue'))]", - "type": "Microsoft.Resources/deployments", - "resourceGroup": "[variables('resourceGroupName')]", - "properties": { - "mode": "Incremental", - "templateLink": { - "uri": "[concat(variables('deploymentUrlBase'),'application-insights-failed-requests-alert.json')]", - "contentVersion": "1.0.0.0" - }, - "parameters": { - "serviceName": { - "value": "[variables('supportAppServiceName')]" - }, - "applicationInsightsResourceId": { - "value": "[parameters('applicationInsightsResourceId')]" - }, - "alertActionGroupResourceId": { - "value": "[parameters('alertActionGroupResourceId')]" - } - } - } - }, { "apiVersion": "2021-04-01", "name": "[concat(variables('workerV2AppServiceName'), '-apim-subscription-', parameters('utcValue'))]", @@ -789,4 +768,4 @@ "value": "[variables('serviceBusName')]" } } -} +} \ No newline at end of file diff --git a/pipeline-templates/job/deploy.yml b/pipeline-templates/job/deploy.yml index 7bc2e399e5..420819271e 100644 --- a/pipeline-templates/job/deploy.yml +++ b/pipeline-templates/job/deploy.yml @@ -29,12 +29,6 @@ jobs: ResourceEnvironmentName: $(ResourceEnvironmentName) UnrestrictedEnvironments: $(UnrestrictedEnvironments) UptimeMonitoringAccessRestrictions: $(UptimeMonitoringAccessRestrictions) - - template: azure-pipelines-templates/deploy/step/get-product-app-insights.yml@das-platform-building-blocks - parameters: - ServiceConnection: ${{ parameters.ServiceConnection }} - AppInsightsResourceGroup: $(SharedEnvResourceGroup) - AppInsightsName: $(ProductAppInsightsName) - IsMultiRepoCheckout: true - template: azure-pipelines-templates/deploy/step/arm-deploy.yml@das-platform-building-blocks parameters: ServiceConnection: ${{ parameters.ServiceConnection }} @@ -47,7 +41,6 @@ jobs: TemplateSecrets: ConfigurationStorageConnectionString: $(ConfigurationStorageConnectionString) SharedStorageAccountConnectionString: $(SharedStorageAccountConnectionString) - ApplicationInsightsConnectionString: $(ApplicationInsightsConnectionString) - template: azure-pipelines-templates/deploy/step/get-apim-subscription-key.yml@das-platform-building-blocks parameters: ServiceConnection: ${{ parameters.ServiceConnection }} @@ -121,11 +114,10 @@ jobs: AppServiceName: $(ApiV2AppServiceName) DeploymentPackagePath: $(Pipeline.Workspace)/${{ parameters.SolutionBaseName }}/${{ parameters.SolutionBaseName }}V2.Api.zip - template: azure-pipelines-templates/deploy/step/webjob-deploy.yml@das-platform-building-blocks - parameters: + parameters: ServiceConnection: ${{ parameters.ServiceConnection }} AppServiceName: $(WorkerV2AppServiceName) DeploymentPackagePath: $(Pipeline.Workspace)/${{ parameters.SolutionBaseName }}/${{ parameters.SolutionBaseName }}V2.Host.zip - ResourceGroupName: $(ResourceGroupName) DeploymentType: zipDeploy - ${{ if or(eq(parameters.Environment, 'AT'), eq(parameters.Environment, 'TEST'), eq(parameters.Environment, 'PP'), eq(parameters.Environment, 'PROD')) }}: - template: azure-pipelines-templates/deploy/step/app-deploy.yml@das-platform-building-blocks