Closed
Description
Description
Once PR #1624 is merged we can start transforming the current test parameter files into the new Bicep test files. As this will affect all top level modules it makes sense to do this module by module. To this end we should either create an issue per module or a checkbox list somewhere to track the progress.
Note: Several modules are already converted and await review in PR #1787
To get an overview of the expected effort you can find an outline of the expected dependencies in the following:
Resource Type | # | RG | MSI | Diag | Dependencies |
---|---|---|---|---|---|
AAD/DomainServices |
7 | ✅ | ✅ | ✅ | |
AnalysisServices/servers |
5 | ✅ | ✅ | ✅ | |
ApiManagement/service |
6 | ✅ | ✅ | ✅ | |
AppConfiguration/configurationStores |
6 | ✅ | ✅ | ✅ | |
Authorization/policyAssignments |
1 | ✅ | |||
Authorization/policyExemptions |
1 | ||||
Automation/automationAccounts |
7 | ✅ | ✅ | ✅ | |
Batch/batchAccounts |
7 | ✅ | ✅ | ✅ | |
Cache/redis |
2 | ✅ | |||
CognitiveServices/accounts |
6 | ✅ | ✅ | ✅ | |
Compute/availabilitySets |
3 | ✅ | ✅ | ||
Compute/diskEncryptionSets |
3 | ✅ | ✅ | ||
Compute/disks |
4 | ✅ | ✅ | ||
Compute/galleries |
2 | ✅ | ✅ | ||
Compute/images |
2 | ✅ | ✅ | ||
Compute/proximityPlacementGroups |
2 | ✅ | ✅ | ||
Compute/virtualMachines |
10 | ✅ | ✅ | ✅ | |
Compute/virtualMachineScaleSets |
8 | ✅ | ✅ | ✅ | |
ContainerInstance/containerGroups |
1 | ✅ | |||
ContainerRegistry/registries |
7 | ✅ | ✅ | ✅ | |
ContainerService/managedClusters |
7 | ✅ | ✅ | ✅ | |
Databricks/workspaces |
5 | ✅ | ✅ | ✅ | |
DataFactory/factories |
7 | ✅ | ✅ | ✅ | |
DataProtection/backupVaults |
2 | ✅ | ✅ | ||
DBforPostgreSQL/flexibleServers |
8 | ✅ | ✅ | ✅ | |
DesktopVirtualization/applicationgroups |
5 | ✅ | ✅ | ✅ | |
DesktopVirtualization/hostpools |
5 | ✅ | ✅ | ✅ | |
DesktopVirtualization/scalingplans |
2 | ✅ | ✅ | ||
DesktopVirtualization/workspaces |
5 | ✅ | ✅ | ✅ | |
DocumentDB/databaseAccounts |
5 | ✅ | ✅ | ✅ | |
EventGrid/systemTopics |
5 | ✅ | ✅ | ✅ | |
EventGrid/topics |
6 | ✅ | ✅ | ✅ | |
EventHub/namespaces |
6 | ✅ | ✅ | ✅ | |
HealthBot/healthBots |
2 | ✅ | ✅ | ||
Insights/actionGroups |
2 | ✅ | ✅ | ||
Insights/activityLogAlerts |
3 | ✅ | ✅ | ||
Insights/components |
3 | ✅ | ✅ | ✅ | |
Insights/diagnosticSettings |
3 | ✅ | |||
Insights/metricAlerts |
2 | ✅ | ✅ | ||
Insights/privateLinkScopes |
4 | ✅ | ✅ | ✅ | |
Insights/scheduledQueryRules |
2 | ✅ | ✅ | ||
KeyVault/vaults |
6 | ✅ | ✅ | ✅ | |
KubernetesConfiguration/extensions |
1 | ✅ | |||
KubernetesConfiguration/fluxConfigurations |
1 | ✅ | |||
Logic/workflows |
5 | ✅ | ✅ | ✅ | |
MachineLearningServices/workspaces |
8 | ✅ | ✅ | ✅ | |
ManagedIdentity/userAssignedIdentities |
2 | ✅ | ✅ | ||
NetApp/netAppAccounts |
3 | ✅ | ✅ | ||
Network/applicationGateways |
8 | ✅ | ✅ | ✅ | |
Network/applicationSecurityGroups |
2 | ✅ | ✅ | ||
Network/azureFirewalls |
7 | ✅ | ✅ | ✅ | |
Network/bastionHosts |
7 | ✅ | ✅ | ✅ | |
Network/connections |
3 | ✅ | |||
Network/ddosProtectionPlans |
2 | ✅ | ✅ | ||
Network/expressRouteCircuits |
5 | ✅ | ✅ | ✅ | |
Network/firewallPolicies |
1 | ✅ | |||
Network/frontDoors |
3 | ✅ | ✅ | ||
Network/ipGroups |
2 | ✅ | ✅ | ||
Network/loadBalancers |
7 | ✅ | ✅ | ✅ | |
Network/localNetworkGateways |
2 | ✅ | ✅ | ||
Network/natGateways |
5 | ✅ | ✅ | ✅ | |
Network/networkInterfaces |
8 | ✅ | ✅ | ✅ | |
Network/networkSecurityGroups |
6 | ✅ | ✅ | ✅ | |
Network/networkWatchers |
6 | ✅ | ✅ | ✅ | |
Network/privateDnsZones |
3 | ✅ | ✅ | ||
Network/privateEndpoints |
4 | ✅ | ✅ | ||
Network/publicIPAddresses |
5 | ✅ | ✅ | ✅ | |
Network/publicIPPrefixes |
2 | ✅ | ✅ | ||
Network/routeTables |
2 | ✅ | ✅ | ||
Network/trafficmanagerprofiles |
5 | ✅ | ✅ | ✅ | |
Network/virtualHubs |
4 | ✅ | |||
Network/virtualNetworkGateways |
6 | ✅ | ✅ | ✅ | |
Network/virtualNetworks |
8 | ✅ | ✅ | ✅ | |
Network/virtualWans |
2 | ✅ | ✅ | ||
Network/vpnGateways |
3 | ✅ | |||
Network/vpnSites |
3 | ✅ | ✅ | ||
OperationalInsights/workspaces |
6 | ✅ | ✅ | ✅ | |
OperationsManagement/solutions |
1 | ✅ | |||
RecoveryServices/vaults |
7 | ✅ | ✅ | ✅ | |
Resources/deploymentScripts |
1 | ✅ | |||
Resources/resourceGroups |
1 | ✅ | |||
Security/azureSecurityCenter |
2 | ✅ | |||
ServiceBus/namespaces |
7 | ✅ | ✅ | ✅ | |
ServiceFabric/clusters |
2 | ✅ | ✅ | ||
SignalRService/webPubSub |
2 | ✅ | |||
Sql/managedInstances |
7 | ✅ | ✅ | ✅ | |
Sql/servers |
7 | ✅ | ✅ | ✅ | |
Storage/storageAccounts |
7 | ✅ | ✅ | ✅ | |
Synapse/privateLinkHubs |
3 | ✅ | ✅ | ||
Synapse/workspaces |
7 | ✅ | ✅ | ✅ | |
VirtualMachineImages/imageTemplates |
3 | ✅ | ✅ | ||
Web/connections |
3 | ✅ | ✅ | ||
Web/hostingEnvironments |
6 | ✅ | ✅ | ✅ | |
Web/serverfarms |
5 | ✅ | ✅ | ✅ | |
Web/sites |
8 | ✅ | ✅ | ✅ | |
Web/staticSites |
3 | ✅ | ✅ | ||
Authorization/locks |
0 | ||||
Authorization/policyDefinitions |
0 | ||||
Authorization/policySetDefinitions |
0 | ||||
Authorization/roleAssignments |
0 | ||||
Authorization/roleDefinitions |
0 | ||||
Consumption/budgets |
0 | ||||
ManagedServices/registrationDefinitions |
0 | ||||
Management/managementGroups |
0 | ||||
Resources/tags |
0 |
The script that was used to generate the list is the following
Script
[CmdletBinding()]
param (
[Parameter()]
[string] $ModulesPath
)
$moduleFolderPaths = (Get-ChildItem -Path $ModulesPath -Directory -Recurse).FullName | Where-Object {
((($_ -replace '\\', '/') -split '/modules/')[1] -split '/').Count -eq 2 -and $_ -notlike '*.shared*'
}
$resultSet = @{}
foreach ($moduleFolderPath in $moduleFolderPaths) {
$parameterFilePaths = (Get-ChildItem -Path (Join-Path $moduleFolderPath '.test') -Filter '*.json' -Recurse).FullName
$references = [System.Collections.ArrayList]@()
foreach ($parameterFilePath in $parameterFilePaths) {
$content = Get-Content $parameterFilePath
$references += $content | Where-Object {
$_ -like '*:*' -and ($_ -split ':')[1].Trim() -like '*/subscriptions/*'
} | ForEach-Object {
($_ -split ':')[1].Trim()
} | ForEach-Object {
($_ -replace '/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/', '') -replace '"', ''
} | ForEach-Object {
if ($_ -like 'Microsoft.*') {
($_ -split '/')[0, 1] -join '/'
} else {
$_
}
}
}
# Special case: Resource Group
$templatePath = Join-Path $moduleFolderPath 'deploy.bicep'
$templateContent = Get-Content $templatePath
if ($templateContent[0] -like '*resourceGroup*' -or $templateContent[0] -notlike '*targetScope*') {
# Requires Resource Group deployment
$references += 'Microsoft.Resources/resourceGroups'
}
# Special case: RBAC (MSI)
$rbacFilePath = Join-Path $moduleFolderPath '.bicep' 'nested_roleAssignments.bicep'
if (Test-Path $rbacFilePath) {
# Requires Managed Identity deployment for RBAC
$references += 'Microsoft.ManagedIdentity/userAssignedIdentities'
}
$providerNamespace = Split-Path (Split-Path $moduleFolderPath -Parent) -Leaf
$resourceType = Split-Path $moduleFolderPath -Leaf
$resultSet["$providerNamespace/$resourceType"] = ($references | Select-Object -Unique | Sort-Object)
}
$dependenciesTableTable = @(
'| Resource Type | # | RG | MSI | Diag | Dependencies |',
'| - | - | - | - | - | - |'
)
# With dependencies
foreach ($resourceType in ($resultSet.Keys | Where-Object { $resultSet[$_].Count -gt 0 } | Sort-Object)) {
# Convert array to arraylist to allow operations
$references = [System.Collections.ArrayList]@()
if ($resultSet[$resourceType] -is [array]) {
$references.AddRange($resultSet[$resourceType])
} else {
$null = $references.Add($resultSet[$resourceType])
}
$dependenciesCount = $references.Count
# Filter common patterns
if ($references -contains 'Microsoft.Resources/resourceGroups') {
$references.Remove('Microsoft.Resources/resourceGroups')
$hasRg = $true
} else {
$hasRg = $false
}
if ($references -contains 'Microsoft.ManagedIdentity/userAssignedIdentities') {
$references.Remove('Microsoft.ManagedIdentity/userAssignedIdentities')
$hasMsi = $true
} else {
$hasMsi = $false
}
if ($references -contains 'microsoft.operationalinsights/workspaces') {
$references.Remove('microsoft.operationalinsights/workspaces')
$references.Remove('Microsoft.Storage/storageAccounts')
$references.Remove('Microsoft.EventHub/namespaces')
$hasDiag = $true
} else {
$hasDiag = $false
}
$dependencies = ''
$references | ForEach-Object {
$dependencies += "<li>$_</li>"
}
$dependenciesTableTable += '| `{0}` | {1} | {2} | {3} | {4} | {5} |' -f ($resourceType -replace 'Microsoft.', ''), $dependenciesCount, ($hasRg ? ':white_check_mark:' : ''), ($hasMsi ? ':white_check_mark:' : ''), ($hasDiag ? ':white_check_mark:' : ''), $dependencies
}
# Without any dependencies
foreach ($resourceType in ($resultSet.Keys | Where-Object { $resultSet[$_].Count -eq 0 } | Sort-Object)) {
$dependenciesTableTable += '| `{0}` | {1} | | | | |' -f ($resourceType -replace 'Microsoft.', ''), 0
}
$dependenciesTableTable
- Update
AAD/DomainServices
to new dependencies approach #1904 - Update
AnalysisServices/servers
to new dependencies approach #1905 - Update
ApiManagement/service
to new dependencies approach #1906 - Update
AppConfiguration/configurationStores
to new dependencies approach #1907 - Update
Authorization/locks
to new dependencies approach #1908 - Update
Authorization/policyAssignments
to new dependencies approach #1909 - Update
Authorization/policyDefinitions
to new dependencies approach #1910 - Update
Authorization/policyExemptions
to new dependencies approach #1911 - Update
Authorization/policySetDefinitions
to new dependencies approach #1912 - Update
Authorization/roleAssignments
to new dependencies approach #1913 - Update
Authorization/roleDefinitions
to new dependencies approach #1914 - Update
Automation/automationAccounts
to new dependencies approach #1915 - Update
Batch/batchAccounts
to new dependencies approach #1916 - Update
Cache/redis
to new dependencies approach #1917 - Update
CognitiveServices/accounts
to new dependencies approach #1922 - Update
Compute/availabilitySets
to new dependencies approach #1924 - Update
Compute/diskEncryptionSets
to new dependencies approach #1923 - Update
Compute/disks
to new dependencies approach #1926 - Update
Compute/galleries
to new dependencies approach #1925 - Update
Compute/images
to new dependencies approach #1921 - Update
Compute/proximityPlacementGroups
to new dependencies approach #1920 - Update
Compute/virtualMachines
to new dependencies approach #1919 - Update
Compute/virtualMachineScaleSets
to new dependencies approach #1918 - Update
Consumption/budgets
to new dependencies approach #1961 - Update
ContainerInstance/containerGroups
to new dependencies approach #1928 - Update
ContainerRegistry/registries
to new dependencies approach #1929 - Update
ContainerService/managedClusters
to new dependencies approach #1930 - Update
Databricks/workspaces
to new dependencies approach #1931 - Update
DataFactory/factories
to new dependencies approach #1932 - Update
DataProtection/backupVaults
to new dependencies approach #1933 - Update
DBforPostgreSQL/flexibleServers
to new dependencies approach #1935 - Update
DesktopVirtualization/applicationgroups
to new dependencies approach #1934 - Update
DesktopVirtualization/hostpools
to new dependencies approach #1936 - Update
DesktopVirtualization/scalingplans
to new dependencies approach #1937 - Update
DesktopVirtualization/workspaces
to new dependencies approach #1938 - Update
DocumentDB/databaseAccounts
to new dependencies approach #1992 - Update
EventGrid/systemTopics
to new dependencies approach #2059 - Update
EventGrid/topics
to new dependencies approach #2085 - Update
EventHub/namespaces
to new dependencies approach #2087 - Update
HealthBot/healthBots
to new dependencies approach #2097 - Update
Insights/actionGroups
to new dependencies approach #2101 - Update
Insights/activityLogAlerts
to new dependencies approach #2196 - Update
Insights/components
to new dependencies approach #2103 - Update
Insights/diagnosticSettings
to new dependencies approach #2105 - Update
Insights/metricAlerts
to new dependencies approach #2107 - Update
Insights/privateLinkScopes
to new dependencies approach #2186 - Update
Insights/scheduledQueryRules
to new dependencies approach #2095 - Update
KeyVault/vaults
to new dependencies approach #2001 - Update
KubernetesConfiguration/extensions
to new dependencies approach #1939 - Update
KubernetesConfiguration/fluxConfigurations
to new dependencies approach #1940 - Update
Logic/workflows
to new dependencies approach #1941 - Update
MachineLearningServices/workspaces
to new dependencies approach #1942 - Update
ManagedIdentity/userAssignedIdentities
to new dependencies approach #1943 - Update
ManagedServices/registrationDefinitions
to new dependencies approach #1996 - Update
Management/managementGroups
to new dependencies approach #1994 - Update
NetApp/netAppAccounts
to new dependencies approach #1944 - Update
Network/applicationGateways
to new dependencies approach #1945 - Update
Network/applicationSecurityGroups
to new dependencies approach #1946 - Update
Network/azureFirewalls
to new dependencies approach #1947 - Update
Network/bastionHosts
to new dependencies approach #1948 - Update
Network/connections
to new dependencies approach #1949 - Update
Network/ddosProtectionPlans
to new dependencies approach #2053 - Update
Network/expressRouteCircuits
to new dependencies approach #2055 - Update
Network/firewallPolicies
to new dependencies approach #2057 - Update
Network/frontDoors
to new dependencies approach #2049 - Update
Network/ipGroups
to new dependencies approach #2047 - Update
Network/loadBalancers
to new dependencies approach #2039 - Update
Network/localNetworkGateways
to new dependencies approach #2045 - Update
Network/natGateways
to new dependencies approach #2041 - Update
Network/networkInterfaces
to new dependencies approach #1950 - Update
Network/networkSecurityGroups
to new dependencies approach #1951 - Update
Network/networkWatchers
to new dependencies approach #2270 - Update
Network/privateDnsZones
to new dependencies approach #2083 - Update
Network/privateEndpoints
to new dependencies approach #2081 - Update
Network/privateLinkServices
to new dependencies approach #2339 - Update
Network/publicIPAddresses
to new dependencies approach #2079 - Update
Network/publicIPPrefixes
to new dependencies approach #2077 - Update
Network/routeTables
to new dependencies approach #2075 - Update
Network/trafficmanagerprofiles
to new dependencies approach #2051 - Update
Network/virtualHubs
to new dependencies approach #1952 - Update
Network/virtualNetworkGateways
to new dependencies approach #1953 - Update
Network/virtualNetworks
to new dependencies approach #1954 - Update
Network/virtualWans
to new dependencies approach #1955 - Update
Network/vpnGateways
to new dependencies approach #1956 - Update
Network/vpnSites
to new dependencies approach #1957 - Update
OperationalInsights/workspaces
to new dependencies approach #2177 - Update
OperationsManagement/solutions
to new dependencies approach #2012 - Update
PowerBIDedicated/capacities
to new dependencies approach #2338 - Update
RecoveryServices/vaults
to new dependencies approach #2010 - Update
Resources/deploymentScripts
to new dependencies approach #1958 - Update
Resources/resourceGroups
to new dependencies approach #2061 - Update
Resources/tags
to new dependencies approach #2073 - Update
Security/azureSecurityCenter
to new dependencies approach #2269 - Update
ServiceBus/namespaces
to new dependencies approach #2217 - Update
ServiceFabric/clusters
to new dependencies approach #2244 - Update
SignalRService/webPubSub
to new dependencies approach #2230 - Update
Sql/managedInstances
to new dependencies approach #1964 - Update
Sql/servers
to new dependencies approach #1960 - Update
Storage/storageAccounts
to new dependencies approach #2206 - Update
Synapse/privateLinkHubs
to new dependencies approach #2227 - Update
Synapse/workspaces
to new dependencies approach #2337 - Update
VirtualMachineImages/imageTemplates
to new dependencies approach #2226 - Update
Web/connections
to new dependencies approach #2143 - Update
Web/hostingEnvironments
to new dependencies approach #2144 - Update
Web/serverfarms
to new dependencies approach #2043 - Update
Web/sites
to new dependencies approach #1959 - [Modules] Update
Web/staticSites
to new dependencies approach #1897
Metadata
Assignees
Labels
Type
Projects
Status
Done
Activity