Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
74a8d20
init
ArielRam99 May 11, 2022
53eb574
update name prefix
ArielRam99 May 12, 2022
201aa6d
update name prefix
ArielRam99 May 12, 2022
09ccdee
update namePrefix
ArielRam99 May 12, 2022
b693052
update app config name
ArielRam99 May 12, 2022
ecb7814
update obj ID and param
ArielRam99 May 12, 2022
a7c8b9d
changing azure region
ArielRam99 May 12, 2022
9247827
update namePrefix
ArielRam99 May 12, 2022
c08fd2d
update locatiom, nameprefix, and vm size
ArielRam99 May 12, 2022
3c85764
update vm name
ArielRam99 May 12, 2022
3109b1d
adding ado pipeline and update namePrefix
ArielRam99 May 13, 2022
5cd5f27
Merge pull request #1 from ArielRam99/arrami/appConfigurationModule
ArielRam99 May 13, 2022
ff42e0a
Push updated Readme file(s)
May 13, 2022
ee059a8
comment out static validation
ArielRam99 May 16, 2022
71362a5
providing value le - 7
ArielRam99 May 16, 2022
e5531dd
update prefix and app config name
ArielRam99 May 16, 2022
c53f749
soft retention = null
ArielRam99 May 16, 2022
96b2723
same name config stores in param files
ArielRam99 May 16, 2022
c494771
now thet have the same name
ArielRam99 May 16, 2022
ee1a257
update nameprefix
ArielRam99 May 16, 2022
c1b9f63
adding allowed name of logs
ArielRam99 May 16, 2022
7e188f1
update private bicep registry name
ArielRam99 May 16, 2022
b06171e
update name
ArielRam99 May 16, 2022
1c6ae43
revert name prefix
ArielRam99 May 16, 2022
67bc597
add static validation job
ArielRam99 May 17, 2022
990bce8
update readme
ArielRam99 May 17, 2022
35bfb40
revert values back to defaults
ArielRam99 May 17, 2022
1d7e840
Merge branch 'Azure:main' into main
ArielRam99 May 17, 2022
56e4540
remove comment
ArielRam99 May 17, 2022
3841267
Update Azure DevOps yaml name, reference existing app config store in…
ArielRam99 May 18, 2022
2195bbc
Update read me and adding output for location in deploy.bicep
ArielRam99 May 18, 2022
12915a5
workflow badge
ArielRam99 May 18, 2022
bc74a74
update name in params
ArielRam99 May 18, 2022
83e62c2
adding role assignments in params
ArielRam99 May 18, 2022
5d38e29
revert to default values
ArielRam99 May 18, 2022
0c1063d
add min to naming convention
ArielRam99 May 18, 2022
cbec373
Merge pull request #2 from ArielRam99/arrami/WorkflowBadge/RBAC
ArielRam99 May 18, 2022
73b15db
Merge branch 'Azure:main' into main
ArielRam99 May 18, 2022
6397456
copy past original readme files
ArielRam99 May 18, 2022
18909d4
Merge branch 'main' of https://github.com/ArielRam99/ResourceModules
ArielRam99 May 18, 2022
bafb50d
Merge branch 'Azure:main' into main
ArielRam99 May 19, 2022
20258bb
Push updated Readme file(s)
May 19, 2022
b197f4f
update readme files
ArielRam99 May 19, 2022
853b1e0
Merge pull request #3 from ArielRam99/arrami/UpdateReadME
ArielRam99 May 19, 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,55 @@
name: 'AppConfiguration - ConfigurationStores'

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.appconfiguration.configurationstores.yml'
- '/.azuredevops/pipelineTemplates/module.*.yml'
- '/arm/Microsoft.AppConfiguration/configurationStores/*'
- '/arm/.global/global.module.tests.ps1'
exclude:
- '/**/*.md'

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

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/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.appconfiguration.configurationstores.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: 'AppConfiguration: ConfigurationStores'

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.appconfiguration.configurationstores.yml'
- 'arm/Microsoft.AppConfiguration/configurationStores/**'
- 'arm/.global/global.module.tests.ps1'
- '!*/**/readme.md'
- 'utilities/pipelines/**'
- '!utilities/pipelines/dependencies/**'

