Skip to content

Commit

Permalink
Merge pull request #1214 from SkillsFundingAgency/pv2-3310-AMA-Agent
Browse files Browse the repository at this point in the history
Pv2 3310 MMA to AMA agent
  • Loading branch information
PravPattisapu authored Aug 21, 2024
2 parents d427b11 + 29edc73 commit 924fde9
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 0 deletions.
109 changes: 109 additions & 0 deletions Infrastructure/SFA.DAS.Payments.DCR/azure-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
variables:
- group: Common - Project Level
- group: Common - Connection String
- group: Common - Database Names
- group: Common - Database Usernames

resources:
repositories:
- repository: self

trigger:
branches:
include:
- master

batch: true
paths:
include:
- Infrastructure/SFA.DAS.Payments.DCR
exclude:
- Infrastructure/SFA.DAS.Payments.ADF
- Infrastructure/SFA.DAS.Payments.Monitoring.Metrics
- Infrastructure/SFA.DAS.Payments.SFCluster.Alerts

stages:
- stage: Publish_DCR_Rules
displayName: Publish DCR_Rules

jobs:
- template: pipeline/publish.yml



- stage: Deploy_SDW
dependsOn:
- Publish_DCR_Rules

displayName: Deploy to SDW
variables:
- name: tagEnvironment
value: Dev/Test
- group: DCOL-SDW - Environment Key Vault Secrets
jobs:
- template: pipeline/deploy.yml
parameters:
pool: DCT Build Pool
environmentName: SDW
azureSubscription: DCOL-Shadow
dataCollectionRules_DCOL_ServiceFabric_DCR_name: DCOL-SDW-ServiceFabric-DCR
workspaces_DCOL_OPS_WEU_Workspace_externalid: /subscriptions/4ff47917-ac4e-432a-b314-a6525434afcb/resourceGroups/dcol-sdw-ops-weu/providers/Microsoft.OperationalInsights/workspaces/DCOL-SDW-OPS-WEU-Workspace



- stage: Deploy_MO
dependsOn:
- Publish_DCR_Rules
- Deploy_SDW
displayName: Deploy to MO
variables:
- name: tagEnvironment
value: Dev/Test
- group: DCOL-MO - Environment Key Vault Secrets
- group: Common - tags MO
jobs:
- template: pipeline/deploy.yml
parameters:
pool: DCT Build Pool
environmentName: MO
azureSubscription: DCOL-MO-VSTS
dataCollectionRules_DCOL_ServiceFabric_DCR_name: DCOL-MO-ServiceFabric-DCR
workspaces_DCOL_OPS_WEU_Workspace_externalid: /subscriptions/2f538936-0715-4dfd-83da-6b8c5a399d6a/resourceGroups/dcol-mo-ops-weu/providers/Microsoft.OperationalInsights/workspaces/DCOL-MO-OMS-WEU
#

- stage: Deploy_PP
dependsOn:
- Publish_DCR_Rules
- Deploy_MO
displayName: Deploy to PP
variables:
- name: tagEnvironment
value: Pre-Production
- group: DCOL-PP - Environment Key Vault Secrets
jobs:
- template: pipeline/deploy.yml
parameters:
pool: DCT Build Pool
environmentName: PP
azureSubscription: DCOLPPVSTS
dataCollectionRules_DCOL_ServiceFabric_DCR_name: DCOL-PP-ServiceFabric-DCR
workspaces_DCOL_OPS_WEU_Workspace_externalid: /subscriptions/931bc9f6-359c-4f65-a753-1ee191a1fd6c/resourceGroups/dcol-pp-ops-weu/providers/Microsoft.OperationalInsights/workspaces/DCOL-PP-OMS-WEU

- stage: Deploy_PD
dependsOn:
- Publish_DCR_Rules
- Deploy_PP
displayName: Deploy to PD
variables:
- name: tagEnvironment
value: Production
- group: DCOL-PD - Environment Key Vault Secrets
jobs:
- template: pipeline/deploy.yml
parameters:
pool: DCT Build Pool
environmentName: PD
azureSubscription: DCOLPDVSTS
dataCollectionRules_DCOL_ServiceFabric_DCR_name: DCOL-PD-ServiceFabric-DCR
workspaces_DCOL_OPS_WEU_Workspace_externalid: /subscriptions/6c93f7dc-6c36-4ea6-8de3-3f4574f88027/resourceGroups/dcol-pd-ops-weu/providers/Microsoft.OperationalInsights/workspaces/DCOL-PD-OMS-WEU

