Skip to content

Commit

Permalink
Merge branch 'main' into users/donk-msft/policyinsights-remediation
Browse files Browse the repository at this point in the history
  • Loading branch information
eriqua authored Apr 24, 2024
2 parents b01b855 + 31898ed commit e3ca12a
Show file tree
Hide file tree
Showing 205 changed files with 26,279 additions and 1,106 deletions.
11 changes: 7 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
/scripts/ @Azure/bicep-admins @Azure/avm-core-team-technical-bicep
/avm/ @Azure/avm-core-team-technical-bicep
/avm/utilities/ @Azure/avm-core-team-technical-bicep
/avm/ptn/authorization/policy-assignment/ @Azure/avm-ptn-authorization-policyassignment-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/ptn/authorization/role-assignment/ @Azure/avm-ptn-authorization-roleassignment-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/aad/domain-service/ @Azure/avm-res-aad-domainservice-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/aad/domain-service/ @Azure/avm-res-aad-domainservice-module-owners-bicep
/avm/res/analysis-services/server/ @Azure/avm-res-analysisservices-server-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/api-management/service/ @Azure/avm-res-apimanagement-service-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/app/container-app/ @Azure/avm-res-app-containerapp-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/app/managed-environment/ @Azure/avm-res-app-managedenvironment-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/app-configuration/configuration-store/ @Azure/avm-res-appconfiguration-configurationstore-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/authorization/lock/ @Azure/avm-res-authorization-lock-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/authorization/policy-assignment/ @Azure/avm-res-authorization-policyassignment-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/authorization/policy-definition/ @Azure/avm-res-authorization-policydefinition-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/authorization/policy-exemption/ @Azure/avm-res-authorization-policyexemption-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/authorization/policy-set-definition/ @Azure/avm-res-authorization-policysetdefinition-module-owners-bicep @Azure/avm-core-team-technical-bicep
Expand Down Expand Up @@ -68,15 +70,15 @@
/avm/res/key-vault/vault/ @Azure/avm-res-keyvault-vault-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/kubernetes-configuration/extension/ @Azure/avm-res-kubernetesconfiguration-extension-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/kubernetes-configuration/flux-configuration/ @Azure/avm-res-kubernetesconfiguration-fluxconfiguration-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/load-test-service/load-test/ @Azure/avm-res-loadtestservice-loadtest-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/load-test-service/load-test/ @Azure/avm-res-loadtestservice-loadtest-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/logic/workflow/ @Azure/avm-res-logic-workflow-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/machine-learning-services/workspace/ @Azure/avm-res-machinelearningservices-workspace-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/maintenance/maintenance-configuration/ @Azure/avm-res-maintenance-maintenanceconfiguration-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/managed-identity/user-assigned-identity/ @Azure/avm-res-managedidentity-userassignedidentity-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/managed-services/registration-definition/ @Azure/avm-res-managedservices-registrationdefinition-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/management/management-group/ @Azure/avm-res-management-managementgroup-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/net-app/net-app-account/ @Azure/avm-res-netapp-netappaccount-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/network/application-gateway/ @Azure/avm-res-network-applicationgateway-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/network/application-gateway/ @Azure/avm-res-network-applicationgateway-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/network/application-gateway-web-application-firewall-policy/ @Azure/avm-res-network-applicationgatewaywebapplicationfirewallpolicy-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/network/application-security-group/ @Azure/avm-res-network-applicationsecuritygroup-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/network/azure-firewall/ @Azure/avm-res-network-azurefirewall-module-owners-bicep @Azure/avm-core-team-technical-bicep
Expand Down Expand Up @@ -129,7 +131,8 @@
/avm/res/service-fabric/cluster/ @Azure/avm-res-servicefabric-cluster-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/signal-r-service/signal-r/ @Azure/avm-res-signalrservice-signalr-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/signal-r-service/web-pub-sub/ @Azure/avm-res-signalrservice-webpubsub-module-owners-bicep @Azure/avm-core-team-technical-bicep
#/avm/res/sql/managed-instance/ @Azure/avm-res-sql-managedinstance-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/sql/instance-pool/ @Azure/avm-res-sql-instancepool-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/sql/managed-instance/ @Azure/avm-res-sql-managedinstance-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/sql/server/ @Azure/avm-res-sql-server-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/storage/storage-account/ @Azure/avm-res-storage-storageaccount-module-owners-bicep @Azure/avm-core-team-technical-bicep
/avm/res/synapse/private-link-hub/ @Azure/avm-res-synapse-privatelinkhub-module-owners-bicep @Azure/avm-core-team-technical-bicep
Expand Down
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/avm_module_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ body:
description: Which existing AVM module is this issue related to?
options:
- ""
- "avm/ptn/authorization/policy-assignment"
- "avm/ptn/authorization/role-assignment"
# - "avm/ptn/avd-lza/insights"
# - "avm/ptn/avd-lza/management-plane"
# - "avm/ptn/avd-lza/networking"
Expand Down Expand Up @@ -102,15 +104,15 @@ body:
- "avm/res/key-vault/vault"
- "avm/res/kubernetes-configuration/extension"
- "avm/res/kubernetes-configuration/flux-configuration"
# - "avm/res/load-test-service/load-test"
- "avm/res/load-test-service/load-test"
- "avm/res/logic/workflow"
- "avm/res/machine-learning-services/workspace"
- "avm/res/maintenance/maintenance-configuration"
- "avm/res/managed-identity/user-assigned-identity"
# - "avm/res/managed-services/registration-definition"
- "avm/res/management/management-group"
- "avm/res/net-app/net-app-account"
# - "avm/res/network/application-gateway"
- "avm/res/network/application-gateway"
- "avm/res/network/application-gateway-web-application-firewall-policy"
- "avm/res/network/application-security-group"
- "avm/res/network/azure-firewall"
Expand Down Expand Up @@ -163,7 +165,8 @@ body:
- "avm/res/service-fabric/cluster"
- "avm/res/signal-r-service/signal-r"
- "avm/res/signal-r-service/web-pub-sub"
# - "avm/res/sql/managed-instance"
- "avm/res/sql/instance-pool"
- "avm/res/sql/managed-instance"
- "avm/res/sql/server"
- "avm/res/storage/storage-account"
- "avm/res/synapse/private-link-hub"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/avm.platform.manage-workflow-issue.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "avm.platform.manage-workflow-issue"
# Workflow for creating issues for failing workflows
name: .Platform - Manage workflow issue

