Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d928be7
solutions module
eriqua Jun 8, 2022
1c96b31
rke settings
eriqua Jun 8, 2022
40289a3
workflow
eriqua Jun 8, 2022
8976890
skip validation
eriqua Jun 8, 2022
df46d20
law and automation account
eriqua Jun 8, 2022
f4eb712
readme
eriqua Jun 8, 2022
964358b
law and automation account skip pester
eriqua Jun 8, 2022
d60d13d
ado
eriqua Jun 8, 2022
fcb0242
Merge branch 'main' of https://github.com/Azure/ResourceModules
eriqua Jun 8, 2022
3073190
enable pester
eriqua Jun 8, 2022
b41c970
fix static val location
eriqua Jun 8, 2022
d900fb3
carml tokens
eriqua Jun 8, 2022
9c198ba
fix input
eriqua Jun 8, 2022
555b9ea
rke
eriqua Jun 8, 2022
27651f4
carml
eriqua Jun 8, 2022
07303eb
disabling telemetry
eriqua Jun 8, 2022
20760e1
gallery param
eriqua Jun 8, 2022
17b13cb
telemetry
eriqua Jun 8, 2022
6647423
readme note
eriqua Jun 8, 2022
63ba035
merge main
eriqua Jun 8, 2022
b2f5b57
enableReferencedModulesTelemetry
eriqua Jun 8, 2022
d80e5fb
ado pipeline trigger
eriqua Jun 8, 2022
097577e
ado pipeline min par
eriqua Jun 8, 2022
e4b85e3
third party
eriqua Jun 8, 2022
cf2a042
third party param
eriqua Jun 8, 2022
676fe52
disable test
eriqua Jun 8, 2022
0dd6f95
test third party
eriqua Jun 8, 2022
aed9b34
Merge pull request #3 from eriqua/users/erikag/solutions
eriqua Jun 8, 2022
d134551
workspace readme
eriqua Jun 8, 2022
697d3d1
Merge branch 'main' of https://github.com/eriqua/ResourceModules
eriqua Jun 8, 2022
bec0582
carml
eriqua Jun 8, 2022
c2526cb
rke
eriqua Jun 10, 2022
fe38662
acr
eriqua Jun 10, 2022
262d297
Merge pull request #4 from eriqua/use3rs/erikag/sol
eriqua Jun 10, 2022
2ba6715
readme
eriqua Jun 10, 2022
55dd628
carml
eriqua Jun 10, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'OperationsManagement - Solutions'

parameters:
- name: removeDeployment
displayName: Remove deployed module
type: boolean
default: true
- name: prerelease
displayName: Publish prerelease module
type: boolean
default: false

pr: none

trigger:
batch: true
branches:
include:
- main
paths:
include:
- '/.azuredevops/modulePipelines/ms.operationsmanagement.solutions.yml'
- '/.azuredevops/pipelineTemplates/*.yml'
- '/arm/Microsoft.OperationsManagement/solutions/*'
- '/arm/.global/global.module.tests.ps1'
exclude:
- '/**/*.md'

variables:
- template: '../../global.variables.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/arm/Microsoft.OperationsManagement/solutions'

stages:
- stage: Validation
displayName: Static validation
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml

- stage: Deployment
displayName: Deployment validation
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
deploymentBlocks:
- path: $(modulePath)/.parameters/min.parameters.json
- path: $(modulePath)/.parameters/nonms.parameters.json
- path: $(modulePath)/.parameters/ms.parameters.json

- stage: Publishing
displayName: Publishing
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true')))
jobs:
- template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml
142 changes: 142 additions & 0 deletions .github/workflows/ms.operationsmanagement.solutions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: 'OperationsManagement: Solutions'

on:
workflow_dispatch:
inputs:
removeDeployment:
type: boolean
description: 'Remove deployed module'
required: false
default: true
prerelease:
type: boolean
description: 'Publish prerelease module'
required: false
default: false
push:
branches:
- main
paths:
- '.github/actions/templates/**'
- '.github/workflows/ms.operationsmanagement.solutions.yml'
- 'arm/Microsoft.OperationsManagement/solutions/**'
- 'arm/.global/global.module.tests.ps1'
- '!*/**/readme.md'
- 'utilities/pipelines/**'
- '!utilities/pipelines/dependencies/**'

env:
variablesPath: 'global.variables.yml'
modulePath: 'arm/Microsoft.OperationsManagement/solutions'
workflowPath: '.github/workflows/ms.operationsmanagement.solutions.yml'
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}'
ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}'
DEPLOYMENT_SP_ID: '${{ secrets.DEPLOYMENT_SP_ID }}'

jobs:
###########################
# Initialize pipeline #
###########################
job_initialize_pipeline:
runs-on: ubuntu-20.04
name: 'Initialize pipeline'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Set input parameters to output variables'
id: get-workflow-param
uses: ./.github/actions/templates/getWorkflowInput
with:
workflowPath: '${{ env.workflowPath}}'
- name: 'Get parameter file paths'
id: get-parameter-file-paths
uses: ./.github/actions/templates/getParameterFiles
with:
modulePath: '${{ env.modulePath }}'
outputs:
removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }}
parameterFilePaths: ${{ steps.get-parameter-file-paths.outputs.parameterFilePaths }}

#########################
# Static validation #
#########################
job_module_pester_validation:
runs-on: ubuntu-20.04
name: 'Static validation'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Run tests'
uses: ./.github/actions/templates/validateModulePester
with:
modulePath: '${{ env.modulePath }}'

