From b90f83a081f86e62d77f1d05926482f9fc424bb1 Mon Sep 17 00:00:00 2001 From: Yohan Lasorsa Date: Tue, 31 Oct 2023 17:30:07 +0100 Subject: [PATCH] chore(infra): detect CD (#102) --- infra/main.bicep | 12 +++++++----- infra/main.parameters.json | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/infra/main.bicep b/infra/main.bicep index 0a87b4ba..f92f2bf6 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -80,6 +80,8 @@ param allowedOrigin string // Only needed for CD due to internal policies restrictions param aliasTag string = '' +// Differentiates between automated and manual deployments +param isContinuousDeployment bool = false var abbrs = loadJsonContent('abbreviations.json') var resourceToken = toLower(uniqueString(subscription().id, environmentName, location)) @@ -371,7 +373,7 @@ module storage 'core/storage/storage-account.bicep' = { } // USER ROLES -module openAiRoleUser 'core/security/role.bicep' = { +module openAiRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) { scope: openAiResourceGroup name: 'openai-role-user' params: { @@ -382,7 +384,7 @@ module openAiRoleUser 'core/security/role.bicep' = { } } -module formRecognizerRoleUser 'core/security/role.bicep' = { +module formRecognizerRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) { scope: formRecognizerResourceGroup name: 'formrecognizer-role-user' params: { @@ -393,7 +395,7 @@ module formRecognizerRoleUser 'core/security/role.bicep' = { } } -module storageContribRoleUser 'core/security/role.bicep' = { +module storageContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) { scope: storageResourceGroup name: 'storage-contribrole-user' params: { @@ -404,7 +406,7 @@ module storageContribRoleUser 'core/security/role.bicep' = { } } -module searchContribRoleUser 'core/security/role.bicep' = { +module searchContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) { scope: searchServiceResourceGroup name: 'search-contrib-role-user' params: { @@ -415,7 +417,7 @@ module searchContribRoleUser 'core/security/role.bicep' = { } } -module searchSvcContribRoleUser 'core/security/role.bicep' = { +module searchSvcContribRoleUser 'core/security/role.bicep' = if (!isContinuousDeployment) { scope: searchServiceResourceGroup name: 'search-svccontrib-role-user' params: { diff --git a/infra/main.parameters.json b/infra/main.parameters.json index b600f4a3..c4ce31fb 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -79,6 +79,9 @@ }, "aliasTag": { "value": "${AZURE_ALIAS}" + }, + "isContinuousDeployment": { + "value": "${CI=false}" } } }