From e249f3b0effd76ecb5fd62bbefdbc6fd01526f59 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Thu, 16 May 2019 20:13:39 -0400 Subject: [PATCH] Add support for private docker registry --- azuredeploy.json | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/azuredeploy.json b/azuredeploy.json index e9067d50..fe286a6b 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -90,6 +90,27 @@ "metadata": { "description": "The Docker image to deploy." } + }, + "dockerRegistry": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The registry of the Docker image." + } + }, + "dockerRegistryUserName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The user name for the Docker registry." + } + }, + "dockerRegistryPassword": { + "type": "securestring", + "defaultValue": "", + "metadata": { + "description": "The password for the Docker registry." + } } }, "variables": { @@ -102,7 +123,12 @@ "databaseServerName": "[concat(parameters('appName'),'-state')]", "setupScriptName": "[concat(parameters('appName'),'-setup')]", "appServicePlanName": "[concat(parameters('appName'),'-hosting')]", - "analyticsName": "[concat(parameters('appName'),'-analytics')]" + "analyticsName": "[concat(parameters('appName'),'-analytics')]", + "dockerRegistryCredential": { + "password": "[parameters('dockerRegistryPassword')]", + "username": "[parameters('dockerRegistryUserName')]", + "server": "[parameters('dockerRegistry')]" + } }, "resources": [ { @@ -182,6 +208,7 @@ "apiVersion": "2018-10-01", "location": "[variables('location')]", "properties": { + "imageRegistryCredentials": "[if(equals(parameters('dockerRegistry'), ''), json('null'), array(variables('dockerRegistryCredential')))]", "containers": [ { "name": "createadmin", @@ -244,6 +271,18 @@ "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", "value": "false" }, + { + "name": "DOCKER_REGISTRY_SERVER_URL", + "value": "[parameters('dockerRegistry')]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_USERNAME", + "value": "[parameters('dockerRegistryUserName')]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_PASSWORD", + "value": "[parameters('dockerRegistryPassword')]" + }, { "name": "AZURE_APPINSIGHTS_IKEY", "value": "[reference(resourceId('Microsoft.Insights/components', variables('analyticsName')), '2014-04-01').InstrumentationKey]"