#############################
# Deployment validation #
#############################
job_module_deploy_validation:
runs-on: ubuntu-20.04
name: 'Deployment validation'
needs:
- job_initialize_pipeline
- job_module_pester_validation
strategy:
fail-fast: false
matrix:
parameterFilePaths: ${{ fromJSON(needs.job_initialize_pipeline.outputs.parameterFilePaths) }}
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set environment variables
uses: ./.github/actions/templates/setEnvironmentVariables
with:
variablesPath: ${{ env.variablesPath }}
- name: 'Using parameter file [${{ matrix.parameterFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
parameterFilePath: '${{ env.modulePath }}/${{ matrix.parameterFilePaths }}'
location: '${{ env.location }}'
resourceGroupName: '${{ env.resourceGroupName }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}'
removeDeployment: '${{ needs.job_initialize_pipeline.outputs.removeDeployment }}'

##################
# Publishing #
##################
job_publish_module:
name: 'Publishing'
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true'
runs-on: ubuntu-20.04
needs:
- job_module_deploy_validation
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set environment variables
uses: ./.github/actions/templates/setEnvironmentVariables
with:
variablesPath: ${{ env.variablesPath }}
- name: 'Publishing'
uses: ./.github/actions/templates/publishModule
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
templateSpecsRGName: '${{ env.templateSpecsRGName }}'
templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}'
templateSpecsDescription: '${{ env.templateSpecsDescription }}'
templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}'
bicepRegistryName: '${{ env.bicepRegistryName }}'
bicepRegistryRGName: '${{ env.bicepRegistryRGName }}'
bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}'
bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}'
2 changes: 1 addition & 1 deletion .github/workflows/platform.dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
fail-fast: false
matrix:
parameterFilePaths:
['appi.parameters.json', 'aut.parameters.json', 'parameters.json']
['appi.parameters.json', 'aut.parameters.json', 'sol.parameters.json', 'parameters.json']
steps:
- name: 'Checkout'
uses: actions/checkout@v2
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
},
"gallerySolutions": {
"value": [
"Updates"
{
"name": "Updates",
"product": "OMSGallery",
"publisher": "Microsoft"
}
]
},
"softwareUpdateConfigurations": {
Expand Down
7 changes: 5 additions & 2 deletions arm/Microsoft.Automation/automationAccounts/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,15 @@ module automationAccount_linkedService '../../Microsoft.OperationalInsights/work
scope: resourceGroup(!empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[2] : subscription().subscriptionId, !empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[4] : resourceGroup().name)
}

module automationAccount_solutions '.bicep/nested_solution.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) {
module automationAccount_solutions '../../Microsoft.OperationsManagement/solutions/deploy.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) {
name: '${uniqueString(deployment().name, location)}-AutoAccount-Solution-${index}'
params: {
name: gallerySolution
name: gallerySolution.name
location: location
logAnalyticsWorkspaceName: last(split(linkedWorkspaceResourceId, '/'))
product: contains(gallerySolution, 'product') ? gallerySolution.product : 'OMSGallery'
publisher: contains(gallerySolution, 'publisher') ? gallerySolution.publisher : 'Microsoft'
enableDefaultTelemetry: enableReferencedModulesTelemetry
}
// This is to support solution to law in different subscription and resource group than the automation account.
// The current scope is used by default if no linked service is intended to be created.
Expand Down
12 changes: 10 additions & 2 deletions arm/Microsoft.Automation/automationAccounts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,11 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice
},
"gallerySolutions": {
"value": [
"Updates"
{
"name": "Updates",
"product": "OMSGallery",
"publisher": "Microsoft"
}
]
},
"softwareUpdateConfigurations": {
Expand Down Expand Up @@ -725,7 +729,11 @@ module automationAccounts './Microsoft.Automation/automationAccounts/deploy.bice
]
linkedWorkspaceResourceId: '/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<<namePrefix>>-az-law-aut-001'
gallerySolutions: [
'Updates'
{
name: 'Updates'
product: 'OMSGallery'
publisher: 'Microsoft'
}
]
softwareUpdateConfigurations: [
{
Expand Down

This file was deleted.

11 changes: 6 additions & 5 deletions arm/Microsoft.OperationalInsights/workspaces/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param savedSearches array = []
@description('Optional. LAW data sources to configure.')
param dataSources array = []

@description('Optional. LAW gallerySolutions from the gallery.')
@description('Optional. List of gallerySolutions to be created in the log analytics workspace.')
param gallerySolutions array = []

@description('Optional. Number of days data will be retained for.')
Expand Down Expand Up @@ -235,14 +235,15 @@ module logAnalyticsWorkspace_dataSources 'dataSources/deploy.bicep' = [for (data
}
}]

module logAnalyticsWorkspace_solutions '.bicep/nested_solutions.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(gallerySolutions)) {
module logAnalyticsWorkspace_solutions '../../Microsoft.OperationsManagement/solutions/deploy.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(gallerySolutions)) {
name: '${uniqueString(deployment().name, location)}-LAW-Solution-${index}'
params: {
gallerySolution: gallerySolution.name
name: gallerySolution.name
location: location
logAnalyticsWorkspaceName: logAnalyticsWorkspace.name
product: gallerySolution.product
publisher: gallerySolution.publisher
product: contains(gallerySolution, 'product') ? gallerySolution.product : 'OMSGallery'
publisher: contains(gallerySolution, 'publisher') ? gallerySolution.publisher : 'Microsoft'
enableDefaultTelemetry: enableReferencedModulesTelemetry
}
}]

Expand Down
Loading