12 changes: 12 additions & 0 deletions Infrastructure/SFA.DAS.Payments.DCR/azure/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dataCollectionRules_DCOL_ServiceFabric_DCR_name": {
"value": null
},
"workspaces_DCOL_OPS_WEU_Workspace_externalid": {
"value": null
}
}
}
110 changes: 110 additions & 0 deletions Infrastructure/SFA.DAS.Payments.DCR/azure/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dataCollectionRules_DCOL_ServiceFabric_DCR_name": {
"defaultValue": "DCOL-SDW-ServiceFabric-DCR",
"type": "String"
},
"workspaces_DCOL_OPS_WEU_Workspace_externalid": {
"defaultValue": "/subscriptions/4ff47917-ac4e-432a-b314-a6525434afcb/resourceGroups/dcol-sdw-ops-weu/providers/Microsoft.OperationalInsights/workspaces/DCOL-SDW-OPS-WEU-Workspace",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRules",
"apiVersion": "2023-03-11",
"name": "[parameters('dataCollectionRules_DCOL_ServiceFabric_DCR_name')]",
"location": "westeurope",
"tags": {
"Environment": "Dev/Test",
"Product": "Submit Learner Data",
"Service Offering": "Submit Learner Data"
},
"kind": "Windows",
"properties": {
"dataSources": {
"performanceCounters": [
{
"streams": [
"Microsoft-Perf"
],
"samplingFrequencyInSeconds": 60,
"counterSpecifiers": [
"\\Processor Information(_Total)\\% Processor Time",
"\\Processor Information(_Total)\\% Privileged Time",
"\\Processor Information(_Total)\\% User Time",
"\\Processor Information(_Total)\\Processor Frequency",
"\\System\\Processes",
"\\Process(_Total)\\Thread Count",
"\\Process(_Total)\\Handle Count",
"\\System\\System Up Time",
"\\System\\Context Switches/sec",
"\\System\\Processor Queue Length",
"\\Memory\\% Committed Bytes In Use",
"\\Memory\\Available Bytes",
"\\Memory\\Committed Bytes",
"\\Memory\\Cache Bytes",
"\\Memory\\Pool Paged Bytes",
"\\Memory\\Pool Nonpaged Bytes",
"\\Memory\\Pages/sec",
"\\Memory\\Page Faults/sec",
"\\Process(_Total)\\Working Set",
"\\Process(_Total)\\Working Set - Private",
"\\LogicalDisk(_Total)\\% Disk Time",
"\\LogicalDisk(_Total)\\% Disk Read Time",
"\\LogicalDisk(_Total)\\% Disk Write Time",
"\\LogicalDisk(_Total)\\% Idle Time",
"\\LogicalDisk(_Total)\\Disk Bytes/sec",
"\\LogicalDisk(_Total)\\Disk Read Bytes/sec",
"\\LogicalDisk(_Total)\\Disk Write Bytes/sec",
"\\LogicalDisk(_Total)\\Disk Transfers/sec",
"\\LogicalDisk(_Total)\\Disk Reads/sec",
"\\LogicalDisk(_Total)\\Disk Writes/sec",
"\\LogicalDisk(_Total)\\Avg. Disk sec/Transfer",
"\\LogicalDisk(_Total)\\Avg. Disk sec/Read",
"\\LogicalDisk(_Total)\\Avg. Disk sec/Write",
"\\LogicalDisk(_Total)\\Avg. Disk Queue Length",
"\\LogicalDisk(_Total)\\Avg. Disk Read Queue Length",
"\\LogicalDisk(_Total)\\Avg. Disk Write Queue Length",
"\\LogicalDisk(_Total)\\% Free Space",
"\\LogicalDisk(_Total)\\Free Megabytes",
"\\Network Interface(*)\\Bytes Total/sec",
"\\Network Interface(*)\\Bytes Sent/sec",
"\\Network Interface(*)\\Bytes Received/sec",
"\\Network Interface(*)\\Packets/sec",
"\\Network Interface(*)\\Packets Sent/sec",
"\\Network Interface(*)\\Packets Received/sec",
"\\Network Interface(*)\\Packets Outbound Errors",
"\\Network Interface(*)\\Packets Received Errors"
],
"name": "perfCounterDataSource60"
}
]
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "[parameters('workspaces_DCOL_OPS_WEU_Workspace_externalid')]",
"name": "la--1544433382"
}
]
},
"dataFlows": [
{
"streams": [
"Microsoft-Perf"
],
"destinations": [
"la--1544433382"
],
"transformKql": "source",
"outputStream": "Microsoft-Perf"
}
]
}
}
]
}
60 changes: 60 additions & 0 deletions Infrastructure/SFA.DAS.Payments.DCR/pipeline/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
parameters:
pool:
azureSubscription:
location: 'westeurope'
environmentName:
dataCollectionRules_DCOL_ServiceFabric_DCR_name:
workspaces_DCOL_OPS_WEU_Workspace_externalid:



