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: child modules telemetry check #4370

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
375a183
add child modules
ReneHezser Feb 3, 2025
54ce808
- initial child modules don't need to bump the parent
ReneHezser Feb 3, 2025
40fe96d
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 3, 2025
9590175
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 4, 2025
aa67fb6
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 6, 2025
5dcf3f5
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 7, 2025
0949f88
Update utilities/pipelines/staticValidation/compliance/module.tests.ps1
ReneHezser Feb 7, 2025
257510b
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 10, 2025
83272f8
simplify and cleanup
ReneHezser Feb 12, 2025
d26bfe1
cleanup
ReneHezser Feb 12, 2025
9e19743
cleanup
ReneHezser Feb 12, 2025
dae48f6
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 12, 2025
473ee35
generate an error instead of a warning
ReneHezser Feb 13, 2025
a5d1d17
changed logic to use variable
ReneHezser Feb 13, 2025
ab04d15
telemetry tests adjusted for published modules and not only toplevel
ReneHezser Feb 13, 2025
541a50f
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 14, 2025
5b801d0
updates
ReneHezser Feb 14, 2025
fe1e40b
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 14, 2025
34f6232
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 17, 2025
7881784
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 17, 2025
b3f1806
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 17, 2025
1db3d87
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 19, 2025
4cc2725
Merge branch 'Azure:main' into child-modules-telemetry-check
ReneHezser Feb 20, 2025
562ee04
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 21, 2025
1307c58
updated res modules to pass test
ReneHezser Feb 21, 2025
1183e87
fixed web site
ReneHezser Feb 21, 2025
e21913b
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 21, 2025
61fd032
Update utilities/pipelines/staticValidation/compliance/module.tests.ps1
ReneHezser Feb 22, 2025
8aba717
cleanup
ReneHezser Feb 22, 2025
d35f9c4
Merge branch 'main' into child-modules-telemetry-check
ReneHezser Feb 22, 2025
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
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "13095124618196842295"
"version": "0.33.93.31351",
"templateHash": "5084967332926134609"
},
"name": "App Configuration Stores Key Values",
"description": "This module deploys an App Configuration Store Key Value."
Expand Down
4 changes: 3 additions & 1 deletion avm/res/app-configuration/configuration-store/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ import { privateEndpointSingleServiceType } from 'br/public:avm/utl/types/avm-co
@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
param privateEndpoints privateEndpointSingleServiceType[]?

var enableReferencedModulesTelemetry = false

