Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modules] Adding new module for Microsoft.Insights/dataCollectionRules #2614

Merged
merged 32 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e170777
First draft by REST2CARML +param default value fix
krbar Jan 10, 2023
e25eec9
test files - first version
krbar Jan 10, 2023
0e34691
params added: dataFlows, dataSources, destinations
krbar Jan 18, 2023
6626f00
minimal test bicep filr update
krbar Jan 19, 2023
6e6da93
adding dataCollectionEndpoint, api version update
krbar Jan 19, 2023
e761fcd
adding test case "windows"
krbar Jan 19, 2023
ec7f285
adding a second tag to test case "windows"
krbar Jan 19, 2023
7981fe0
adding test case "linux"
krbar Jan 19, 2023
a434b2d
Update dataFlows param description
krbar Jan 20, 2023
e437303
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
krbar Jan 23, 2023
4f85516
adding streamDeclarations parameter
krbar Jan 25, 2023
46abca1
adding test case "custom basic" (txt logs collection)
krbar Jan 25, 2023
69017e0
adding dataCollectionRuleDescription parameter
krbar Jan 25, 2023
8a29e30
renaming serviceShort for custom-basic
krbar Jan 25, 2023
a62c1dd
adding test case "custom adv" (txt logs with transform)
krbar Jan 25, 2023
5642efd
adding test case "iis logs"
krbar Jan 26, 2023
7a26fad
Updating custom logs paths
krbar Jan 26, 2023
af1a53c
Typo fix
krbar Jan 26, 2023
bfb0b60
Readme update
krbar Jan 26, 2023
7e9a75f
Merge branch 'main' of https://github.com/Azure/ResourceModules into …
krbar Jan 26, 2023
641ae12
law depencency - update api version
krbar Jan 27, 2023
969766c
Adding tests: roleAssignments, locks
krbar Jan 27, 2023
55d5a6a
readme update
krbar Jan 27, 2023
d37491f
Update modules/Microsoft.Insights/dataCollectionRules/readme.md
krbar Jan 27, 2023
36d57c4
Update modules/Microsoft.Insights/dataCollectionRules/deploy.bicep
krbar Jan 27, 2023
26be5ef
Update modules/Microsoft.Insights/dataCollectionRules/.test/custombas…
krbar Jan 27, 2023
d3afa7b
Update modules/Microsoft.Insights/dataCollectionRules/.test/customadv…
krbar Jan 27, 2023
4067a4b
Update modules/Microsoft.Insights/dataCollectionRules/.test/customiis…
krbar Jan 27, 2023
b9dcba3
Update modules/Microsoft.Insights/dataCollectionRules/.test/linux/dep…
krbar Jan 27, 2023
b6697ba
Update modules/Microsoft.Insights/dataCollectionRules/.test/windows/d…
krbar Jan 27, 2023
f624df2
Readme - removed empty section
krbar Jan 28, 2023
926ac9c
readme title updated
krbar Jan 28, 2023
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,40 @@
name: 'Insights - DataCollectionRules'

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.insights.datacollectionrules.yml'
- '/.azuredevops/pipelineTemplates/*.yml'
- '/modules/Microsoft.Insights/dataCollectionRules/*'
- '/utilities/pipelines/*'
exclude:
- '/utilities/pipelines/deploymentRemoval/*'
- '/**/*.md'

variables:
- template: '../../settings.yml'
- group: 'PLATFORM_VARIABLES'
- name: modulePath
value: '/modules/Microsoft.Insights/dataCollectionRules'

stages:
- template: /.azuredevops/pipelineTemplates/stages.module.yml
parameters:
removeDeployment: '${{ parameters.removeDeployment }}'
prerelease: '${{ parameters.prerelease }}'
148 changes: 148 additions & 0 deletions .github/workflows/ms.insights.datacollectionrules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: 'Insights: DataCollectionRules'

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.insights.datacollectionrules.yml'
- 'modules/Microsoft.Insights/dataCollectionRules/**'
- 'utilities/pipelines/**'
- '!utilities/pipelines/deploymentRemoval/**'
- '!*/**/readme.md'

env:
variablesPath: 'settings.yml'
modulePath: 'modules/Microsoft.Insights/dataCollectionRules'
workflowPath: '.github/workflows/ms.insights.datacollectionrules.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 }}'
TOKEN_NAMEPREFIX: '${{ secrets.TOKEN_NAMEPREFIX }}'

concurrency:
group: ${{ github.workflow }}

jobs:
###########################
# Initialize pipeline #
###########################
job_initialize_pipeline:
runs-on: ubuntu-20.04
name: 'Initialize pipeline'
steps:
- name: 'Checkout'
uses: actions/checkout@v3
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-module-test-file-paths
uses: ./.github/actions/templates/getModuleTestFiles
with:
modulePath: '${{ env.modulePath }}'
outputs:
workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }}
moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }}

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

#############################
# 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:
moduleTestFilePaths: ${{ fromJson(needs.job_initialize_pipeline.outputs.moduleTestFilePaths) }}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set environment variables
uses: ./.github/actions/templates/setEnvironmentVariables
with:
variablesPath: ${{ env.variablesPath }}
- name: 'Using test file [${{ matrix.moduleTestFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
location: '${{ env.location }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}'
removeDeployment: '${{ (fromJson(needs.job_initialize_pipeline.outputs.workflowInput)).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@v3
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 }}'
publishLatest: '${{ env.publishLatest }}'
Loading