jobs:
- deployment: DeployDCRRules
pool:
name: ${{ parameters.pool }}
demands:
- ReleaseEnvironment -equals ${{ parameters.environmentName }}
environment: ${{ parameters.environmentName }}
variables:
- name: resourceGroupName
value: '$(Service)-${{ parameters.environmentName }}-ServiceFabricDAS-$(RegionPrimaryCode)'
- name: dataCollectionRules_DCOL_ServiceFabric_DCR_name
value: '${{ parameters.dataCollectionRules_DCOL_ServiceFabric_DCR_name }}'
- name: workspaces_DCOL_OPS_WEU_Workspace_externalid
value: ${{ parameters.workspaces_DCOL_OPS_WEU_Workspace_externalid }}



strategy:
runOnce:
deploy:
steps:
- task: AzurePowerShell@5
displayName: Create solution resource group
inputs:
azureSubscription: '${{ parameters.azureSubscription }}'
ScriptType: 'InlineScript'
Inline: 'New-AzResourceGroup -Name ${{ variables.resourceGroupName }} -Location "${{ parameters.location }}" -Tag $(tags) -Force'
azurePowerShellVersion: 'LatestVersion'

- task: AzurePowerShell@5
displayName: Set subscription id variable
inputs:
azureSubscription: '${{ parameters.azureSubscription }}'
ScriptType: 'InlineScript'
Inline: |
$subscriptionId = (Get-AzSubscription).SubscriptionId
Write-Host "variable=subscriptionId: $subscriptionId"
Write-Host "##vso[task.setvariable variable=subscriptionId;]$subscriptionId"
azurePowerShellVersion: 'LatestVersion'

- task: AzureResourceGroupDeployment@2
displayName: Deploy Solution Resources
inputs:
azureSubscription: '${{ parameters.azureSubscription }}'
resourceGroupName: '${{ variables.resourceGroupName }}'
location: '${{ parameters.location }}'
csmFile: '$(Pipeline.Workspace)/drop/Infrastructure/SFA.DAS.Payments.DCR/azure/template.json'
csmParametersFile: '$(Pipeline.Workspace)/drop/Infrastructure/SFA.DAS.Payments.DCR/azure/parameters.json'
overrideParameters: '-dataCollectionRules_DCOL_ServiceFabric_DCR_name "${{ variables.dataCollectionRules_DCOL_ServiceFabric_DCR_name }}" -workspaces_DCOL_OPS_WEU_Workspace_externalid "${{ variables.workspaces_DCOL_OPS_WEU_Workspace_externalid }}"'
deploymentOutputs: armoutputs
32 changes: 32 additions & 0 deletions Infrastructure/SFA.DAS.Payments.DCR/pipeline/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
jobs:
- job: publishDCR_Rules
displayName: Publish DCR Rules
pool:
name: DCT Build Pool
demands:
- IsBuildServerDas
workspace:
clean: all
steps:
#- task: gittools.gitversion.gitversion-task.GitVersion@5
- task: gitversion/setup@0
displayName: GitVersion
inputs:
updateAssemblyInfo: true
versionSpec: '5.x'

- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
Contents: |
Infrastructure/SFA.DAS.Payments.DCR/azure/**
Infrastructure/SFA.DAS.Payments.DCR/pipeline/**
Infrastructure/SFA.DAS.Payments.DCR/**
das-at-dfac-df/**
TargetFolder: '$(build.artifactstagingdirectory)/publish'
OverWrite: true

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/publish'

0 comments on commit 924fde9

Please sign in to comment.