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

feat: Adjusted telemetry 'deployments' suppression (letters A-D) #2353

Closed
wants to merge 200 commits into from
Closed
Show file tree
Hide file tree
Changes from 185 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
20ac8b7
Added skeleton
AlexanderSehr Nov 7, 2023
4939b4d
Implemented first new tests
AlexanderSehr Nov 7, 2023
4e1d86f
Changed to warning
AlexanderSehr Nov 8, 2023
94fff0b
Expanded test verbosity & added additional tets
AlexanderSehr Nov 8, 2023
c18ce6b
Finalized further tests
AlexanderSehr Nov 8, 2023
a343694
Update to latest
AlexanderSehr Nov 8, 2023
3a6f0a2
Update to latest
AlexanderSehr Nov 8, 2023
4ab6a5b
Added module name + small fix
AlexanderSehr Nov 8, 2023
9bb64bd
Fixed kvlt
AlexanderSehr Nov 8, 2023
68e2bd2
Small caching fix
AlexanderSehr Nov 8, 2023
1a013c2
Small fix and enabled passthru of warnings to GH
AlexanderSehr Nov 8, 2023
1c2fc8a
More updates
AlexanderSehr Nov 8, 2023
d9c6dd5
Update to latest
AlexanderSehr Nov 8, 2023
dd0c343
Updated test names
AlexanderSehr Nov 8, 2023
2ebd458
JSON rollback
AlexanderSehr Nov 8, 2023
f6caf7e
Updated regex
AlexanderSehr Nov 8, 2023
f56f66a
Removed assertion
AlexanderSehr Nov 8, 2023
282b640
Update to latest
AlexanderSehr Nov 8, 2023
c025f52
Update avm/utilities/pipelines/staticValidation/compliance/module.tes…
AlexanderSehr Nov 9, 2023
405901a
Update avm/utilities/pipelines/staticValidation/compliance/module.tes…
AlexanderSehr Nov 9, 2023
904c82f
Merge branch 'main' into users/alsehr/testFileCompliance
AlexanderSehr Nov 9, 2023
ef24d1f
Rollback of unrelated changes
AlexanderSehr Nov 9, 2023
9393aa1
Merge branch 'Azure:main' into main
AlexanderSehr Nov 9, 2023
cb39086
Merge branch 'Azure:main' into main
AlexanderSehr Nov 9, 2023
89eac40
Merge branch 'Azure:main' into main
AlexanderSehr Nov 10, 2023
712a673
Merge branch 'Azure:main' into main
AlexanderSehr Nov 13, 2023
55e095f
Resolved conflict
AlexanderSehr Nov 14, 2023
3121335
Update to latest
AlexanderSehr Nov 14, 2023
e9d736c
Merge branch 'Azure:main' into main
AlexanderSehr Nov 15, 2023
abfa1b9
Merge branch 'Azure:main' into main
AlexanderSehr Nov 15, 2023
c6707f6
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
246f9ba
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
6e9729d
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
26ea9f6
Merge branch 'Azure:main' into main
AlexanderSehr Nov 17, 2023
c2d183b
Merge branch 'Azure:main' into main
AlexanderSehr Nov 18, 2023
0c6650e
Merge branch 'Azure:main' into main
AlexanderSehr Nov 19, 2023
65094a5
Merge branch 'Azure:main' into main
AlexanderSehr Nov 21, 2023
968cd9a
Merge branch 'Azure:main' into main
AlexanderSehr Nov 21, 2023
3c9589b
Merge branch 'Azure:main' into main
AlexanderSehr Nov 24, 2023
eb34ddf
Merge branch 'Azure:main' into main
AlexanderSehr Nov 25, 2023
3d4f5c6
Added pipeline to main for testing
AlexanderSehr Nov 26, 2023
70154f3
Merge branch 'Azure:main' into main
AlexanderSehr Nov 27, 2023
18bd2ad
Merge branch 'Azure:main' into main
AlexanderSehr Nov 27, 2023
940b34f
Merge branch 'Azure:main' into main
AlexanderSehr Nov 28, 2023
fbb840f
Merge branch 'Azure:main' into main
AlexanderSehr Nov 29, 2023
381e366
Merge branch 'Azure:main' into main
AlexanderSehr Nov 29, 2023
06bcda3
Merge branch 'Azure:main' into main
AlexanderSehr Dec 1, 2023
0858beb
Merge branch 'Azure:main' into main
AlexanderSehr Dec 1, 2023
72b5fbb
Merge branch 'Azure:main' into main
AlexanderSehr Dec 1, 2023
917a761
TEst disable pipe
AlexanderSehr Dec 4, 2023
1b89452
Merge branch 'Azure:main' into main
AlexanderSehr Dec 4, 2023
feb981e
Update to latest
AlexanderSehr Dec 4, 2023
dda85a8
Merge branch 'Azure:main' into main
AlexanderSehr Dec 4, 2023
0373f46
Merge branch 'Azure:main' into main
AlexanderSehr Dec 6, 2023
80247e4
Merge branch 'Azure:main' into main
AlexanderSehr Dec 9, 2023
2b5a791
Merge branch 'Azure:main' into main
AlexanderSehr Dec 10, 2023
f1bab34
Merge branch 'Azure:main' into main
AlexanderSehr Dec 19, 2023
ef12ee5
Merge branch 'Azure:main' into main
AlexanderSehr Dec 21, 2023
ec1722c
Merge branch 'Azure:main' into main
AlexanderSehr Dec 21, 2023
f4136ec
Added SA workflow
AlexanderSehr Dec 22, 2023
e55e732
Added workflow
AlexanderSehr Jan 1, 2024
5c6aa5e
Update to latest
AlexanderSehr Jan 1, 2024
086c1a8
Merge branch 'Azure:main' into main
AlexanderSehr Jan 2, 2024
a9821fb
Merge branch 'Azure:main' into main
AlexanderSehr Jan 3, 2024
62b326f
Merge branch 'Azure:main' into main
AlexanderSehr Jan 3, 2024
c159269
Merge branch 'Azure:main' into main
AlexanderSehr Jan 4, 2024
6e1f59a
Merge branch 'Azure:main' into main
AlexanderSehr Jan 5, 2024
fb7befc
Merge branch 'Azure:main' into main
AlexanderSehr Jan 5, 2024
cb72681
Merge branch 'Azure:main' into main
AlexanderSehr Jan 8, 2024
f3befb7
Merge branch 'Azure:main' into main
AlexanderSehr Jan 10, 2024
f938cd8
Merge branch 'Azure:main' into main
AlexanderSehr Jan 12, 2024
d0924b6
Merge branch 'Azure:main' into main
AlexanderSehr Jan 14, 2024
315522f
Merge branch 'Azure:main' into main
AlexanderSehr Jan 17, 2024
4012fdd
Update to latest
AlexanderSehr Jan 18, 2024
b18ab70
Merge branch 'Azure:main' into main
AlexanderSehr Jan 20, 2024
686dc83
Merge branch 'Azure:main' into main
AlexanderSehr Jan 22, 2024
3f225f9
Removed outdated metadata
AlexanderSehr Jan 23, 2024
f2bd197
Update to latest
AlexanderSehr Jan 23, 2024
4cd0a6f
Merge branch 'Azure:main' into main
AlexanderSehr Jan 26, 2024
01f3a38
Merged latest main
AlexanderSehr Jan 26, 2024
18c794a
Merge branch 'Azure:main' into users/alsehr/testCleanup
AlexanderSehr Jan 26, 2024
732a605
Merge branch 'main' into users/alsehr/testCleanup
AlexanderSehr Jan 29, 2024
c0105fe
Merge branch 'Azure:main' into main
AlexanderSehr Jan 29, 2024
c7d09f2
Merge branch 'main' into users/alsehr/testCleanup
AlexanderSehr Jan 29, 2024
bea9408
Merge branch 'users/alsehr/testCleanup' of https://github.com/Alexand…
AlexanderSehr Jan 29, 2024
9d063ce
Refereshed docs
AlexanderSehr Jan 29, 2024
db61282
Merge branch 'main' into users/alsehr/testCleanup
AlexanderSehr Jan 29, 2024
4ec79f8
Merge branch 'Azure:main' into main
AlexanderSehr Jan 29, 2024
c26b307
Merge branches 'users/alsehr/testCleanup' and 'main' of https://githu…
AlexanderSehr Jan 29, 2024
e3759a8
Merge branch 'Azure:main' into main
AlexanderSehr Feb 2, 2024
86869a1
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Feb 2, 2024
f8da6b9
Merge branch 'Azure:main' into main
AlexanderSehr Feb 4, 2024
ece4faa
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Feb 4, 2024
8884290
Merge branch 'Azure:main' into main
AlexanderSehr Feb 9, 2024
6ed614f
Merge branch 'Azure:main' into main
AlexanderSehr Feb 10, 2024
e307d2a
Merge branch 'Azure:main' into main
AlexanderSehr Feb 11, 2024
96589bb
Merge branch 'Azure:main' into main
AlexanderSehr Feb 12, 2024
75ade55
Merge branch 'Azure:main' into main
AlexanderSehr Feb 13, 2024
56e7afb
Merge branch 'Azure:main' into main
AlexanderSehr Feb 21, 2024
f89b946
Merge branch 'Azure:main' into main
AlexanderSehr Feb 21, 2024
c861111
Merge branch 'Azure:main' into main
AlexanderSehr Feb 22, 2024
9511716
Merge branch 'Azure:main' into main
AlexanderSehr Feb 26, 2024
f28816d
Merge branch 'Azure:main' into main
AlexanderSehr Feb 27, 2024
79b4e78
Merge branch 'Azure:main' into main
AlexanderSehr Mar 5, 2024
31a3f76
Merge branch 'Azure:main' into main
AlexanderSehr Mar 7, 2024
e6975de
Merge branch 'Azure:main' into main
AlexanderSehr Mar 9, 2024
005581f
Update to latest
AlexanderSehr Mar 9, 2024
15a7ed5
Update to latest
AlexanderSehr Mar 9, 2024
922fd79
Update to latest
AlexanderSehr Mar 9, 2024
d861c45
Update to latest
AlexanderSehr Mar 9, 2024
a4d71e7
Merge branch 'main' into users/alsehr/e2eTestCheck
AlexanderSehr Mar 10, 2024
033baab
Merge branch 'Azure:main' into main
AlexanderSehr Mar 11, 2024
c46abd0
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Mar 11, 2024
5b35a3f
Merge branch 'Azure:main' into main
AlexanderSehr Mar 13, 2024
0012def
Merge branch 'Azure:main' into main
AlexanderSehr Mar 17, 2024
13f0450
Merge branch 'Azure:main' into main
AlexanderSehr Mar 21, 2024
4dcee53
Merge branch 'Azure:main' into main
AlexanderSehr Mar 23, 2024
88e2bea
Merge branch 'Azure:main' into main
AlexanderSehr Mar 25, 2024
776bed8
Retired / refactored workflows
AlexanderSehr Mar 25, 2024
0ab044d
Merge branch 'Azure:main' into main
AlexanderSehr Mar 26, 2024
d4c3794
Merge branch 'Azure:main' into main
AlexanderSehr Mar 26, 2024
e51366b
Merge branch 'Azure:main' into main
AlexanderSehr Mar 31, 2024
06ad8d7
Merge branch 'main' into users/workflowRetire
AlexanderSehr Mar 31, 2024
aaf0d22
Merge branch 'main' into users/workflowRetire
AlexanderSehr Mar 31, 2024
a4c516d
Applied suggestion
AlexanderSehr Mar 31, 2024
16899f2
Removed scripts
AlexanderSehr Mar 31, 2024
29f60ed
Merge branch 'Azure:main' into main
AlexanderSehr Apr 1, 2024
74783f1
Merge branch 'main' into users/workflowRetire
AlexanderSehr Apr 2, 2024
7888d41
Merge branch 'Azure:main' into main
AlexanderSehr Apr 3, 2024
666a545
Merge branch 'Azure:main' into main
AlexanderSehr Apr 3, 2024
a7aea77
Merge branch 'Azure:main' into main
AlexanderSehr Apr 8, 2024
5c05401
Merge branch 'Azure:main' into main
AlexanderSehr Apr 8, 2024
2ba34a4
Merge branch 'Azure:main' into main
AlexanderSehr Apr 10, 2024
f61b688
Updated encr
AlexanderSehr Apr 12, 2024
5032da5
Merge branch 'Azure:main' into main
AlexanderSehr Apr 12, 2024
ba3e41d
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Apr 12, 2024
1c658d3
Merge branch 'Azure:main' into main
AlexanderSehr Apr 15, 2024
2192861
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Apr 15, 2024
10339d4
Merged latest main
AlexanderSehr Apr 15, 2024
825468e
Merge branch 'users/workflowRetire' of https://github.com/AlexanderSe…
AlexanderSehr Apr 15, 2024
7ab22c1
Merge branch 'Azure:main' into main
AlexanderSehr Apr 17, 2024
98b4bbc
Merge branches 'users/workflowRetire' and 'main' of https://github.co…
AlexanderSehr Apr 18, 2024
391dec3
Merge branch 'Azure:main' into main
AlexanderSehr Apr 20, 2024
cd4d559
Update to latest
AlexanderSehr Apr 20, 2024
7ae8786
Undid changes that should be in branch in main
AlexanderSehr Apr 20, 2024
86ed73b
Merge branch 'Azure:main' into main
AlexanderSehr Apr 27, 2024
42f7fe9
Merge branch 'Azure:main' into main
AlexanderSehr Apr 29, 2024
d20afeb
Added workflow
AlexanderSehr Apr 29, 2024
157adb5
Merge pull request #4 from AlexanderSehr/users/alsehr/deploymentRemoval
AlexanderSehr Apr 29, 2024
2157079
Update to latest
AlexanderSehr Apr 29, 2024
e64d2f2
Merge branch 'main' into users/alsehr/deploymentRemoval
AlexanderSehr Apr 29, 2024
2bd3129
Small fix
AlexanderSehr Apr 29, 2024
8570dba
Merge branch 'Azure:main' into main
AlexanderSehr Apr 29, 2024
71307c0
Merge branch 'Azure:main' into main
AlexanderSehr Apr 30, 2024
71c34e4
Update to latest
AlexanderSehr May 2, 2024
9620e7a
Merge branch 'Azure:main' into main
AlexanderSehr May 7, 2024
cdbc081
Merge branch 'Azure:main' into main
AlexanderSehr May 7, 2024
669b083
Update to latest
AlexanderSehr May 12, 2024
c7d6bcd
Merge branch 'Azure:main' into main
AlexanderSehr May 15, 2024
88ce9d9
Merge branch 'Azure:main' into main
AlexanderSehr May 20, 2024
dd2c463
Merge branch 'Azure:main' into main
AlexanderSehr Jun 5, 2024
a96e8f7
Update to latest
AlexanderSehr Jun 5, 2024
e5932f4
Merge branch 'Azure:main' into main
AlexanderSehr Jun 7, 2024
e709ecb
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Jun 7, 2024
8778d07
Merge branch 'Azure:main' into main
AlexanderSehr Jun 13, 2024
8dcc44e
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Jun 13, 2024
06ef484
Initial replace
AlexanderSehr Jun 13, 2024
9643122
More files
AlexanderSehr Jun 13, 2024
58ee526
Applied formatter to all files
AlexanderSehr Jun 13, 2024
8f62742
Update to latest
AlexanderSehr Jun 13, 2024
af3826a
Update to latest
AlexanderSehr Jun 13, 2024
eae864d
Updated API
AlexanderSehr Jun 13, 2024
b6527df
Update to latest
AlexanderSehr Jun 13, 2024
339a953
Update to latest
AlexanderSehr Jun 13, 2024
23f282a
Update to latest
AlexanderSehr Jun 13, 2024
0cf0926
Update to latest
AlexanderSehr Jun 14, 2024
e2a71bf
Update to latest
AlexanderSehr Jun 14, 2024
d32aa81
Update to latest
AlexanderSehr Jun 14, 2024
d708836
Update to latest
AlexanderSehr Jun 14, 2024
0a82ebc
Update to latest
AlexanderSehr Jun 14, 2024
27eee63
Update to latest
AlexanderSehr Jun 14, 2024
b28b115
Update to latest
AlexanderSehr Jun 14, 2024
73fa0b6
Merge branch 'Azure:main' into main
AlexanderSehr Jun 14, 2024
a27b3f3
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Jun 14, 2024
39ee9c0
Resolved conflicts
AlexanderSehr Jun 14, 2024
7787a19
Merge branch 'Azure:main' into main
AlexanderSehr Jun 14, 2024
091541f
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Jun 14, 2024
549af2e
Update to latest
AlexanderSehr Jun 14, 2024
a1008a9
Merge branch 'main' into users/alsehr/telemetryModuleTest_attempt2_2
AlexanderSehr Jun 14, 2024
c74166d
Update to latest
AlexanderSehr Jun 14, 2024
a724e0b
Merge branch 'main' into users/alsehr/telemetryModuleTest_attempt2
maldineh Jun 15, 2024
47f239c
Merge branch 'Azure:main' into main
AlexanderSehr Jun 16, 2024
324f9b8
Merge branch 'main' of https://github.com/AlexanderSehr/bicep-registr…
AlexanderSehr Jun 16, 2024
f967ff1
Merge branch 'main' into users/alsehr/telemetryModuleTest_attempt2_2
ChrisSidebotham Jun 18, 2024
6c2449a
Merge branch 'Azure:main' into main
AlexanderSehr Jun 18, 2024
668d68b
Merge branches 'users/alsehr/telemetryModuleTest_attempt2' and 'users…
AlexanderSehr Jun 18, 2024
d7e1d12
Update to latest
AlexanderSehr Jun 18, 2024
f34cd0a
Merge branch 'Azure:main' into main
AlexanderSehr Jun 18, 2024
b1e423f
Update to latest
AlexanderSehr Jun 18, 2024
0e89727
Merge branch 'users/alsehr/telemetryModuleTest_attempt2_2' of https:/…
AlexanderSehr Jun 18, 2024
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
32 changes: 26 additions & 6 deletions avm/ptn/authorization/policy-assignment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ param resourceSelectors array = []
@sys.description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
name: take('46d3xbcp.ptn.authorization-policyassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}', 64)
#disable-next-line no-deployments-resources
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: take(
'46d3xbcp.ptn.authorization-policyassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}',
64
)
location: location
properties: {
mode: 'Incremental'
Expand Down Expand Up @@ -160,13 +164,29 @@ module policyAssignment_rg 'modules/resource-group.bicep' = if (!empty(resourceG
}

@sys.description('Policy Assignment Name.')
output name string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.name : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.name : policyAssignment_rg.outputs.name)
output name string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.name
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.name
: policyAssignment_rg.outputs.name)

