Skip to content

Commit

Permalink
Merge branch 'main' into users/alsehr/1749_skipRoleTypePtn
Browse files Browse the repository at this point in the history
  • Loading branch information
eriqua authored May 6, 2024
2 parents f94026a + 395bb1c commit b3af83d
Show file tree
Hide file tree
Showing 49 changed files with 462 additions and 189 deletions.
11 changes: 11 additions & 0 deletions .github/actions/templates/avm-getWorkflowInput/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ runs:
# Output values to be accessed by next jobs
$workflowInput = @{}
foreach($parameterName in $parameters.Keys) {
if([String]::IsNullOrEmpty($parameters[$parameterName])) {
Write-Verbose "Skipping parameter [$parameterName] as it has no explicit or default value" -Verbose
continue
}
Write-Verbose ('Passing output [{0}] with value [{1}]' -f $parameterName, $parameters[$parameterName]) -Verbose
$workflowInput[$parameterName] = $parameters[$parameterName]
}
Expand All @@ -88,6 +93,12 @@ runs:
# Output values to be accessed by next jobs
$workflowInput = @{}
foreach($parameterName in $workflowParameters.Keys) {
if([String]::IsNullOrEmpty($workflowParameters[$parameterName])) {
Write-Verbose "Skipping parameter [$parameterName] as it has no explicit or default value" -Verbose
continue
}
Write-Verbose ('Passing output [{0}] with value [{1}]' -f $parameterName, $workflowParameters[$parameterName]) -Verbose
$workflowInput[$parameterName] = $workflowParameters[$parameterName].toString()
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform.publish-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
$functionInput = @{
Version = "${{ steps.publish_tag.outputs.version }}"
PublishedModuleName = "${{ steps.publish_tag.outputs.publishedModuleName }}"
GitTagName = "${{ steps.publish_step.outputs.gitTagName }}"
GitTagName = "${{ steps.publish_tag.outputs.gitTagName }}"
}
Expand Down
2 changes: 1 addition & 1 deletion avm/res/automation/automation-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This module deploys an Azure Automation Account.
| `Microsoft.Automation/automationAccounts` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts) |
| `Microsoft.Automation/automationAccounts/jobSchedules` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/jobSchedules) |
| `Microsoft.Automation/automationAccounts/modules` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/modules) |
| `Microsoft.Automation/automationAccounts/runbooks` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/runbooks) |
| `Microsoft.Automation/automationAccounts/runbooks` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2023-11-01/automationAccounts/runbooks) |
| `Microsoft.Automation/automationAccounts/schedules` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/schedules) |
| `Microsoft.Automation/automationAccounts/softwareUpdateConfigurations` | [2019-06-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2019-06-01/automationAccounts/softwareUpdateConfigurations) |
| `Microsoft.Automation/automationAccounts/variables` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/variables) |
Expand Down
4 changes: 2 additions & 2 deletions avm/res/automation/automation-account/job-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.26.54.24096",
"templateHash": "3709450248827326388"
"version": "0.26.170.59819",
"templateHash": "1753602189799388874"
},
"name": "Automation Account Job Schedules",
"description": "This module deploys an Azure Automation Account Job Schedule.",
Expand Down
8 changes: 4 additions & 4 deletions avm/res/automation/automation-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ var formattedUserAssignedIdentities = reduce(
var identity = !empty(managedIdentities)
? {
type: (managedIdentities.?systemAssigned ?? false)
? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned')
: (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : null)
? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned, UserAssigned' : 'SystemAssigned')
: (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : 'None')
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
}
: null
Expand Down Expand Up @@ -172,15 +172,15 @@ resource automationAccount 'Microsoft.Automation/automationAccounts@2022-08-08'
}
encryption: !empty(customerManagedKey)
? {
keySource: 'Microsoft.KeyVault'
keySource: 'Microsoft.Keyvault'
identity: !empty(customerManagedKey.?userAssignedIdentityResourceId)
? {
userAssignedIdentity: cMKUserAssignedIdentity.id
}
: null
keyVaultProperties: {
keyName: customerManagedKey!.keyName
keyVaultUri: cMKKeyVault.properties.vaultUri
keyvaultUri: cMKKeyVault.properties.vaultUri
keyVersion: !empty(customerManagedKey.?keyVersion ?? '')
? customerManagedKey!.keyVersion
: last(split(cMKKeyVault::cMKKey.properties.keyUriWithVersion, '/'))
Expand Down
46 changes: 25 additions & 21 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.26.54.24096",
"templateHash": "16001446000186457588"
"version": "0.26.170.59819",
"templateHash": "9883583040461189210"
},
"name": "Automation Accounts",
"description": "This module deploys an Azure Automation Account.",
Expand Down Expand Up @@ -629,7 +629,7 @@
},
"variables": {
"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())]",
"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": {
"Automation Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f353d9bd-d4a6-484e-a77a-8050b599b867')]",
"Automation Job Operator": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4fe576fe-1146-4730-92eb-48519fa6bf9f')]",
Expand Down Expand Up @@ -704,7 +704,7 @@
"sku": {
"name": "[parameters('skuName')]"
},
"encryption": "[if(not(empty(parameters('customerManagedKey'))), createObject('keySource', 'Microsoft.KeyVault', 'identity', if(not(empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'))), createObject('userAssignedIdentity', extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '//'), '/')[2], split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '////'), '/')[4]), 'Microsoft.ManagedIdentity/userAssignedIdentities', last(split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), 'dummyMsi'), '/')))), null()), 'keyVaultProperties', createObject('keyName', parameters('customerManagedKey').keyName, 'keyVaultUri', reference('cMKKeyVault').vaultUri, 'keyVersion', if(not(empty(coalesce(tryGet(parameters('customerManagedKey'), 'keyVersion'), ''))), parameters('customerManagedKey').keyVersion, last(split(reference('cMKKeyVault::cMKKey').keyUriWithVersion, '/'))))), null())]",
"encryption": "[if(not(empty(parameters('customerManagedKey'))), createObject('keySource', 'Microsoft.Keyvault', 'identity', if(not(empty(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'))), createObject('userAssignedIdentity', extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '//'), '/')[2], split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), '////'), '/')[4]), 'Microsoft.ManagedIdentity/userAssignedIdentities', last(split(coalesce(tryGet(parameters('customerManagedKey'), 'userAssignedIdentityResourceId'), 'dummyMsi'), '/')))), null()), 'keyVaultProperties', createObject('keyName', parameters('customerManagedKey').keyName, 'keyvaultUri', reference('cMKKeyVault').vaultUri, 'keyVersion', if(not(empty(coalesce(tryGet(parameters('customerManagedKey'), 'keyVersion'), ''))), parameters('customerManagedKey').keyVersion, last(split(reference('cMKKeyVault::cMKKey').keyUriWithVersion, '/'))))), null())]",
"publicNetworkAccess": "[if(not(empty(parameters('publicNetworkAccess'))), if(equals(parameters('publicNetworkAccess'), 'Disabled'), false(), true()), if(not(empty(parameters('privateEndpoints'))), false(), null()))]",
"disableLocalAuth": "[parameters('disableLocalAuth')]"
},
Expand Down Expand Up @@ -830,8 +830,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "8037849223912660600"
"version": "0.26.170.59819",
"templateHash": "17695610509863036784"
},
"name": "Automation Account Modules",
"description": "This module deploys an Azure Automation Account Module.",
Expand Down Expand Up @@ -972,8 +972,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "10057879847143996563"
"version": "0.26.170.59819",
"templateHash": "138940659217362139"
},
"name": "Automation Account Schedules",
"description": "This module deploys an Azure Automation Account Schedule.",
Expand Down Expand Up @@ -1151,8 +1151,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "14714097202201612277"
"version": "0.26.170.59819",
"templateHash": "6946565957724859459"
},
"name": "Automation Account Runbooks",
"description": "This module deploys an Azure Automation Account Runbook.",
Expand All @@ -1178,7 +1178,11 @@
"GraphPowerShell",
"GraphPowerShellWorkflow",
"PowerShell",
"PowerShellWorkflow"
"PowerShell72",
"PowerShellWorkflow",
"Python2",
"Python3",
"Script"
],
"metadata": {
"description": "Required. The type of the runbook."
Expand Down Expand Up @@ -1268,7 +1272,7 @@
},
"runbook": {
"type": "Microsoft.Automation/automationAccounts/runbooks",
"apiVersion": "2022-08-08",
"apiVersion": "2023-11-01",
"name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
Expand Down Expand Up @@ -1310,7 +1314,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference('runbook', '2022-08-08', 'full').location]"
"value": "[reference('runbook', '2023-11-01', 'full').location]"
}
}
}
Expand Down Expand Up @@ -1351,8 +1355,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "3709450248827326388"
"version": "0.26.170.59819",
"templateHash": "1753602189799388874"
},
"name": "Automation Account Job Schedules",
"description": "This module deploys an Azure Automation Account Job Schedule.",
Expand Down Expand Up @@ -1479,8 +1483,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "1065450815403209329"
"version": "0.26.170.59819",
"templateHash": "12833257216729067514"
},
"name": "Automation Account Variables",
"description": "This module deploys an Azure Automation Account Variable.",
Expand Down Expand Up @@ -1594,8 +1598,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "7204307644126778192"
"version": "0.26.170.59819",
"templateHash": "11747347606522833060"
},
"name": "Log Analytics Workspace Linked Services",
"description": "This module deploys a Log Analytics Workspace Linked Service.",
Expand Down Expand Up @@ -1913,8 +1917,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "7586828544795723203"
"version": "0.26.170.59819",
"templateHash": "14866221548688198425"
},
"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/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.26.54.24096",
"templateHash": "8037849223912660600"
"version": "0.26.170.59819",
"templateHash": "17695610509863036784"
},
"name": "Automation Account Modules",
"description": "This module deploys an Azure Automation Account Module.",
Expand Down
6 changes: 5 additions & 1 deletion avm/res/automation/automation-account/runbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module deploys an Azure Automation Account Runbook.

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.Automation/automationAccounts/runbooks` | [2022-08-08](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2022-08-08/automationAccounts/runbooks) |
| `Microsoft.Automation/automationAccounts/runbooks` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automation/2023-11-01/automationAccounts/runbooks) |

## Parameters

Expand Down Expand Up @@ -69,7 +69,11 @@ The type of the runbook.
'GraphPowerShell'
'GraphPowerShellWorkflow'
'PowerShell'
'PowerShell72'
'PowerShellWorkflow'
'Python2'
'Python3'
'Script'
]
```