env:
variablesPath: 'global.variables.yml'
modulePath: 'arm/Microsoft.AppConfiguration/configurationStores'
workflowPath: '.github/workflows/ms.appconfiguration.configurationstores.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 }}'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The CI environment supports both ARM and Bicep and can be leveraged using GitHub
* For information on contributing, see [Contribution](<https://github.com/Azure/ResourceModules/wiki/Contribution%20guide>)
* File an issue via [GitHub Issues](https://github.com/azure/ResourceModules/issues/new/choose)
* For reference documentation visit [Enterprise-Scale](https://github.com/azure/enterprise-scale)

## Available Resource Modules

| Name | Status |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@sys.description('Required. The IDs of the principals to assign the role to.')
param principalIds array

@sys.description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.')
param roleDefinitionIdOrName string

@sys.description('Required. The resource ID of the resource to apply the role assignment to.')
param resourceId string

@sys.description('Optional. The principal type of the assigned principal ID.')
@allowed([
'ServicePrincipal'
'Group'
'User'
'ForeignGroup'
'Device'
''
])
param principalType string = ''

@sys.description('Optional. The description of the role assignment.')
param description string = ''

var builtInRoleNames = {
'Owner': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')
'Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
'Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')
'App Configuration Data Owner': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b')
'App Configuration Data Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071')
'Log Analytics Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
'Log Analytics Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
'Managed Application Contributor Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '641177b8-a67a-45b9-a033-47bc880bb21e')
'Managed Application Operator Role': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c7393b34-138c-406f-901b-d8cf2b17e6ae')
'Managed Applications Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b9331d33-8a36-4f8c-b097-4f54124fdb44')
'Monitoring Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '749f88d5-cbae-40b8-bcfc-e573ddc772fa')
'Monitoring Metrics Publisher': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '3913510d-42f4-4e42-8a64-420c390055eb')
'Monitoring Reader': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '43d0d8ad-25c7-4714-9337-8ba259a9fe05')
'Resource Policy Contributor': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '36243c78-bf99-498c-9df9-86d9f8d28608')
'User Access Administrator': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')
}

resource appConfiguration 'Microsoft.AppConfiguration/configurationStores@2021-10-01-preview' existing = {
name: last(split(resourceId, '/'))
}

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = [for principalId in principalIds: {
name: guid(appConfiguration.id, principalId, roleDefinitionIdOrName)
properties: {
description: description
roleDefinitionId: contains(builtInRoleNames, roleDefinitionIdOrName) ? builtInRoleNames[roleDefinitionIdOrName] : roleDefinitionIdOrName
principalId: principalId
principalType: !empty(principalType) ? principalType : null
}
scope: appConfiguration
}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "<<namePrefix>>-az-appcs-min-001"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "<<namePrefix>>-az-appcs-x-001"
},
"diagnosticLogsRetentionInDays": {
"value": 7
},
"diagnosticStorageAccountId": {
"value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<<namePrefix>>azsax001"
},
"diagnosticWorkspaceId": {
"value": "/subscriptions/<<subscriptionId>>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<<namePrefix>>-az-law-x-001"
},
"diagnosticEventHubAuthorizationRuleId": {
"value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<<namePrefix>>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey"
},
"diagnosticEventHubName": {
"value": "adp-<<namePrefix>>-az-evh-x-001"
},
"systemAssignedIdentity": {
"value": true
},
"roleAssignments": {
"value": [
{
"roleDefinitionIdOrName": "Reader",
"principalIds": [
"<<deploymentSpId>>"
]
}
]
},
"createMode": {
"value": "Recover"
},
"disableLocalAuth": {
"value": false
},
"enablePurgeProtection": {
"value": false
},
"publicNetworkAccess": {
"value": "Enabled"
},
"softDeleteRetentionInDays": {
"value": 1
}
}
}
Loading