Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ resources:
- repository: das-platform-building-blocks
type: github
name: SkillsFundingAgency/das-platform-building-blocks
ref: refs/tags/2.1.28
ref: refs/tags/2.2.25
endpoint: SkillsFundingAgency
- repository: das-platform-automation
type: github
name: SkillsFundingAgency/das-platform-automation
ref: refs/tags/5.1.8
ref: refs/tags/5.1.18
endpoint: SkillsFundingAgency
pipelines:
- pipeline: das-employer-config
Expand Down
133 changes: 77 additions & 56 deletions azure/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,31 @@
"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": {
Expand Down Expand Up @@ -260,33 +285,6 @@
"[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'))]",
Expand Down Expand Up @@ -331,7 +329,7 @@
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[reference(concat(variables('workerV2AppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value]"
"value": "[parameters('applicationInsightsConnectionString')]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
Expand Down Expand Up @@ -367,31 +365,29 @@
]
},
{
"condition": "[equals(parameters('enableFailedRequestAlert'), true())]",
"apiVersion": "2021-04-01",
"name": "[concat(variables('apiV2AppServiceName'), '-application-insights-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"name": "[concat('application-insights-', variables('workerV2AppServiceName'), '-alert-', parameters('utcValue'))]",
"type": "Microsoft.Resources/deployments",
"resourceGroup": "[variables('resourceGroupName')]",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('deploymentUrlBase'), 'application-insights.json')]",
"uri": "[concat(variables('deploymentUrlBase'),'application-insights-failed-requests-alert.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"appInsightsName": {
"value": "[variables('apiV2AppServiceName')]"
"serviceName": {
"value": "[variables('workerV2AppServiceName')]"
},
"attachedService": {
"value": "[variables('apiV2AppServiceName')]"
"applicationInsightsResourceId": {
"value": "[parameters('applicationInsightsResourceId')]"
},
"logAnalyticsWorkspaceId": {
"value": "[resourceId(parameters('logAnalyticsSubscriptionId'),parameters('sharedManagementResourceGroup'),'Microsoft.OperationalInsights/workspaces',parameters('logAnalyticsWorkspaceName'))]"
"alertActionGroupResourceId": {
"value": "[parameters('alertActionGroupResourceId')]"
}
}
},
"dependsOn": [
"[variables('resourceGroupName')]"
]
}
},
{
"apiVersion": "2021-04-01",
Expand Down Expand Up @@ -461,7 +457,7 @@
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[reference(concat(variables('apiV2AppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value]"
"value": "[parameters('applicationInsightsConnectionString')]"
}
]
}
Expand All @@ -482,29 +478,29 @@
]
},
{
"condition": "[parameters('deploySupportApp')]",
"condition": "[equals(parameters('enableFailedRequestAlert'), true())]",
"apiVersion": "2021-04-01",
"name": "[concat(variables('supportAppServiceName'), '-application-insights-', parameters('utcValue'))]",
"resourceGroup": "[variables('resourceGroupName')]",
"name": "[concat('application-insights-', variables('apiV2AppServiceName'), '-alert-', parameters('utcValue'))]",
"type": "Microsoft.Resources/deployments",
"resourceGroup": "[variables('resourceGroupName')]",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('deploymentUrlBase'), 'application-insights.json')]",
"uri": "[concat(variables('deploymentUrlBase'),'application-insights-failed-requests-alert.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"appInsightsName": {
"value": "[variables('supportAppServiceName')]"
"serviceName": {
"value": "[variables('apiV2AppServiceName')]"
},
"attachedService": {
"value": "[variables('supportAppServiceName')]"
"applicationInsightsResourceId": {
"value": "[parameters('applicationInsightsResourceId')]"
},
"alertActionGroupResourceId": {
"value": "[parameters('alertActionGroupResourceId')]"
}
}
},
"dependsOn": [
"[variables('resourceGroupName')]"
]
}
},
{
"condition": "[parameters('deploySupportApp')]",
Expand Down Expand Up @@ -572,7 +568,7 @@
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[if(parameters('deploySupportApp'), reference(concat(variables('supportAppServiceName'), '-application-insights-', parameters('utcValue'))).outputs.ConnectionString.value, '')]"
"value": "[parameters('applicationInsightsConnectionString')]"
}
]
}
Expand All @@ -592,6 +588,31 @@
"[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'))]",
Expand Down Expand Up @@ -768,4 +789,4 @@
"value": "[variables('serviceBusName')]"
}
}
}
}
13 changes: 7 additions & 6 deletions pipeline-templates/job/code-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
parameters:
RunAcceptanceTests: false
ContinueOnVulnerablePackageScanError: true

SonarCloudExtraProperties: |
sonar.scanner.javaOpts=-Xmx4096m

- task: DotNetCoreCLI@2
displayName: Publish - dotnet publish ${{ parameters.SolutionBaseName }}.Web
inputs:
Expand All @@ -27,17 +29,17 @@ jobs:
arguments: -o $(build.artifactstagingdirectory)/publish -c ${{ parameters.BuildConfiguration }} --no-build
modifyOutputPath: true
zipAfterPublish: true

- task: DotNetCoreCLI@2
displayName: Publish - dotnet publish ${{ parameters.SolutionBaseName }}.Api
inputs:
command: publish
publishWebProjects: false #set to false as this setting (which defaults to true) will parse the entire repo for web projects
publishWebProjects: false #set to false as this setting ( which defaults to true) will parse the entire repo for web projects
projects: src/CommitmentsV2/${{ parameters.SolutionBaseName }}V2.Api/${{ parameters.SolutionBaseName }}V2.Api.csproj
arguments: -o $(build.artifactstagingdirectory)/publish -c ${{ parameters.BuildConfiguration }} --no-build
modifyOutputPath: true
zipAfterPublish: true

- task: DotNetCoreCLI@2
displayName: Publish - dotnet publish ${{ parameters.SolutionBaseName }}.Host
inputs:
Expand All @@ -54,7 +56,7 @@ jobs:
Contents: |
azure/**
TargetFolder: $(build.artifactstagingdirectory)/publish

- task: PublishPipelineArtifact@1
displayName: Publish Build Artifact
inputs:
Expand All @@ -71,4 +73,3 @@ jobs:
src/CommitmentsV2/SFA.DAS.CommitmentsV2.Shared/SFA.DAS.CommitmentsV2.Shared.csproj;
src/CommitmentsV2/SFA.DAS.ReservationsV2.Api.Types/SFA.DAS.ReservationsV2.Api.Types.csproj;
src/SFA.DAS.Commitments.Events/SFA.DAS.Commitments.Events.csproj;

9 changes: 8 additions & 1 deletion pipeline-templates/job/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ 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 }}
Expand All @@ -41,6 +47,7 @@ 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 }}
Expand Down Expand Up @@ -114,7 +121,7 @@ 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
Expand Down