@sys.description('Policy Assignment principal ID.')
output principalId string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.principalId : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.principalId : policyAssignment_rg.outputs.principalId)
output principalId string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.principalId
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.principalId
: policyAssignment_rg.outputs.principalId)

@sys.description('Policy Assignment resource ID.')
output resourceId string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.resourceId : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.resourceId : policyAssignment_rg.outputs.resourceId)
output resourceId string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.resourceId
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.resourceId
: policyAssignment_rg.outputs.resourceId)

@sys.description('The location the resource was deployed into.')
output location string = empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_mg.outputs.location : (!empty(subscriptionId) && empty(resourceGroupName) ? policyAssignment_sub.outputs.location : policyAssignment_rg.outputs.location)
output location string = empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_mg.outputs.location
: (!empty(subscriptionId) && empty(resourceGroupName)
? policyAssignment_sub.outputs.location
: policyAssignment_rg.outputs.location)
18 changes: 9 additions & 9 deletions avm/ptn/authorization/policy-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "3274497359181095240"
"version": "0.28.1.47646",
"templateHash": "7409207305186624461"
},
"name": "Policy Assignments (All scopes)",
"description": "This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope.",
Expand Down Expand Up @@ -158,7 +158,7 @@
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[take(format('46d3xbcp.ptn.authorization-policyassignment.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4)), 64)]",
"location": "[parameters('location')]",
"properties": {
Expand Down Expand Up @@ -226,8 +226,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "15016174258473942920"
"version": "0.28.1.47646",
"templateHash": "10754608594936413857"
},
"name": "Policy Assignments (Management Group scope)",
"description": "This module deploys a Policy Assignment at a Management Group scope.",
Expand Down Expand Up @@ -481,8 +481,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "977404313320239280"
"version": "0.28.1.47646",
"templateHash": "14066444680843928013"
},
"name": "Policy Assignments (Subscription scope)",
"description": "This module deploys a Policy Assignment at a Subscription scope.",
Expand Down Expand Up @@ -736,8 +736,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "17106923564853756802"
"version": "0.28.1.47646",
"templateHash": "17693268287104969526"
},
"name": "Policy Assignments (Resource Group scope)",
"description": "This module deploys a Policy Assignment at a Resource Group scope.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ param keyVaultName string
param managedIdentityName string

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
name: managedIdentityName
location: location
}

resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: keyVaultName
location: location
properties: {
sku: {
family: 'A'
name: 'standard'
}
tenantId: tenant().tenantId
enablePurgeProtection: null
accessPolicies: []
name: keyVaultName
location: location
properties: {
sku: {
family: 'A'
name: 'standard'
}
tenantId: tenant().tenantId
enablePurgeProtection: null
accessPolicies: []
}
}

@description('The resource ID of the created Managed Identity.')
Expand Down
6 changes: 4 additions & 2 deletions avm/ptn/authorization/resource-role-assignment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ param enableTelemetry bool = true
// Definitions //
// =============== //

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) {
#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: '46d3xbcp.ptn.authorization-resourceroleassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
Expand All @@ -62,7 +63,8 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableT
}
}

resource resourceRoleAssignment 'Microsoft.Resources/deployments@2023-07-01' = {
#disable-next-line no-deployments-resources
resource resourceRoleAssignment 'Microsoft.Resources/deployments@2024-03-01' = {
name: '${guid(resourceId, principalId, roleDefinitionId)}-ResourceRoleAssignment'
properties: {
mode: 'Incremental'
Expand Down
12 changes: 6 additions & 6 deletions avm/ptn/authorization/resource-role-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "17107961067773605935"
"version": "0.28.1.47646",
"templateHash": "16761297886500316293"
},
"name": "Resource-scoped role assignment",
"description": "This module deploys a Role Assignment for a specific resource.",
Expand Down Expand Up @@ -136,7 +136,7 @@
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.ptn.authorization-resourceroleassignment.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 0, 4))]",
"properties": {
"mode": "Incremental",
Expand All @@ -155,7 +155,7 @@
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[format('{0}-ResourceRoleAssignment', guid(parameters('resourceId'), parameters('principalId'), parameters('roleDefinitionId')))]",
"properties": {
"mode": "Incremental",
Expand Down Expand Up @@ -206,7 +206,7 @@
"metadata": {
"description": "The resource ID of the Role Assignment."
},
"value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-ResourceRoleAssignment', guid(parameters('resourceId'), parameters('principalId'), parameters('roleDefinitionId')))), '2023-07-01').outputs.roleAssignmentId.value]"
"value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-ResourceRoleAssignment', guid(parameters('resourceId'), parameters('principalId'), parameters('roleDefinitionId')))), '2024-03-01').outputs.roleAssignmentId.value]"
},
"resourceGroupName": {
"type": "string",
Expand All @@ -216,4 +216,4 @@
"value": "[resourceGroup().name]"
}
}
}
}
60 changes: 39 additions & 21 deletions avm/ptn/authorization/role-assignment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ param principalType string = ''
@sys.description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' =
if (enableTelemetry) {
name: '46d3xbcp.ptn.authorization-roleassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: '46d3xbcp.ptn.authorization-roleassignment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
location:location
}
location: location
}