on:
schedule:
Expand All @@ -18,8 +19,8 @@ jobs:
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app_id: ${{ secrets.TEAM_LINTER_APP_ID }}
private_key: ${{ secrets.TEAM_LINTER_PRIVATE_KEY }}
- name: Manage issues
shell: pwsh
env:
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/avm.platform.publish-module-index-json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This publishes the list of all public bicep modules to an index file that the Bicep vscode extension can read for intellisense using pwsh
name: .Platform - Publish [moduleIndex.json]
on:
schedule:
- cron: 45 11 * * * # Run daily at 3:45 AM PST
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
upload-index-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 // Needed to fetch all history and tags

- name: Log in to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.PUBLISH_CLIENT_ID }}
tenant-id: ${{ secrets.PUBLISH_TENANT_ID }}
subscription-id: ${{ secrets.PUBLISH_SUBSCRIPTION_ID }}
enable-AzPSSession: true

- name: Install Azure Powershell Modules
shell: pwsh
run: |
if(-not (Get-Module 'Az.Storage' -ListAvailable)) {
Install-Module -Name 'Az.Storage' -Force
}
- name: Generate moduleIndex.json
shell: pwsh
run: |
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'platform' 'Invoke-AvmJsonModuleIndexGeneration.ps1')
$functionInput = @{
storageAccountName = 'biceplivedatasaprod'
storageAccountContainer = 'bicep-cdn-live-data-container'
storageBlobName = 'module-index'
moduleIndexJsonFilePath = 'moduleIndex.json'
prefixForLastModuleIndexJsonFile = 'last-'
prefixForCurrentGeneratedModuleIndexJsonFile = 'generated-'
}
Write-Verbose "Invoke task with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
if(-not (Invoke-AvmJsonModuleIndexGeneration @functionInput)) {
Write-Output ('{0}={1}' -f 'anyErrorsOccurred', $true) >> $env:GITHUB_ENV
}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: publish-module-index-json-artifacts
path: |
moduleIndex.json
last-moduleIndex.json
generated-moduleIndex.json
- name: Upload to blob storage
shell: pwsh
run: |
$storageAccountInfo = @{
storageAccountName = 'biceplivedatasaprod'
storageAccountContainer = 'bicep-cdn-live-data-container'
storageBlobName = 'module-index'
storageBlobContentType = @{'ContentType' = 'application/json'}
}
Write-Verbose ('Uploading [moduleIndex.json] to blob storage account [{0}] in container [{1}] as blob [{2}]' -f $storageAccountInfo.storageAccountName, $storageAccountInfo.storageAccountContainer, $storageAccountInfo.storageBlobName) -Verbose
$storageContext = New-AzStorageContext -StorageAccountName $storageAccountInfo.storageAccountName -UseConnectedAccount
$functionInput = @{
Context = $storageContext
Container = $storageAccountInfo.storageAccountContainer
Blob = $storageAccountInfo.storageBlobName
File = 'moduleIndex.json'
Properties = $storageAccountInfo.storageBlobContentType
}
Set-AzStorageBlobContent @functionInput -Force
Write-Verbose ('Upload of [{0}] complete.' -f $storageAccountInfo.storageBlobName) -Verbose
- name: Check if any errors occurred during 'Generate moduleIndex.json'
if: ${{ env.anyErrorsOccurred == 'true' }}
shell: pwsh
run: |
throw "Errors occurred during 'Generate moduleIndex.json' step. Please check the logs of that step in the workflow."
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Workflow for notifying and assigning issues on creation
name: avm.platform.set-avm-github-issue-owner-config
name: .Platform - Set AVM GitHub issue owner config

