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

Create secrets key vault and assign arc node access template change #14127

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -30,6 +30,13 @@
"type": "int",
"defaultValue": 30
},
"enableBackupSecretsToAzure": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Set this value as false, if you you do not want to backup secrets to cloud"
}
},
"diagnosticStorageAccountName": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -502,7 +509,15 @@
"arbDeploymentSpnSecretName": "[concat( parameters('clusterName'), '-', 'DefaultARBApplication')]",
"storageWitnessNameVar": "WitnessStorageKey",
"secretsLocationVar": "[concat('https://',parameters('keyVaultName'), '.vault.azure.net')]",
"backupsecretsLocationVar": "[concat('https://',parameters('keyVaultName'), '.vault.azure.net')]",
"witnessTypeVar": "[if(equals(parameters('witnessType'), 'No Witness'), '','Cloud')]",
"secretsLocationPayload": [
{
"secretsType": "BackupSecrets",
"secretsLocation": "[variables('backupsecretsLocationVar')]"
}
],
"BackupSecretsLocationList": "[if(parameters('enableBackupSecretsToAzure'), variables('secretsLocationPayload'), json('[]'))]",
"clusterWitnessStorageAccountNameVar": "[if(equals(parameters('witnessType'), 'No Witness'), '', parameters('clusterWitnessStorageAccountName'))]",
"AzureServiceEndpointVar": "[if(equals(parameters('witnessType'), 'No Witness'), '', 'core.windows.net')]",
"localAdminSecretValue": "[base64(concat(parameters('localAdminUserName'),':',parameters('localAdminPassword')))]",
Expand Down Expand Up @@ -718,6 +733,23 @@
]
}
},
{
"condition": "[parameters('enableBackupSecretsToAzure')]",
"copy": {
"name": "roleAssignmentCopy",
"count": "[length(parameters('arcNodeResourceIds'))]"
},
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(concat('AKV-', parameters('arcNodeResourceIds')[copyIndex()]))]",
"properties": {
"mode": "Incremental",
"roleDefinitionId": "[concat(subscription().id, '/providers/Microsoft.Authorization/roleDefinitions/', 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7')]",
"principalId": "[reference(parameters('arcNodeResourceIds')[copyIndex()], '2023-10-03-preview', 'full').identity.principalId]",
"scope": "[resourceGroup().id]",
"description": "[concat(substring(parameters('arcNodeResourceIds')[copyIndex()],lastIndexOf(parameters('arcNodeResourceIds')[copyIndex()],'/')),'- Key Vault Secrets Officer role')]"
}
},
{
"condition": "[equals(parameters('deploymentMode'), 'Validate')]",
"type": "Microsoft.AzureStackHCI/clusters",
Expand All @@ -730,7 +762,11 @@
"type": "SystemAssigned"
},
"location": "[parameters('location')]",
"properties": {}
"kind": "WindowsServer",
"properties": {
"secretsLocations": "[variables('BackupSecretsLocationList')]"

}
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
Expand Down Expand Up @@ -828,6 +864,7 @@
"dependsOn": [
"[resourceId('Microsoft.AzureStackHCI/clusters', parameters('clusterName'))]"
],
"kind": "WindowsServer",
"properties": {
"arcNodeResourceIds": "[parameters('arcNodeResourceIds')]",
"deploymentMode": "[parameters('deploymentMode')]",
Expand Down Expand Up @@ -909,4 +946,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"softDeleteRetentionDays": {
"value": 30
},
"backupSecretskeyVaultName": {
"value": "armdeploybkpkv"
},
"backupSecretskeyVaultsoftDeleteRetentionDays": {
"value": 30
},
"diagnosticStorageAccountName": {
"value": "partnerdiagsa3"
},
Expand Down
Loading