module roleAssignment_mg 'modules/management-group.bicep' = if (empty(subscriptionId) && empty(resourceGroupName)) {
name: '${uniqueString(deployment().name, location)}-RoleAssignment-MG-Module'
Expand All @@ -80,7 +80,9 @@ module roleAssignment_mg 'modules/management-group.bicep' = if (empty(subscripti
managementGroupId: managementGroupId
description: !empty(description) ? description : ''
principalType: !empty(principalType) ? principalType : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId)
? delegatedManagedIdentityResourceId
: ''
conditionVersion: conditionVersion
condition: !empty(condition) ? condition : ''
}
Expand All @@ -95,7 +97,9 @@ module roleAssignment_sub 'modules/subscription.bicep' = if (!empty(subscription
subscriptionId: subscriptionId
description: !empty(description) ? description : ''
principalType: !empty(principalType) ? principalType : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId)
? delegatedManagedIdentityResourceId
: ''
conditionVersion: conditionVersion
condition: !empty(condition) ? condition : ''
}
Expand All @@ -111,17 +115,31 @@ module roleAssignment_rg 'modules/resource-group.bicep' = if (!empty(resourceGro
resourceGroupName: resourceGroupName
description: !empty(description) ? description : ''
principalType: !empty(principalType) ? principalType : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : ''
delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId)
? delegatedManagedIdentityResourceId
: ''
conditionVersion: conditionVersion
condition: !empty(condition) ? condition : ''
}
}

