Skip to content

Commit

Permalink
Deployment template can specify registryName (#4809)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankowitz authored Feb 14, 2025
1 parent 019af7b commit 4fc790f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions build/jobs/provision-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
enableImport = $true
backgroundTaskCount = 5
enableReindex = if ("${{ parameters.reindexEnabled }}" -eq "true") { $true } else { $false }
registryName = '$(azureContainerRegistry)'
imageTag = '${{ parameters.imageTag }}'
}

Expand Down
29 changes: 12 additions & 17 deletions samples/templates/default-azuredeploy-docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,6 @@
"description": "An object representing the default consistency policy for the Cosmos DB account. See https://docs.microsoft.com/en-us/azure/templates/microsoft.documentdb/databaseaccounts#ConsistencyPolicy"
}
},
"cosmosDbFreeTier": {
"type": "string",
"allowedValues": [
"Yes",
"No"
],
"defaultValue": "No",
"metadata": {
"description": "Use Cosmos DB free tier."
}
},
"cosmosDbCmkUrl": {
"type": "string",
"defaultValue": "",
Expand Down Expand Up @@ -182,9 +171,16 @@
"description": "Version of the FHIR specification to deploy."
}
},
"registryName": {
"type": "string",
"defaultValue": "mcr.microsoft.com/healthcareapis",
"metadata": {
"description": "Docker registry containing images to deploy."
}
},
"imageTag": {
"type": "string",
"defaultValue": "release",
"defaultValue": "latest",
"metadata": {
"description": "Tag of the docker image to deploy."
}
Expand Down Expand Up @@ -239,7 +235,6 @@
},
"variables": {
"isMAG": "[or(contains(resourceGroup().location,'usgov'),contains(resourceGroup().location,'usdod'))]",
"isCosmosDbFreeTier": "[equals(parameters('cosmosDbFreeTier'),'Yes')]",
"serviceName": "[toLower(parameters('serviceName'))]",
"keyvaultEndpoint": "[if(variables('isMAG'), concat('https://', variables('serviceName'), '.vault.usgovcloudapi.net/'), concat('https://', variables('serviceName'), '.vault.azure.net/'))]",
"appServicePlanResourceGroup": "[if(empty(parameters('appServicePlanResourceGroup')), resourceGroup().name, parameters('appServicePlanResourceGroup'))]",
Expand Down Expand Up @@ -286,15 +281,15 @@
"sqlDatabaseName": "[concat('FHIR', parameters('fhirVersion'))]",
"computedSqlServerReference": "[concat('Microsoft.Sql/servers/', variables('sqlServerDerivedName'))]",
"storageAccountName": "[concat(substring(replace(variables('serviceName'), '-', ''), 0, min(11, length(replace(variables('serviceName'), '-', '')))), uniquestring(resourceGroup().id, variables('serviceName')))]",
"registryName": "healthplatformregistry.azurecr.io",
"azureContainerRegistryUri": "[if(variables('isMAG'), '.azurecr.us', '.azurecr.io')]",
"azureContainerRegistryName": "[concat(substring(replace(variables('serviceName'), '-', ''), 0, min(11, length(replace(variables('serviceName'), '-', '')))), uniquestring(resourceGroup().id, variables('serviceName')))]",
"isSqlHyperscaleTier": "[equals(parameters('sqlDatabaseComputeTier'),'Hyperscale')]",
"sqlSkuCapacity": "[if(variables('isSqlHyperscaleTier'), 2, 50)]",
"sqlSkuFamily": "[if(variables('isSqlHyperscaleTier'), 'Gen5', '')]",
"sqlSkuName": "[if(variables('isSqlHyperscaleTier'), 'HS_Gen5', 'Standard')]",
"sqlSkuTier": "[if(variables('isSqlHyperscaleTier'), 'Hyperscale', 'Standard')]",
"keyVaultRoleName": "[concat('Key Vault Secrets Officer-', variables('serviceName'))]"
"keyVaultRoleName": "[concat('Key Vault Secrets Officer-', variables('serviceName'))]",
"imageRepositoryName": "[if(contains(parameters('registryName'),'mcr.'), concat(toLower(parameters('fhirVersion')), '-fhir-server'), concat(toLower(parameters('fhirVersion')), '_fhir-server'))]"
},
"resources": [
{
Expand Down Expand Up @@ -343,7 +338,7 @@
"appSettings": [
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "[concat('https://', variables('registryName'))]"
"value": "[concat('https://', parameters('registryName'))]"
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
Expand Down Expand Up @@ -392,7 +387,7 @@
"[if(variables('deployAppInsights'),concat('Microsoft.Insights/components/', variables('appInsightsName')),resourceId('Microsoft.KeyVault/vaults', variables('serviceName')))]"
],
"properties": {
"linuxFxVersion": "[concat('DOCKER|', variables('registryName'), '/', toLower(parameters('fhirVersion')), '_fhir-server',':', parameters('imageTag'))]",
"linuxFxVersion": "[concat('DOCKER|', parameters('registryName'), '/', variables('imageRepositoryName'),':', parameters('imageTag'))]",
"appCommandLine": "azure-fhir-api",
"alwaysOn": true,
"healthCheckPath": "/health/check"
Expand Down

0 comments on commit 4fc790f

Please sign in to comment.