From cf4d295e3b3eb0d7674d20f50942d9a9de1fc541 Mon Sep 17 00:00:00 2001 From: Eskil Uhlving Larsen <7443949+picccard@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:20:29 +0200 Subject: [PATCH 1/3] add parameter acrImageTag to functionApp and appService modules --- deploy/modules/appService.bicep | 5 ++++- deploy/modules/functionApp.bicep | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy/modules/appService.bicep b/deploy/modules/appService.bicep index ed24516..9b946bd 100644 --- a/deploy/modules/appService.bicep +++ b/deploy/modules/appService.bicep @@ -34,6 +34,9 @@ param workspaceId string @description('Flag to Deploy IPAM as a Container') param deployAsContainer bool = false +@description('IPAM Container Image Tag to use') +param acrImageTag string = 'latest' + @description('Flag to Deploy Private Container Registry') param privateAcr bool @@ -83,7 +86,7 @@ resource appService 'Microsoft.Web/sites@2021-02-01' = { acrUseManagedIdentityCreds: privateAcr ? true : false acrUserManagedIdentityID: privateAcr ? managedIdentityClientId : null alwaysOn: true - linuxFxVersion: deployAsContainer ? 'DOCKER|${acrUri}/ipam:latest' : 'PYTHON|${pythonVersion}' + linuxFxVersion: deployAsContainer ? 'DOCKER|${acrUri}/ipam:${acrImageTag}' : 'PYTHON|${pythonVersion}' appCommandLine: !deployAsContainer ? 'bash ./init.sh 8000' : null healthCheckPath: '/api/status' appSettings: concat( diff --git a/deploy/modules/functionApp.bicep b/deploy/modules/functionApp.bicep index 05650e9..834e583 100644 --- a/deploy/modules/functionApp.bicep +++ b/deploy/modules/functionApp.bicep @@ -37,6 +37,9 @@ param workspaceId string @description('Flag to Deploy IPAM as a Container') param deployAsContainer bool = false +@description('IPAM Container Image Tag to use') +param acrImageTag string = 'latest' + @description('Flag to Deploy Private Container Registry') param privateAcr bool @@ -87,7 +90,7 @@ resource functionApp 'Microsoft.Web/sites@2021-03-01' = { siteConfig: { acrUseManagedIdentityCreds: privateAcr ? true : false acrUserManagedIdentityID: privateAcr ? managedIdentityClientId : null - linuxFxVersion: deployAsContainer ? 'DOCKER|${acrUri}/ipamfunc:latest' : 'PYTHON|${pythonVersion}' + linuxFxVersion: deployAsContainer ? 'DOCKER|${acrUri}/ipamfunc:${acrImageTag}' : 'PYTHON|${pythonVersion}' healthCheckPath: '/api/status' appSettings: concat( [ From be10839f7b960d36305630fd30fb1ea54b9b01e8 Mon Sep 17 00:00:00 2001 From: Eskil Uhlving Larsen <7443949+picccard@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:21:03 +0200 Subject: [PATCH 2/3] add acrImageTag to main bicep --- deploy/main.bicep | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deploy/main.bicep b/deploy/main.bicep index fa29bb9..a2019b3 100644 --- a/deploy/main.bicep +++ b/deploy/main.bicep @@ -23,6 +23,9 @@ param deployAsFunc bool = false @description('Flag to Deploy IPAM as a Container') param deployAsContainer bool = false +@description('IPAM Container Image Tag to use') +param acrImageTag string = 'latest' + @description('IPAM-UI App Registration Client/App ID') param uiAppId string = '00000000-0000-0000-0000-000000000000' @@ -151,6 +154,7 @@ module appService './modules/appService.bicep' = if (!deployAsFunc) { managedIdentityClientId: managedIdentity.outputs.clientId workspaceId: logAnalyticsWorkspace.outputs.workspaceId deployAsContainer: deployAsContainer + acrImageTag: acrImageTag privateAcr: privateAcr privateAcrUri: privateAcr ? containerRegistry.outputs.acrUri : '' } @@ -174,6 +178,7 @@ module functionApp './modules/functionApp.bicep' = if (deployAsFunc) { storageAccountName: resourceNames.storageAccountName workspaceId: logAnalyticsWorkspace.outputs.workspaceId deployAsContainer: deployAsContainer + acrImageTag: acrImageTag privateAcr: privateAcr privateAcrUri: privateAcr ? containerRegistry.outputs.acrUri : '' } From 189507bedf703a90a87268052bd3f2d49f9e02f9 Mon Sep 17 00:00:00 2001 From: Eskil Uhlving Larsen <7443949+picccard@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:30:06 +0200 Subject: [PATCH 3/3] Update main.parameters.example.json --- deploy/main.parameters.example.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/main.parameters.example.json b/deploy/main.parameters.example.json index e475032..8604cde 100644 --- a/deploy/main.parameters.example.json +++ b/deploy/main.parameters.example.json @@ -26,6 +26,9 @@ "deployAsContainer": { "value": false }, + "acrImageTag": { + "value": "latest" + }, "privateAcr": { "value": false },