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: Removed unused 'owner' metadata from templates including corresponding test #4046

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion avm/ptn/aca-lza/hosting-environment/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ targetScope = 'subscription'

metadata name = 'Container Apps Landing Zone Accelerator'
metadata description = 'This Azure Container Apps pattern module represents an Azure Container Apps deployment aligned with the cloud adoption framework'
metadata owner = 'Azure/module-maintainers'

// ------------------
// PARAMETERS
Expand Down
79 changes: 39 additions & 40 deletions avm/ptn/aca-lza/hosting-environment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "16535725536619244187"
"version": "0.32.4.45862",
"templateHash": "9517003629519681244"
},
"name": "Container Apps Landing Zone Accelerator",
"description": "This Azure Container Apps pattern module represents an Azure Container Apps deployment aligned with the cloud adoption framework",
"owner": "Azure/module-maintainers"
"description": "This Azure Container Apps pattern module represents an Azure Container Apps deployment aligned with the cloud adoption framework"
},
"parameters": {
"workloadName": {
Expand Down Expand Up @@ -284,8 +283,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -476,8 +475,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "16961623286769564475"
"version": "0.32.4.45862",
"templateHash": "11332286873427193874"
}
},
"parameters": {
Expand Down Expand Up @@ -1158,8 +1157,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -7241,8 +7240,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15037342818970325221"
"version": "0.32.4.45862",
"templateHash": "8606544680215053417"
}
},
"parameters": {
Expand Down Expand Up @@ -13622,8 +13621,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "8661291685866182643"
"version": "0.32.4.45862",
"templateHash": "7846302471904031395"
}
},
"parameters": {
Expand Down Expand Up @@ -20047,8 +20046,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4540495316729936890"
"version": "0.32.4.45862",
"templateHash": "10774174655235774497"
}
},
"parameters": {
Expand Down Expand Up @@ -20150,8 +20149,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -20307,8 +20306,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "1772796700946624265"
"version": "0.32.4.45862",
"templateHash": "3001536353320915058"
}
},
"parameters": {
Expand Down Expand Up @@ -26018,8 +26017,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "16272877246531333695"
"version": "0.32.4.45862",
"templateHash": "8831484297572926881"
}
},
"parameters": {
Expand Down Expand Up @@ -31918,8 +31917,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "17883690966843525174"
"version": "0.32.4.45862",
"templateHash": "9023790799371004764"
}
},
"parameters": {
Expand Down Expand Up @@ -32042,8 +32041,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -36261,8 +36260,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "16668830347449265665"
"version": "0.32.4.45862",
"templateHash": "12078108746881241077"
}
},
"parameters": {
Expand Down Expand Up @@ -37290,8 +37289,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "13769306330739717588"
"version": "0.32.4.45862",
"templateHash": "13958281823402342223"
}
},
"parameters": {
Expand Down Expand Up @@ -37432,8 +37431,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -38031,8 +38030,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15933024016056946085"
"version": "0.32.4.45862",
"templateHash": "1296700015145526668"
}
},
"parameters": {
Expand Down Expand Up @@ -40780,8 +40779,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2374255941922404406"
"version": "0.32.4.45862",
"templateHash": "9736915778905019841"
}
},
"parameters": {
Expand Down Expand Up @@ -40903,8 +40902,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4794676376542080363"
"version": "0.32.4.45862",
"templateHash": "631880718658033757"
}
},
"parameters": {
Expand Down Expand Up @@ -41042,8 +41041,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "13579081567653218345"
"version": "0.32.4.45862",
"templateHash": "17344154990905302949"
}
},
"parameters": {
Expand Down
1 change: 0 additions & 1 deletion avm/ptn/ai-platform/baseline/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ metadata name = 'AI Platform Baseline'
metadata description = '''This module provides a secure and scalable environment for deploying AI applications on Azure.
The module encompasses all essential components required for building, managing, and observing AI solutions, including a machine learning workspace, observability tools, and necessary data management services.
By integrating with Microsoft Entra ID for secure identity management and utilizing private endpoints for services like Key Vault and Blob Storage, the module ensures secure communication and data access.'''
metadata owner = 'Azure/module-maintainers'

@description('Required. Alphanumberic suffix to use for resource naming.')
@minLength(3)
Expand Down
5 changes: 2 additions & 3 deletions avm/ptn/ai-platform/baseline/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "12209511562816440708"
"templateHash": "4669287065047089544"
},
"name": "AI Platform Baseline",
"description": "This module provides a secure and scalable environment for deploying AI applications on Azure.\nThe module encompasses all essential components required for building, managing, and observing AI solutions, including a machine learning workspace, observability tools, and necessary data management services.\nBy integrating with Microsoft Entra ID for secure identity management and utilizing private endpoints for services like Key Vault and Blob Storage, the module ensures secure communication and data access.",
"owner": "Azure/module-maintainers"
"description": "This module provides a secure and scalable environment for deploying AI applications on Azure.\nThe module encompasses all essential components required for building, managing, and observing AI solutions, including a machine learning workspace, observability tools, and necessary data management services.\nBy integrating with Microsoft Entra ID for secure identity management and utilizing private endpoints for services like Key Vault and Blob Storage, the module ensures secure communication and data access."
},
"definitions": {
"logAnalyticsConfigurationType": {
Expand Down
1 change: 0 additions & 1 deletion avm/ptn/app/container-job-toolkit/main.bicep
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
metadata name = 'Container job toolkit'
metadata description = 'This module deploys a container to run as a job.'
metadata owner = 'Azure/module-maintainers'

// ============== //
// Parameters //
Expand Down
5 changes: 2 additions & 3 deletions avm/ptn/app/container-job-toolkit/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15354937436558255253"
"templateHash": "2631969094686923970"
},
"name": "Container job toolkit",
"description": "This module deploys a container to run as a job.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a container to run as a job."
},
"definitions": {
"environmentVariableType": {
Expand Down
1 change: 0 additions & 1 deletion avm/ptn/authorization/policy-assignment/main.bicep
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
metadata name = 'Policy Assignments (All scopes)'
metadata description = 'This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope.'
metadata owner = 'Azure/module-maintainers'

targetScope = 'managementGroup'

Expand Down
20 changes: 8 additions & 12 deletions avm/ptn/authorization/policy-assignment/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "3902127955131309221"
"templateHash": "18206582420908895315"
},
"name": "Policy Assignments (All scopes)",
"description": "This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Policy Assignment at a Management Group, Subscription or Resource Group scope."
},
"parameters": {
"name": {
Expand Down Expand Up @@ -254,11 +253,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "7784495768661856271"
"templateHash": "10678509985815740940"
},
"name": "Policy Assignments (Management Group scope)",
"description": "This module deploys a Policy Assignment at a Management Group scope.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Policy Assignment at a Management Group scope."
},
"parameters": {
"name": {
Expand Down Expand Up @@ -989,11 +987,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "5956652963277088316"
"templateHash": "2523227409976507857"
},
"name": "Policy Assignments (Subscription scope)",
"description": "This module deploys a Policy Assignment at a Subscription scope.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Policy Assignment at a Subscription scope."
},
"parameters": {
"name": {
Expand Down Expand Up @@ -1244,11 +1241,10 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15421130529251696480"
"templateHash": "3323049503112762784"
},
"name": "Policy Assignments (Resource Group scope)",
"description": "This module deploys a Policy Assignment at a Resource Group scope.",
"owner": "Azure/module-maintainers"
"description": "This module deploys a Policy Assignment at a Resource Group scope."
},
"parameters": {
"name": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
metadata name = 'Policy Assignments (Management Group scope)'
metadata description = 'This module deploys a Policy Assignment at a Management Group scope.'
metadata owner = 'Azure/module-maintainers'

targetScope = 'managementGroup'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
metadata name = 'Policy Assignments (Resource Group scope)'
metadata description = 'This module deploys a Policy Assignment at a Resource Group scope.'
metadata owner = 'Azure/module-maintainers'

targetScope = 'resourceGroup'

Expand Down Expand Up @@ -66,15 +65,18 @@ param subscriptionId string = subscription().subscriptionId
@sys.description('Optional. The Target Scope for the Policy. The name of the resource group for the policy assignment. If not provided, will use the current scope for deployment.')
param resourceGroupName string = resourceGroup().name


var identityVar = identity == 'SystemAssigned' ? {
type: identity
} : identity == 'UserAssigned' ? {
type: identity
userAssignedIdentities: {
'${userAssignedIdentityId}': {}
}
} : null
var identityVar = identity == 'SystemAssigned'
? {
type: identity
}
: identity == 'UserAssigned'
? {
type: identity
userAssignedIdentities: {
'${userAssignedIdentityId}': {}
}
}
: null

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
name: name
Expand All @@ -94,14 +96,16 @@ resource policyAssignment 'Microsoft.Authorization/policyAssignments@2022-06-01'
identity: identityVar
}

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleDefinitionId in roleDefinitionIds: if (!empty(roleDefinitionIds) && identity == 'SystemAssigned') {
name: guid(subscriptionId, resourceGroupName, roleDefinitionId, location, name)
properties: {
roleDefinitionId: roleDefinitionId
principalId: policyAssignment.identity.principalId
principalType: 'ServicePrincipal'
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for roleDefinitionId in roleDefinitionIds: if (!empty(roleDefinitionIds) && identity == 'SystemAssigned') {
name: guid(subscriptionId, resourceGroupName, roleDefinitionId, location, name)
properties: {
roleDefinitionId: roleDefinitionId
principalId: policyAssignment.identity.principalId
principalType: 'ServicePrincipal'
}
}
}]
]

@sys.description('Policy Assignment Name.')
output name string = policyAssignment.name
Expand Down
Loading
Loading