var formattedUserAssignedIdentities = reduce(
map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }),
{},
Expand Down Expand Up @@ -330,7 +332,7 @@ module configurationStore_privateEndpoints 'br/public:avm/res/network/private-en
]
: null
subnetResourceId: privateEndpoint.subnetResourceId
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
enableTelemetry: enableReferencedModulesTelemetry
location: privateEndpoint.?location ?? reference(
split(privateEndpoint.subnetResourceId, '/subnets/')[0],
'2020-06-01',
Expand Down
15 changes: 8 additions & 7 deletions avm/res/app-configuration/configuration-store/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "2153109225497217544"
"version": "0.33.93.31351",
"templateHash": "11270374205801019141"
},
"name": "App Configuration Stores",
"description": "This module deploys an App Configuration Store."
Expand Down Expand Up @@ -758,6 +758,7 @@
"input": "[union(coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')], createObject('roleDefinitionId', coalesce(tryGet(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName), if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName)))))]"
}
],
"enableReferencedModulesTelemetry": false,
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', null())), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"builtInRoleNames": {
Expand Down Expand Up @@ -958,8 +959,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "13095124618196842295"
"version": "0.33.93.31351",
"templateHash": "5084967332926134609"
},
"name": "App Configuration Stores Key Values",
"description": "This module deploys an App Configuration Store Key Value."
Expand Down Expand Up @@ -1075,8 +1076,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "4070298136487551153"
"version": "0.33.93.31351",
"templateHash": "17508622087481054882"
},
"name": "App Configuration Replicas",
"description": "This module deploys an App Configuration Replica."
Expand Down Expand Up @@ -1164,7 +1165,7 @@
"value": "[coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId]"
},
"enableTelemetry": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'enableTelemetry'), parameters('enableTelemetry'))]"
"value": "[variables('enableReferencedModulesTelemetry')]"
},
"location": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'location'), reference(split(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId, '/subnets/')[0], '2020-06-01', 'Full').location)]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "4070298136487551153"
"version": "0.33.93.31351",
"templateHash": "17508622087481054882"
},
"name": "App Configuration Replicas",
"description": "This module deploys an App Configuration Replica."
Expand Down
1 change: 1 addition & 0 deletions avm/res/automation/automation-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2714,6 +2714,7 @@ This section gives you an overview of all local-referenced module files (i.e., o
| :-- | :-- |
| `br/public:avm/res/network/private-endpoint:0.7.1` | Remote reference |
| `br/public:avm/res/operations-management/solution:0.3.0` | Remote reference |
| `br/public:avm/res/operations-management/solution:0.3.1` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.4.0` | Remote reference |

## Data Collection
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/credential/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "10206419659334193725"
"version": "0.33.93.31351",
"templateHash": "16763569324712719287"
},
"name": "Automation Account Credential",
"description": "This module deploys Azure Automation Account Credential."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "4203011213224324137"
"version": "0.33.93.31351",
"templateHash": "13059723911488011478"
},
"name": "Automation Account Job Schedules",
"description": "This module deploys an Azure Automation Account Job Schedule."
Expand Down
8 changes: 5 additions & 3 deletions avm/res/automation/automation-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ param tags object?
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

var enableReferencedModulesTelemetry = false

var formattedUserAssignedIdentities = reduce(
map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }),
{},
Expand Down Expand Up @@ -322,15 +324,15 @@ module automationAccount_linkedService 'modules/linked-service.bicep' = if (!emp
)
}

module automationAccount_solutions 'br/public:avm/res/operations-management/solution:0.3.0' = [
module automationAccount_solutions 'br/public:avm/res/operations-management/solution:0.3.1' = [
for (gallerySolution, index) in gallerySolutions ?? []: if (!empty(linkedWorkspaceResourceId)) {
name: '${uniqueString(deployment().name, location)}-AutoAccount-Solution-${index}'
params: {
name: gallerySolution.name
location: location
logAnalyticsWorkspaceName: last(split(linkedWorkspaceResourceId, '/'))!
plan: gallerySolution.plan
enableTelemetry: enableTelemetry
enableTelemetry: 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 Expand Up @@ -465,7 +467,7 @@ module automationAccount_privateEndpoints 'br/public:avm/res/network/private-end
]
: null
subnetResourceId: privateEndpoint.subnetResourceId
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
enableTelemetry: enableReferencedModulesTelemetry
location: privateEndpoint.?location ?? reference(
split(privateEndpoint.subnetResourceId, '/subnets/')[0],
'2020-06-01',
Expand Down
52 changes: 25 additions & 27 deletions avm/res/automation/automation-account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "16427250452433742384"
"version": "0.33.93.31351",
"templateHash": "1045029425274283591"
},
"name": "Automation Accounts",
"description": "This module deploys an Azure Automation Account."
Expand Down Expand Up @@ -825,6 +825,7 @@
"input": "[union(coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')], createObject('roleDefinitionId', coalesce(tryGet(variables('builtInRoleNames'), coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName), if(contains(coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName, '/providers/Microsoft.Authorization/roleDefinitions/'), coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', coalesce(parameters('roleAssignments'), createArray())[copyIndex('formattedRoleAssignments')].roleDefinitionIdOrName)))))]"
}
],
"enableReferencedModulesTelemetry": false,
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned, UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', 'None')), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"builtInRoleNames": {
Expand Down Expand Up @@ -1021,8 +1022,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "10206419659334193725"
"version": "0.33.93.31351",
"templateHash": "16763569324712719287"
},
"name": "Automation Account Credential",
"description": "This module deploys Azure Automation Account Credential."
Expand Down Expand Up @@ -1147,8 +1148,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3828537230935003385"
"version": "0.33.93.31351",
"templateHash": "13366658380832072114"
},
"name": "Automation Account Modules",
"description": "This module deploys an Azure Automation Account Module."
Expand Down Expand Up @@ -1299,8 +1300,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "6875246782544956895"
"version": "0.33.93.31351",
"templateHash": "4851965874926974667"
},
"name": "Automation Account Schedules",
"description": "This module deploys an Azure Automation Account Schedule."
Expand Down Expand Up @@ -1483,8 +1484,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15686123148609089393"
"version": "0.33.93.31351",
"templateHash": "862421752535573850"
},
"name": "Automation Account Runbooks",
"description": "This module deploys an Azure Automation Account Runbook."
Expand Down Expand Up @@ -1686,8 +1687,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "4203011213224324137"
"version": "0.33.93.31351",
"templateHash": "13059723911488011478"
},
"name": "Automation Account Job Schedules",
"description": "This module deploys an Azure Automation Account Job Schedule."
Expand Down Expand Up @@ -1817,8 +1818,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "16330558441628473023"
"version": "0.33.93.31351",
"templateHash": "12352649950003218402"
},
"name": "Automation Account Variables",
"description": "This module deploys an Azure Automation Account Variable."
Expand Down Expand Up @@ -1931,8 +1932,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "11223130094132311066"
"version": "0.33.93.31351",
"templateHash": "17219087038726192111"
},
"name": "Log Analytics Workspace Linked Services",
"description": "This module deploys a Log Analytics Workspace Linked Service."
Expand Down Expand Up @@ -2049,7 +2050,7 @@
"value": "[coalesce(parameters('gallerySolutions'), createArray())[copyIndex()].plan]"
},
"enableTelemetry": {
"value": "[parameters('enableTelemetry')]"
"value": "[variables('enableReferencedModulesTelemetry')]"
}
},
"template": {
Expand All @@ -2059,8 +2060,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "1867653058254938383"
"version": "0.32.4.45862",
"templateHash": "10255889523646649592"
},
"name": "Operations Management Solutions",
"description": "This module deploys an Operations Management Solution.",
Expand Down Expand Up @@ -2135,7 +2136,7 @@
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.res.operationsmanagement-solution.{0}.{1}', replace('0.3.0', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"name": "[format('46d3xbcp.res.operationsmanagement-solution.{0}.{1}', replace('0.3.1', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
Expand Down Expand Up @@ -2170,10 +2171,7 @@
"promotionCode": "",
"product": "[parameters('plan').product]",
"publisher": "[coalesce(tryGet(parameters('plan'), 'publisher'), 'Microsoft')]"
},
"dependsOn": [
"logAnalyticsWorkspace"
]
}
}
},
"outputs": {
Expand Down Expand Up @@ -2330,8 +2328,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "18142998771588913270"
"version": "0.33.93.31351",
"templateHash": "15439780899055216009"
},
"name": "Automation Account Software Update Configurations",
"description": "This module deploys an Azure Automation Account Software Update Configuration."
Expand Down Expand Up @@ -2770,7 +2768,7 @@
"value": "[coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId]"
},
"enableTelemetry": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'enableTelemetry'), parameters('enableTelemetry'))]"
"value": "[variables('enableReferencedModulesTelemetry')]"
},
"location": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'location'), reference(split(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId, '/subnets/')[0], '2020-06-01', 'Full').location)]"
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/module/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3828537230935003385"
"version": "0.33.93.31351",
"templateHash": "13366658380832072114"
},
"name": "Automation Account Modules",
"description": "This module deploys an Azure Automation Account Module."
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/runbook/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15686123148609089393"
"version": "0.33.93.31351",
"templateHash": "862421752535573850"
},
"name": "Automation Account Runbooks",
"description": "This module deploys an Azure Automation Account Runbook."
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/schedule/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "6875246782544956895"
"version": "0.33.93.31351",
"templateHash": "4851965874926974667"
},
"name": "Automation Account Schedules",
"description": "This module deploys an Azure Automation Account Schedule."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "18142998771588913270"
"version": "0.33.93.31351",
"templateHash": "15439780899055216009"
},
"name": "Automation Account Software Update Configurations",
"description": "This module deploys an Azure Automation Account Software Update Configuration."
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/variable/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "16330558441628473023"
"version": "0.33.93.31351",
"templateHash": "12352649950003218402"
},
"name": "Automation Account Variables",
"description": "This module deploys an Azure Automation Account Variable."
Expand Down
4 changes: 3 additions & 1 deletion avm/res/batch/batch-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ import { managedIdentityAllType } from 'br/public:avm/utl/types/avm-common-types
@description('Optional. The managed identity definition for this resource.')
param managedIdentities managedIdentityAllType?

var enableReferencedModulesTelemetry = false

var formattedUserAssignedIdentities = reduce(
map((managedIdentities.?userAssignedResourceIds ?? []), (id) => { '${id}': {} }),
{},
Expand Down Expand Up @@ -302,7 +304,7 @@ module batchAccount_privateEndpoints 'br/public:avm/res/network/private-endpoint
]
: null
subnetResourceId: privateEndpoint.subnetResourceId
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
enableTelemetry: enableReferencedModulesTelemetry
location: privateEndpoint.?location ?? reference(
split(privateEndpoint.subnetResourceId, '/subnets/')[0],
'2020-06-01',
Expand Down
Loading