Expand Down
6 changes: 5 additions & 1 deletion avm/res/automation/automation-account/runbook/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ param automationAccountName string
'GraphPowerShell'
'GraphPowerShellWorkflow'
'PowerShell'
'PowerShell72'
'PowerShellWorkflow'
'Python2'
'Python3'
'Script'
])
@sys.description('Required. The type of the runbook.')
param type string
Expand Down Expand Up @@ -74,7 +78,7 @@ var publishContentLink = empty(uri)
version: !empty(version) ? version : null
}

resource runbook 'Microsoft.Automation/automationAccounts/runbooks@2022-08-08' = {
resource runbook 'Microsoft.Automation/automationAccounts/runbooks@2023-11-01' = {
name: name
parent: automationAccount
location: location
Expand Down
14 changes: 9 additions & 5 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.26.54.24096",
"templateHash": "14714097202201612277"
"version": "0.26.170.59819",
"templateHash": "6946565957724859459"
},
"name": "Automation Account Runbooks",
"description": "This module deploys an Azure Automation Account Runbook.",
Expand All @@ -32,7 +32,11 @@
"GraphPowerShell",
"GraphPowerShellWorkflow",
"PowerShell",
"PowerShellWorkflow"
"PowerShell72",
"PowerShellWorkflow",
"Python2",
"Python3",
"Script"
],
"metadata": {
"description": "Required. The type of the runbook."
Expand Down Expand Up @@ -122,7 +126,7 @@
},
"runbook": {
"type": "Microsoft.Automation/automationAccounts/runbooks",
"apiVersion": "2022-08-08",
"apiVersion": "2023-11-01",
"name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
Expand Down Expand Up @@ -164,7 +168,7 @@
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference('runbook', '2022-08-08', 'full').location]"
"value": "[reference('runbook', '2023-11-01', 'full').location]"
}
}
}
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.26.54.24096",
"templateHash": "10057879847143996563"
"version": "0.26.170.59819",
"templateHash": "138940659217362139"
},
"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 @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "7586828544795723203"
"version": "0.26.170.59819",
"templateHash": "14866221548688198425"
},
"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.26.54.24096",
"templateHash": "1065450815403209329"
"version": "0.26.170.59819",
"templateHash": "12833257216729067514"
},
"name": "Automation Account Variables",
"description": "This module deploys an Azure Automation Account Variable.",
Expand Down
Loading

0 comments on commit b3af83d

Please sign in to comment.