@sys.description('The GUID of the Role Assignment.')
output name string = empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_mg.outputs.name : (!empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_sub.outputs.name : roleAssignment_rg.outputs.name)
output name string = empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_mg.outputs.name
: (!empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_sub.outputs.name
: roleAssignment_rg.outputs.name)

@sys.description('The resource ID of the Role Assignment.')
output resourceId string = empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_mg.outputs.resourceId : (!empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_sub.outputs.resourceId : roleAssignment_rg.outputs.resourceId)
output resourceId string = empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_mg.outputs.resourceId
: (!empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_sub.outputs.resourceId
: roleAssignment_rg.outputs.resourceId)

@sys.description('The scope this Role Assignment applies to.')
output scope string = empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_mg.outputs.scope : (!empty(subscriptionId) && empty(resourceGroupName) ? roleAssignment_sub.outputs.scope : roleAssignment_rg.outputs.scope)
output scope string = empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_mg.outputs.scope
: (!empty(subscriptionId) && empty(resourceGroupName)
? roleAssignment_sub.outputs.scope
: roleAssignment_rg.outputs.scope)
18 changes: 9 additions & 9 deletions avm/ptn/authorization/role-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "3360936249154372689"
"version": "0.28.1.47646",
"templateHash": "7625867886550880091"
},
"name": "Role Assignments (All scopes)",
"description": "This module deploys a Role Assignment at a Management Group, Subscription or Resource Group scope.",
Expand Down Expand Up @@ -110,7 +110,7 @@
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.ptn.authorization-roleassignment.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"properties": {
"mode": "Incremental",
Expand Down Expand Up @@ -164,8 +164,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "13749459126745145624"
"version": "0.28.1.47646",
"templateHash": "8906093264527258150"
},
"name": "Role Assignments (Management Group scope)",
"description": "This module deploys a Role Assignment at a Management Group scope.",
Expand Down Expand Up @@ -328,8 +328,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "4516670639800961845"
"version": "0.28.1.47646",
"templateHash": "707244099707019442"
},
"name": "Role Assignments (Subscription scope)",
"description": "This module deploys a Role Assignment at a Subscription scope.",
Expand Down Expand Up @@ -500,8 +500,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.170.59819",
"templateHash": "7241874480439813582"
"version": "0.28.1.47646",
"templateHash": "14591941439222880522"
},
"name": "Role Assignments (Resource Group scope)",
"description": "This module deploys a Role Assignment at a Resource Group scope.",
Expand Down
Loading