on:
issues:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/avm.platform.sync-avm-modules-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Workflow to create an issue, if AVM module list is not in sync with CSV file
name: .Platform - Sync AVM module list

on:
schedule:
- cron: "30 4 * * *" # Every day at 4:30 am
workflow_dispatch:

jobs:
sync-avm-modules-list:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.TEAM_LINTER_APP_ID }}
private_key: ${{ secrets.TEAM_LINTER_PRIVATE_KEY }}
- name: sync avm modules list
shell: pwsh
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'platform' 'Sync-AvmModulesList.ps1')
$functionInput = @{
Repo = "${{ github.repository_owner }}/${{ github.event.repository.name }}"
RepoRoot = $env:GITHUB_WORKSPACE
}
Sync-AvmModulesList @functionInput -Verbose
86 changes: 86 additions & 0 deletions .github/workflows/avm.ptn.authorization.policy-assignment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "avm.ptn.authorization.policy-assignment"

on:
schedule:
- cron: "0 12 1/15 * *" # Bi-Weekly Test (on 1st & 15th of month)
workflow_dispatch:
inputs:
staticValidation:
type: boolean
description: "Execute static validation"
required: false
default: true
deploymentValidation:
type: boolean
description: "Execute deployment validation"
required: false
default: true
removeDeployment:
type: boolean
description: "Remove deployed module"
required: false
default: true
push:
branches:
- main
paths:
- ".github/actions/templates/avm-**"
- ".github/workflows/avm.template.module.yml"
- ".github/workflows/avm.ptn.authorization.policy-assignment.yml"
- "avm/ptn/authorization/policy-assignment/**"
- "avm/utilities/pipelines/**"
- "!avm/utilities/pipelines/platform/**"
- "!*/**/README.md"

env:
modulePath: "avm/ptn/authorization/policy-assignment"
workflowPath: ".github/workflows/avm.ptn.authorization.policy-assignment.yml"

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

jobs:
###########################
# Initialize pipeline #
###########################
job_initialize_pipeline:
runs-on: ubuntu-latest
name: "Initialize pipeline"
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set input parameters to output variables"
id: get-workflow-param
uses: ./.github/actions/templates/avm-getWorkflowInput
with:
workflowPath: "${{ env.workflowPath}}"
- name: "Get module test file paths"
id: get-module-test-file-paths
uses: ./.github/actions/templates/avm-getModuleTestFiles
with:
modulePath: "${{ env.modulePath }}"
outputs:
workflowInput: ${{ steps.get-workflow-param.outputs.workflowInput }}
moduleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.moduleTestFilePaths }}
psRuleModuleTestFilePaths: ${{ steps.get-module-test-file-paths.outputs.psRuleModuleTestFilePaths }}
modulePath: "${{ env.modulePath }}"

##############################
# Call reusable workflow #
##############################
call-workflow-passing-data:
name: "Run"
permissions:
id-token: write # For OIDC
contents: write # For release tags
needs:
- job_initialize_pipeline
uses: ./.github/workflows/avm.template.module.yml
with:
workflowInput: "${{ needs.job_initialize_pipeline.outputs.workflowInput }}"
moduleTestFilePaths: "${{ needs.job_initialize_pipeline.outputs.moduleTestFilePaths }}"
psRuleModuleTestFilePaths: "${{ needs.job_initialize_pipeline.outputs.psRuleModuleTestFilePaths }}"
modulePath: "${{ needs.job_initialize_pipeline.outputs.modulePath}}"
secrets: inherit
Loading

0 comments on commit e3ca12a

Please sign in to comment.