From ebb5391a395ac0bcc32a700a99e906c7a1dad09f Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Mon, 19 Feb 2024 17:12:47 +0000 Subject: [PATCH 001/105] init --- azure-pipelines.yml | 136 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 92f8fe457..a3f22a876 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,6 +533,142 @@ stages: scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - stage: Devdeploy2 + displayName: "Devdeploy2 for FSSUI ESS" + jobs: + - deployment: DevDeployApp2 + displayName: "Dev2 - deploy terraform and dotnet App" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev2-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - stage: QCdeploy dependsOn: - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH From 28177272a01e47e828bc865ae9a45f9634fef0b6 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 21 Feb 2024 18:20:45 +0530 Subject: [PATCH 002/105] added suffix variable for new infra --- Deployment/src/Modules/FulfilmentKeyVault/variables.tf | 4 ++++ Deployment/src/main.tf | 7 ++++--- Deployment/src/resource-group.tf | 2 +- Deployment/src/variables.tf | 8 ++++++-- Deployment/terraform_conditional_run.ps1 | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Deployment/src/Modules/FulfilmentKeyVault/variables.tf b/Deployment/src/Modules/FulfilmentKeyVault/variables.tf index 084cf3a27..fd576ac7e 100644 --- a/Deployment/src/Modules/FulfilmentKeyVault/variables.tf +++ b/Deployment/src/Modules/FulfilmentKeyVault/variables.tf @@ -53,4 +53,8 @@ variable "large_exchange_set_secrets" { variable "agent_subnet" { type = string +} + +variable "suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 8f4b31f92..ca1e6cbc7 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -42,7 +42,7 @@ module "user_identity" { module "app_insights" { source = "./Modules/AppInsights" - name = "${local.service_name}-${local.env_name}-insights" + name = "${local.service_name}-${local.env_name}-insights${var.suffix}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location tags = local.tags @@ -50,7 +50,7 @@ module "app_insights" { module "eventhub" { source = "./Modules/EventHub" - name = "${local.service_name}-${local.env_name}-events" + name = "${local.service_name}-${local.env_name}-events${var.suffix}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location logstashStorageName = lower("${local.service_name}logstash${local.env_name}") @@ -166,6 +166,7 @@ module "fulfilment_keyvaults" { service_name = local.service_name resource_group_name = azurerm_resource_group.rg.name env_name = local.env_name + suffix = ${var.suffix} tenant_id = module.user_identity.ess_service_identity_tenant_id location = azurerm_resource_group.rg.location allowed_ips = var.allowed_ips @@ -209,7 +210,7 @@ module "fulfilment_keyvaults" { module "azure-dashboard" { source = "./Modules/azuredashboard" - name = "ESS-${local.env_name}-Monitoring-Dashboard" + name = "ESS-${local.env_name}-Monitoring-Dashboard${var.suffix}" location = azurerm_resource_group.rg.location environment = local.env_name resource_group = azurerm_resource_group.rg diff --git a/Deployment/src/resource-group.tf b/Deployment/src/resource-group.tf index 2a9f14afb..f054a0339 100644 --- a/Deployment/src/resource-group.tf +++ b/Deployment/src/resource-group.tf @@ -1,5 +1,5 @@ resource "azurerm_resource_group" "rg" { - name = "${var.resource_group_name}-${local.env_name}-rg" + name = "${var.resource_group_name}-${local.env_name}-rg${var.suffix}" location = var.location tags = local.tags } \ No newline at end of file diff --git a/Deployment/src/variables.tf b/Deployment/src/variables.tf index bf462f2b8..3daf8875b 100644 --- a/Deployment/src/variables.tf +++ b/Deployment/src/variables.tf @@ -11,8 +11,8 @@ variable "resource_group_name" { locals { env_name = lower(terraform.workspace) service_name = "ess" -web_app_name = "${local.service_name}-${local.env_name}-webapp" - key_vault_name = "${local.service_name}-ukho-${local.env_name}-kv" + web_app_name = "${local.service_name}-${local.env_name}-webapp${var.suffix}" + key_vault_name = "${local.service_name}-ukho-${local.env_name}-kv${var.suffix}" tags = { SERVICE = "Exchange Set Service" ENVIRONMENT = local.env_name @@ -86,4 +86,8 @@ variable "elastic_apm_server_url" { } variable "elastic_apm_api_key" { +} + +variable "suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 72175a7ee..c3b9d4e10 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.tfplan" +#terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" From e82409ec354ac7f1634306fafb55b94794047fdc Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 22 Feb 2024 15:01:25 +0530 Subject: [PATCH 003/105] updated tf files --- Deployment/src/Modules/EventHub/main.tf | 8 ++++---- Deployment/src/Modules/EventHub/variables.tf | 4 ++++ Deployment/src/Modules/UserIdentity/main.tf | 2 +- Deployment/src/Modules/UserIdentity/variables.tf | 4 ++++ Deployment/src/main.tf | 4 +++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Deployment/src/Modules/EventHub/main.tf b/Deployment/src/Modules/EventHub/main.tf index 24cdb5278..79d4448b7 100644 --- a/Deployment/src/Modules/EventHub/main.tf +++ b/Deployment/src/Modules/EventHub/main.tf @@ -16,21 +16,21 @@ resource "azurerm_eventhub" "eventhub" { } resource "azurerm_eventhub_consumer_group" "logstash_consumer_group" { - name = "logstash" + name = "logstash${var.suffix}" namespace_name = azurerm_eventhub_namespace.eventhub_namespace.name eventhub_name = azurerm_eventhub.eventhub.name resource_group_name = var.resource_group_name } resource "azurerm_eventhub_consumer_group" "logging_application_consumer_group" { - name = "loggingApplication" + name = "loggingApplication${var.suffix}" namespace_name = azurerm_eventhub_namespace.eventhub_namespace.name eventhub_name = azurerm_eventhub.eventhub.name resource_group_name = var.resource_group_name } resource "azurerm_eventhub_authorization_rule" "logstash" { - name = "logstashAccessKey" + name = "logstashAccessKey${var.suffix}" namespace_name = azurerm_eventhub_namespace.eventhub_namespace.name eventhub_name = azurerm_eventhub.eventhub.name resource_group_name = var.resource_group_name @@ -40,7 +40,7 @@ resource "azurerm_eventhub_authorization_rule" "logstash" { } resource "azurerm_eventhub_authorization_rule" "log" { - name = "logAccessKey" + name = "logAccessKey${var.suffix}" namespace_name = azurerm_eventhub_namespace.eventhub_namespace.name eventhub_name = azurerm_eventhub.eventhub.name resource_group_name = var.resource_group_name diff --git a/Deployment/src/Modules/EventHub/variables.tf b/Deployment/src/Modules/EventHub/variables.tf index 7b088859a..aa1caea09 100644 --- a/Deployment/src/Modules/EventHub/variables.tf +++ b/Deployment/src/Modules/EventHub/variables.tf @@ -29,3 +29,7 @@ variable "allowed_ips" { variable "tags" { } + +variable "suffix" { + default = "" +} diff --git a/Deployment/src/Modules/UserIdentity/main.tf b/Deployment/src/Modules/UserIdentity/main.tf index 30df62416..b7a0ed359 100644 --- a/Deployment/src/Modules/UserIdentity/main.tf +++ b/Deployment/src/Modules/UserIdentity/main.tf @@ -1,6 +1,6 @@ resource "azurerm_user_assigned_identity" "ess_service_identity" { resource_group_name = var.resource_group_name location = var.location - name = "ess-${var.env_name}-service-identity" + name = "ess-${var.env_name}-service-identity${var.suffix}" tags = var.tags } \ No newline at end of file diff --git a/Deployment/src/Modules/UserIdentity/variables.tf b/Deployment/src/Modules/UserIdentity/variables.tf index 4fc3fe1db..2daa1bd92 100644 --- a/Deployment/src/Modules/UserIdentity/variables.tf +++ b/Deployment/src/Modules/UserIdentity/variables.tf @@ -12,4 +12,8 @@ variable "env_name" { variable "tags" { +} + +variable "suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index ca1e6cbc7..e779cce13 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -36,6 +36,7 @@ module "user_identity" { source = "./Modules/UserIdentity" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location + suffix = ${var.suffix} env_name = local.env_name tags = local.tags } @@ -53,7 +54,8 @@ module "eventhub" { name = "${local.service_name}-${local.env_name}-events${var.suffix}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - logstashStorageName = lower("${local.service_name}logstash${local.env_name}") + logstashStorageName = lower("${local.service_name}logstash${local.env_name}${var.suffix}") + suffix = ${var.suffix} m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id allowed_ips = var.allowed_ips From 94acdf236ad686fd039cc9d6d2e6cfffbd8a60e6 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 22 Feb 2024 15:34:08 +0530 Subject: [PATCH 004/105] updated tf files --- Deployment/src/Modules/CacheStorage/main.tf | 2 +- .../src/Modules/CacheStorage/variables.tf | 6 +- .../src/Modules/FulfilmentKeyVault/main.tf | 6 +- .../src/Modules/FulfilmentStorage/main.tf | 6 +- .../Modules/FulfilmentStorage/variables.tf | 4 + .../src/Modules/FulfilmentWebapps/main.tf | 12 +- .../Modules/FulfilmentWebapps/variables.tf | 4 + Deployment/src/main.tf | 3 + .../templates/continuous-deployment.yml | 122 +- Deployment/terraform_conditional_run.ps1 | 2 +- azure-pipelines.yml | 1644 ++++++++--------- 11 files changed, 913 insertions(+), 898 deletions(-) diff --git a/Deployment/src/Modules/CacheStorage/main.tf b/Deployment/src/Modules/CacheStorage/main.tf index a50515b7c..937cc01ae 100644 --- a/Deployment/src/Modules/CacheStorage/main.tf +++ b/Deployment/src/Modules/CacheStorage/main.tf @@ -1,5 +1,5 @@ resource "azurerm_storage_account" "ess_cache_storage" { - name = lower("${var.service_name}${var.env_name}cachestorageukho") + name = lower("${var.service_name}${var.env_name}cachestorageukho${var.suffix}") resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" diff --git a/Deployment/src/Modules/CacheStorage/variables.tf b/Deployment/src/Modules/CacheStorage/variables.tf index cc57374ce..e3a681bc3 100644 --- a/Deployment/src/Modules/CacheStorage/variables.tf +++ b/Deployment/src/Modules/CacheStorage/variables.tf @@ -36,4 +36,8 @@ variable "medium_exchange_set_subnets" { } variable "large_exchange_set_subnets" { -} \ No newline at end of file +} + +variable "suffix" { + default = "" +} \ No newline at end of file diff --git a/Deployment/src/Modules/FulfilmentKeyVault/main.tf b/Deployment/src/Modules/FulfilmentKeyVault/main.tf index 23e173b96..02c5bf3d7 100644 --- a/Deployment/src/Modules/FulfilmentKeyVault/main.tf +++ b/Deployment/src/Modules/FulfilmentKeyVault/main.tf @@ -1,7 +1,7 @@ data "azurerm_client_config" "current" {} resource "azurerm_key_vault" "small_exchange_set_kv" { - name = lower("${var.service_name}-ukho-${var.env_name}-sxs-kv") + name = lower("${var.service_name}-ukho-${var.env_name}-sxs-kv${var.suffix}") location = var.location resource_group_name = var.resource_group_name enabled_for_disk_encryption = true @@ -69,7 +69,7 @@ resource "azurerm_key_vault_secret" "small_exchange_set_passed_in_secrets" { #Medium exchange set resource "azurerm_key_vault" "medium_exchange_set_kv" { - name = lower("${var.service_name}-ukho-${var.env_name}-mxs-kv") + name = lower("${var.service_name}-ukho-${var.env_name}-mxs-kv${var.suffix}") location = var.location resource_group_name = var.resource_group_name enabled_for_disk_encryption = true @@ -136,7 +136,7 @@ resource "azurerm_key_vault_secret" "medium_exchange_set_passed_in_secrets" { #Large exchange set resource "azurerm_key_vault" "large_exchange_set_kv" { - name = lower("${var.service_name}-ukho-${var.env_name}-lxs-kv") + name = lower("${var.service_name}-ukho-${var.env_name}-lxs-kv${var.suffix}") location = var.location resource_group_name = var.resource_group_name enabled_for_disk_encryption = true diff --git a/Deployment/src/Modules/FulfilmentStorage/main.tf b/Deployment/src/Modules/FulfilmentStorage/main.tf index 03d59fce2..8d19aa01f 100644 --- a/Deployment/src/Modules/FulfilmentStorage/main.tf +++ b/Deployment/src/Modules/FulfilmentStorage/main.tf @@ -1,5 +1,5 @@ resource "azurerm_storage_account" "small_exchange_set_storage" { - name = lower("${var.service_name}${var.env_name}sxsstorageukho") + name = lower("${var.service_name}${var.env_name}sxsstorageukho${var.suffix}") resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" @@ -30,7 +30,7 @@ resource "azurerm_storage_queue" "small_exchange_set_storage_queue" { #Medium exchange set storage resource "azurerm_storage_account" "medium_exchange_set_storage" { - name = lower("${var.service_name}${var.env_name}mxsstorageukho") + name = lower("${var.service_name}${var.env_name}mxsstorageukho${var.suffix}") resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" @@ -61,7 +61,7 @@ resource "azurerm_storage_queue" "medium_exchange_set_storage_queue" { #Large exchange set storage resource "azurerm_storage_account" "large_exchange_set_storage" { - name = lower("${var.service_name}${var.env_name}lxsstorageukho") + name = lower("${var.service_name}${var.env_name}lxsstorageukho${var.suffix}") resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" diff --git a/Deployment/src/Modules/FulfilmentStorage/variables.tf b/Deployment/src/Modules/FulfilmentStorage/variables.tf index b14b46932..040ca78fb 100644 --- a/Deployment/src/Modules/FulfilmentStorage/variables.tf +++ b/Deployment/src/Modules/FulfilmentStorage/variables.tf @@ -41,4 +41,8 @@ variable "large_exchange_set_subnets" { variable "agent_subnet" { type = string +} + +variable "suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/src/Modules/FulfilmentWebapps/main.tf b/Deployment/src/Modules/FulfilmentWebapps/main.tf index 82d8b406a..4214accf5 100644 --- a/Deployment/src/Modules/FulfilmentWebapps/main.tf +++ b/Deployment/src/Modules/FulfilmentWebapps/main.tf @@ -1,6 +1,6 @@ resource "azurerm_app_service_plan" "small_exchange_set_app_service_plan" { count = var.exchange_set_config.SmallExchangeSetInstance - name = "${local.small_exchange_set_name}-${sum([1,count.index])}-asp" + name = "${local.small_exchange_set_name}-${sum([1,count.index])}-asp${var.suffix}" location = var.location resource_group_name = var.resource_group_name @@ -13,7 +13,7 @@ resource "azurerm_app_service_plan" "small_exchange_set_app_service_plan" { resource "azurerm_app_service" "small_exchange_set_webapp" { count = var.exchange_set_config.SmallExchangeSetInstance - name = "${local.small_exchange_set_name}-${sum([1,count.index])}-webapp" + name = "${local.small_exchange_set_name}-${sum([1,count.index])}-webapp${var.suffix}" location = var.location resource_group_name = var.resource_group_name app_service_plan_id = azurerm_app_service_plan.small_exchange_set_app_service_plan[count.index].id @@ -84,7 +84,7 @@ resource "azurerm_app_service_slot_virtual_network_swift_connection" "small_exch #Medium exchange set resource "azurerm_app_service_plan" "medium_exchange_set_app_service_plan" { count = var.exchange_set_config.MediumExchangeSetInstance - name = "${local.medium_exchange_set_name}-${sum([1,count.index])}-asp" + name = "${local.medium_exchange_set_name}-${sum([1,count.index])}-asp${var.suffix}" location = var.location resource_group_name = var.resource_group_name @@ -97,7 +97,7 @@ resource "azurerm_app_service_plan" "medium_exchange_set_app_service_plan" { resource "azurerm_app_service" "medium_exchange_set_webapp" { count = var.exchange_set_config.MediumExchangeSetInstance - name = "${local.medium_exchange_set_name}-${sum([1,count.index])}-webapp" + name = "${local.medium_exchange_set_name}-${sum([1,count.index])}-webapp${var.suffix}" location = var.location resource_group_name = var.resource_group_name app_service_plan_id = azurerm_app_service_plan.medium_exchange_set_app_service_plan[count.index].id @@ -168,7 +168,7 @@ resource "azurerm_app_service_slot_virtual_network_swift_connection" "medium_exc #Large exchange set resource "azurerm_app_service_plan" "large_exchange_set_app_service_plan" { count = var.exchange_set_config.LargeExchangeSetInstance - name = "${local.large_exchange_set_name}-${sum([1,count.index])}-asp" + name = "${local.large_exchange_set_name}-${sum([1,count.index])}-asp${var.suffix}" location = var.location resource_group_name = var.resource_group_name @@ -181,7 +181,7 @@ resource "azurerm_app_service_plan" "large_exchange_set_app_service_plan" { resource "azurerm_app_service" "large_exchange_set_webapp" { count = var.exchange_set_config.LargeExchangeSetInstance - name = "${local.large_exchange_set_name}-${sum([1,count.index])}-webapp" + name = "${local.large_exchange_set_name}-${sum([1,count.index])}-webapp${var.suffix}" location = var.location resource_group_name = var.resource_group_name app_service_plan_id = azurerm_app_service_plan.large_exchange_set_app_service_plan[count.index].id diff --git a/Deployment/src/Modules/FulfilmentWebapps/variables.tf b/Deployment/src/Modules/FulfilmentWebapps/variables.tf index f3e53be43..07a52b246 100644 --- a/Deployment/src/Modules/FulfilmentWebapps/variables.tf +++ b/Deployment/src/Modules/FulfilmentWebapps/variables.tf @@ -48,4 +48,8 @@ locals { small_exchange_set_name = "${var.service_name}-${var.env_name}-sxs" medium_exchange_set_name = "${var.service_name}-${var.env_name}-mxs" large_exchange_set_name = "${var.service_name}-${var.env_name}-lxs" +} + +variable "suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index e779cce13..96d6c5f96 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -91,6 +91,7 @@ module "fulfilment_webapp" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id + suffix = ${var.suffix} exchange_set_config = local.config_data.ESSFulfilmentConfiguration env_name = local.env_name service_name = local.service_name @@ -121,6 +122,7 @@ module "fulfilment_storage" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id + suffix = ${var.suffix} m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id exchange_set_config = local.config_data.ESSFulfilmentConfiguration @@ -231,4 +233,5 @@ module "cache_storage" { agent_subnet = data.azurerm_subnet.agent_subnet.id env_name = local.env_name service_name = local.service_name + suffix = ${var.suffix} } \ No newline at end of file diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 5b98816ef..572e7fea4 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - - task: FileTransform@2 - displayName: "File Transform: WebJob" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: WebJob" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureCLI@2 - displayName: "Azure Fulfilment Webjob Deployment" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + # - task: AzureCLI@2 + # displayName: "Azure Fulfilment Webjob Deployment" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - - task: FileTransform@2 - displayName: "File Transform: WebAppSettings" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: WebAppSettings" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureWebApp@1 - displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - appType: webApp - appName: "$(WEB_APP_NAME)" - package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - deployToSlotOrASE: true - slotName: $(WEB_APP_SLOT_NAME) + # - task: AzureWebApp@1 + # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # appType: webApp + # appName: "$(WEB_APP_NAME)" + # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + # deployToSlotOrASE: true + # slotName: $(WEB_APP_SLOT_NAME) - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot" - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + # - task: PowerShell@2 + # displayName: "Check the status of production slot" + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot - Rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot - Rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot after rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + # - task: PowerShell@2 + # displayName: "Check the status of production slot after rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index c3b9d4e10..5d38feac3 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a3f22a876..7c23d558f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -440,816 +440,55 @@ stages: ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - stage: Devdeploy2 - displayName: "Devdeploy2 for FSSUI ESS" - jobs: - - deployment: DevDeployApp2 - displayName: "Dev2 - deploy terraform and dotnet App" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev2-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - stage: QCdeploy - dependsOn: - - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH - displayName: "QCdeploy (inc terraform, mock webapp deploy)" - jobs: - - deployment: QCDeployApp - displayName: "QC - deploy terraform and WebApps" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - #This variables are overridden since they are different from dev and we have used same library - - name: "Environment" - value: "qc" - - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" - value: 1 - - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" - value: 1 - - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" - value: 1 - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml - parameters: - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=QCOnlyTest-AIOEnabled' - testRunTitle: "QC-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=QCOnlyTest-AIODisabled' - testRunTitle: "QC-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - - stage: QAdeploy - dependsOn: - - Devdeploy - - QCdeploy - displayName: QAdeploy (inc terraform, webapp deploy) - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - jobs: - - deployment: QADeployApp - displayName: QA - deploy terraform and dotnet App - environment: "Ess-Qa" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-QA" - - group: "ESS-QA-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-QA-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - job: Run_ADDS_E2E_tests - displayName: Run ADDS E2E tests - dependsOn: QADeployApp - pool: $(DeploymentPool) - variables: - - group: "ADDS-E2E" - container: ${{variables.Container}} - steps: - - task: PowerShell@2 - displayName: "Run ADDS E2E pipeline tests" - inputs: - pwsh: true - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' - arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' - - - stage: Livedeploy - dependsOn: - - QAdeploy - displayName: Livedeploy (inc terraform, webapp deploy) - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - jobs: - - deployment: LiveDeployApp - displayName: Live - deploy terraform and dotnet App - environment: "Ess-Live" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-LIVE" - - group: "ESS-Live-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - strategy: - runOnce: - deploy: - steps: - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Live-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "UKHO-APIM-Live" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - job: PostDeploymentActions - dependsOn: - - LiveDeployApp - pool: $(WindowPool) - displayName: Post Deployment Actions - steps: - - template: Deployment/templates/retain-pipeline.yml - - - stage: vnextiatDeploy - dependsOn: - - Devdeploy - displayName: vNext IAT Deploy (inc terraform, webapp deploy) - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) - jobs: - - deployment: vnextiatDeploy - displayName: VnexT IAT - deploy terraform and dotnet App - environment: "Ess-vnextiat" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-vNextIAT" - - group: "ESS-vNextIAT-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET Core $(SdkVersion) sdk' - inputs: - packageType: sdk - version: $(SdkVersion) - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - job: Run_ADDS_E2E_tests - # displayName: Run ADDS E2E tests - # dependsOn: vnextiatDeploy - # pool: $(DeploymentPool) - # variables: - # - group: "ADDS-E2E" - # container: ${{variables.Container}} - # steps: - # - task: PowerShell@2 - # displayName: "Run ADDS E2E pipeline tests" - # inputs: - # pwsh: true - # targetType: filePath - # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' - # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' - - - stage: vnexte2eDeploy - dependsOn: - - vnextiatDeploy - displayName: vNext E2E Deploy (inc terraform, webapp deploy) - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) - jobs: - - deployment: E2EDeploy - displayName: vnexte2e - deploy terraform and dotnet App - environment: "Ess-vnexte2e" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-vNextE2E" - - group: "ESS-vNextE2E-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET Core $(SdkVersion) sdk' - inputs: - packageType: sdk - version: $(SdkVersion) - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' # - task: DotNetCoreCLI@2 # displayName: "Run Functional tests AIOEnabled" @@ -1260,17 +499,17 @@ stages: # !**/*TestAdapter.dll # !**/obj/** # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "QA-AutomationTests" + # testRunTitle: "Dev-AutomationTests" # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' # - task: DotNetCoreCLI@2 # displayName: "Run Functional tests AIODisabled" @@ -1281,15 +520,776 @@ stages: # !**/*TestAdapter.dll # !**/obj/** # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "QA-AutomationTests" + # testRunTitle: "Dev-AutomationTests" # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - stage: Devdeploy2 + # displayName: "Devdeploy2 for FSSUI ESS" + # jobs: + # - deployment: DevDeployApp2 + # displayName: "Dev2 - deploy terraform and dotnet App" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev2-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - stage: QCdeploy + # dependsOn: + # - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH + # displayName: "QCdeploy (inc terraform, mock webapp deploy)" + # jobs: + # - deployment: QCDeployApp + # displayName: "QC - deploy terraform and WebApps" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # #This variables are overridden since they are different from dev and we have used same library + # - name: "Environment" + # value: "qc" + # - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" + # value: 1 + # - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" + # value: 1 + # - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" + # value: 1 + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml + # parameters: + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=QCOnlyTest-AIOEnabled' + # testRunTitle: "QC-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=QCOnlyTest-AIODisabled' + # testRunTitle: "QC-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + # - stage: QAdeploy + # dependsOn: + # - Devdeploy + # - QCdeploy + # displayName: QAdeploy (inc terraform, webapp deploy) + # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + # jobs: + # - deployment: QADeployApp + # displayName: QA - deploy terraform and dotnet App + # environment: "Ess-Qa" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-QA" + # - group: "ESS-QA-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-QA-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - job: Run_ADDS_E2E_tests + # displayName: Run ADDS E2E tests + # dependsOn: QADeployApp + # pool: $(DeploymentPool) + # variables: + # - group: "ADDS-E2E" + # container: ${{variables.Container}} + # steps: + # - task: PowerShell@2 + # displayName: "Run ADDS E2E pipeline tests" + # inputs: + # pwsh: true + # targetType: filePath + # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' + # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' + + # - stage: Livedeploy + # dependsOn: + # - QAdeploy + # displayName: Livedeploy (inc terraform, webapp deploy) + # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + # jobs: + # - deployment: LiveDeployApp + # displayName: Live - deploy terraform and dotnet App + # environment: "Ess-Live" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-LIVE" + # - group: "ESS-Live-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # strategy: + # runOnce: + # deploy: + # steps: + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Live-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "UKHO-APIM-Live" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - job: PostDeploymentActions + # dependsOn: + # - LiveDeployApp + # pool: $(WindowPool) + # displayName: Post Deployment Actions + # steps: + # - template: Deployment/templates/retain-pipeline.yml + + # - stage: vnextiatDeploy + # dependsOn: + # - Devdeploy + # displayName: vNext IAT Deploy (inc terraform, webapp deploy) + # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) + # jobs: + # - deployment: vnextiatDeploy + # displayName: VnexT IAT - deploy terraform and dotnet App + # environment: "Ess-vnextiat" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-vNextIAT" + # - group: "ESS-vNextIAT-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET Core $(SdkVersion) sdk' + # inputs: + # packageType: sdk + # version: $(SdkVersion) + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIOEnabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIOEnabled' + # # testRunTitle: "QA-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIODisabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIODisabled' + # # testRunTitle: "QA-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - job: Run_ADDS_E2E_tests + # # displayName: Run ADDS E2E tests + # # dependsOn: vnextiatDeploy + # # pool: $(DeploymentPool) + # # variables: + # # - group: "ADDS-E2E" + # # container: ${{variables.Container}} + # # steps: + # # - task: PowerShell@2 + # # displayName: "Run ADDS E2E pipeline tests" + # # inputs: + # # pwsh: true + # # targetType: filePath + # # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' + # # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' + + # - stage: vnexte2eDeploy + # dependsOn: + # - vnextiatDeploy + # displayName: vNext E2E Deploy (inc terraform, webapp deploy) + # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) + # jobs: + # - deployment: E2EDeploy + # displayName: vnexte2e - deploy terraform and dotnet App + # environment: "Ess-vnexte2e" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-vNextE2E" + # - group: "ESS-vNextE2E-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET Core $(SdkVersion) sdk' + # inputs: + # packageType: sdk + # version: $(SdkVersion) + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIOEnabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIOEnabled' + # # testRunTitle: "QA-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIODisabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIODisabled' + # # testRunTitle: "QA-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' From 0769a4cd1a9386cab2be713eb2996fae1376202d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 22 Feb 2024 15:50:02 +0530 Subject: [PATCH 005/105] updated variable --- Deployment/src/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 96d6c5f96..c7cf6e0ee 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -36,7 +36,7 @@ module "user_identity" { source = "./Modules/UserIdentity" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - suffix = ${var.suffix} + suffix = var.suffix env_name = local.env_name tags = local.tags } @@ -55,7 +55,7 @@ module "eventhub" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location logstashStorageName = lower("${local.service_name}logstash${local.env_name}${var.suffix}") - suffix = ${var.suffix} + suffix = var.suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id allowed_ips = var.allowed_ips @@ -170,7 +170,7 @@ module "fulfilment_keyvaults" { service_name = local.service_name resource_group_name = azurerm_resource_group.rg.name env_name = local.env_name - suffix = ${var.suffix} + suffix = var.suffix tenant_id = module.user_identity.ess_service_identity_tenant_id location = azurerm_resource_group.rg.location allowed_ips = var.allowed_ips From 842dfe30793e7094845fb92276f4ad9464b5198d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 22 Feb 2024 16:02:29 +0530 Subject: [PATCH 006/105] updated variable --- Deployment/src/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index c7cf6e0ee..226b6e023 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -91,7 +91,7 @@ module "fulfilment_webapp" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id - suffix = ${var.suffix} + suffix = var.suffix exchange_set_config = local.config_data.ESSFulfilmentConfiguration env_name = local.env_name service_name = local.service_name @@ -122,7 +122,7 @@ module "fulfilment_storage" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id - suffix = ${var.suffix} + suffix = var.suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id exchange_set_config = local.config_data.ESSFulfilmentConfiguration @@ -233,5 +233,5 @@ module "cache_storage" { agent_subnet = data.azurerm_subnet.agent_subnet.id env_name = local.env_name service_name = local.service_name - suffix = ${var.suffix} + suffix = var.suffix } \ No newline at end of file From cf626f803b322409d81026a0eff6c0cfa6f9d93c Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 15:06:39 +0530 Subject: [PATCH 007/105] added v2 changes --- Deployment/src/azure.tf | 2 +- .../templates/continuous-deployment.yml | 20 ++++++ Deployment/terraform_conditional_run_v2.ps1 | 65 +++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Deployment/terraform_conditional_run_v2.ps1 diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index e8d886fb1..7f4219012 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - key = "terraform.deployment.tfplan" + # key = "terraform.deployment.tfplan" } } diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 572e7fea4..d48e7001e 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -102,3 +102,23 @@ steps: # targetType: filePath # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + + - task: PowerShell@2 + displayName: "terraform devdeploy for Version2" + inputs: + targetType: filePath + filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run_v2.ps1' + arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' + env: + ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) + ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) + ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) + ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) + TF_VAR_allowed_ips: $(whiteListedIps) + TF_VAR_spoke_rg: $(spokeRG) + TF_VAR_spoke_vnet_name: $(spokeVnetName) + TF_VAR_spoke_subnet_name: $(spokeSubnetName) + TF_VAR_agent_rg: $(agentRG) + TF_VAR_agent_vnet_name: $(agentVnetName) + TF_VAR_agent_subnet_name: $(agentSubnetName) + TF_VAR_agent_subscription_id: $(agentSubscriptionId) diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 new file mode 100644 index 000000000..083026011 --- /dev/null +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -0,0 +1,65 @@ +param ( + [Parameter(Mandatory = $true)] [string] $deploymentResourceGroupName, + [Parameter(Mandatory = $true)] [string] $deploymentStorageAccountName, + [Parameter(Mandatory = $true)] [string] $workSpace, + [Parameter(Mandatory = $true)] [boolean] $continueEvenIfResourcesAreGettingDestroyed, + [Parameter(Mandatory = $true)] [string] $terraformJsonOutputFile, + [Parameter(Mandatory = $true)] [string] $elasticApmServerUrl, + [Parameter(Mandatory = $true)] [string] $elasticApmApiKey +) + +cd $env:AGENT_BUILDDIRECTORY/terraformartifact/src + +Write-output "Executing terraform scripts for deployment in $workSpace enviroment" +terraform init -backend-config="resource_group_name=$deploymentResourceGroupName" -backend-config="storage_account_name=$deploymentStorageAccountName" -backend-config="key=terraform.deployment.v2.tfplan" +if ( !$? ) { echo "Something went wrong during terraform initialization"; throw "Error" } + +Write-output "Selecting workspace" + +$ErrorActionPreference = 'SilentlyContinue' +terraform workspace new $WorkSpace 2>&1 > $null +$ErrorActionPreference = 'Continue' + +terraform workspace select $workSpace +if ( !$? ) { echo "Error while selecting workspace"; throw "Error" } + +Write-output "Validating terraform" +terraform validate +if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } + +Write-output "Execute Terraform plan" +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" | tee terraform_output.txt +if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } + +$totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length +if($totalDestroyLines -ge 2) +{ + write-Host("Terraform is destroying some resources, please verify...................") + if ( !$ContinueEvenIfResourcesAreGettingDestroyed) + { + write-Host("exiting...................") + Write-Output $_ + exit 1 + } + write-host("Continue executing terraform apply - as continueEvenIfResourcesAreGettingDestroyed param is set to true in pipeline") +} + +Write-output "Executing terraform apply" +#terraform apply "terraform.deployment.tfplan" +if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } + +Write-output "Terraform output as json" +$terraformOutput = terraform output -json | ConvertFrom-Json + +write-output "Set JSON output into pipeline variables" +Write-Host "##vso[task.setvariable variable=WEB_APP_NAME]$($terraformOutput.web_app_name.value)" +Write-Host "##vso[task.setvariable variable=EssApiUrl]$env:SERVICE_DNS_URL" +Write-Host "##vso[task.setvariable variable=KeyVaultSettings.ServiceUri]$($terraformOutput.keyvault_uri.value)" +Write-Host "##vso[task.setvariable variable=EssStorageAccountConnectionString;issecret=true]$($terraformOutput.storage_connection_string.value)" +Write-Host "##vso[task.setvariable variable=ESSManagedIdentity.ClientId]$($terraformOutput.ess_managed_user_identity_client_id.value)" +Write-Host "##vso[task.setvariable variable=RESOURCE_GROUP_NAME]$($terraformOutput.web_app_resource_group.value)" +Write-Host "##vso[task.setvariable variable=WEB_APP_SLOT_NAME]$($terraformOutput.web_app_slot_name.value)" +Write-Host "##vso[task.setvariable variable=WEB_APP_SLOT_HOST_NAME]$($terraformOutput.web_app_slot_default_site_hostname.value)" + + +$terraformOutput | ConvertTo-Json -Depth 5 > $terraformJsonOutputFile \ No newline at end of file From 3603a961664ce51c8c9278c24656a159a97aec9a Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 18:13:34 +0530 Subject: [PATCH 008/105] updated tfplan file --- Deployment/src/azure.tf | 2 +- .../templates/continuous-deployment.yml | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index 7f4219012..25c4e3f9f 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - # key = "terraform.deployment.tfplan" + key = "terraform.deployment.v2.tfplan" } } diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index d48e7001e..61644e5ea 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -13,25 +13,25 @@ steps: xmlTransformationRules: jsonTargetFiles: '**/appsettings.json' - - task: PowerShell@2 - displayName: "terraform devdeploy" - inputs: - targetType: filePath - filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run.ps1' - arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' - env: - ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) - ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) - ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) - ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) - TF_VAR_allowed_ips: $(whiteListedIps) - TF_VAR_spoke_rg: $(spokeRG) - TF_VAR_spoke_vnet_name: $(spokeVnetName) - TF_VAR_spoke_subnet_name: $(spokeSubnetName) - TF_VAR_agent_rg: $(agentRG) - TF_VAR_agent_vnet_name: $(agentVnetName) - TF_VAR_agent_subnet_name: $(agentSubnetName) - TF_VAR_agent_subscription_id: $(agentSubscriptionId) + # - task: PowerShell@2 + # displayName: "terraform devdeploy" + # inputs: + # targetType: filePath + # filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run.ps1' + # arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' + # env: + # ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) + # ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) + # ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) + # ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) + # TF_VAR_allowed_ips: $(whiteListedIps) + # TF_VAR_spoke_rg: $(spokeRG) + # TF_VAR_spoke_vnet_name: $(spokeVnetName) + # TF_VAR_spoke_subnet_name: $(spokeSubnetName) + # TF_VAR_agent_rg: $(agentRG) + # TF_VAR_agent_vnet_name: $(agentVnetName) + # TF_VAR_agent_subnet_name: $(agentSubnetName) + # TF_VAR_agent_subscription_id: $(agentSubscriptionId) # - task: FileTransform@2 # displayName: "File Transform: WebJob" From f397f478f41d8eb5985eed53a608ba1dc60663d3 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 18:23:21 +0530 Subject: [PATCH 009/105] updated variable --- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 083026011..c525148c2 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 72725103f63d2fadbb9dbf50dd94590f2bbe8c6d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 21:54:57 +0530 Subject: [PATCH 010/105] updated suffix code for storage --- Deployment/src/main.tf | 4 ++-- Deployment/src/variables.tf | 4 ++++ Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 226b6e023..07c762f9b 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -122,7 +122,7 @@ module "fulfilment_storage" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id - suffix = var.suffix + suffix = var.storage_suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id exchange_set_config = local.config_data.ESSFulfilmentConfiguration @@ -233,5 +233,5 @@ module "cache_storage" { agent_subnet = data.azurerm_subnet.agent_subnet.id env_name = local.env_name service_name = local.service_name - suffix = var.suffix + suffix = var.storage_suffix } \ No newline at end of file diff --git a/Deployment/src/variables.tf b/Deployment/src/variables.tf index 3daf8875b..ca6bfb4d1 100644 --- a/Deployment/src/variables.tf +++ b/Deployment/src/variables.tf @@ -90,4 +90,8 @@ variable "elastic_apm_api_key" { variable "suffix" { default = "" +} + +variable "storage_suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 5d38feac3..00e1d9bc7 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" -var storage_suffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index c525148c2..1371e5a61 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" -var storage_suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 2bed8efc111b6acee97f4baf4fddd58cd795d1a6 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 22:14:06 +0530 Subject: [PATCH 011/105] updated tf files --- Deployment/src/azure.tf | 2 +- Deployment/src/main.tf | 2 +- .../templates/continuous-deployment-v2.yml | 104 ++++++++++++++++++ .../templates/continuous-deployment.yml | 58 ++++------ azure-pipelines.yml | 43 ++++++++ 5 files changed, 168 insertions(+), 41 deletions(-) create mode 100644 Deployment/templates/continuous-deployment-v2.yml diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index 25c4e3f9f..24f8fbff4 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - key = "terraform.deployment.v2.tfplan" + # key = "terraform.deployment.v2.tfplan" } } diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 07c762f9b..92ef89d23 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -54,7 +54,7 @@ module "eventhub" { name = "${local.service_name}-${local.env_name}-events${var.suffix}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - logstashStorageName = lower("${local.service_name}logstash${local.env_name}${var.suffix}") + logstashStorageName = lower("${local.service_name}logstash${local.env_name}${var.storage_suffix}") suffix = var.suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml new file mode 100644 index 000000000..69bd55832 --- /dev/null +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -0,0 +1,104 @@ +parameters: + - name: ContinueEvenIfResourcesAreGettingDestroyed + type: boolean + default: false + - name: AzureSubscription + type: string + +steps: + - task: FileTransform@2 + displayName: "File Transform: Ess Config" #Replace exchange set instance value from pipeline + inputs: + folderPath: '$(Pipeline.Workspace)/terraformartifact/src' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: PowerShell@2 + displayName: "terraform devdeploy for Version2" + inputs: + targetType: filePath + filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run_v2.ps1' + arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' + env: + ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) + ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) + ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) + ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) + TF_VAR_allowed_ips: $(whiteListedIps) + TF_VAR_spoke_rg: $(spokeRG) + TF_VAR_spoke_vnet_name: $(spokeVnetName) + TF_VAR_spoke_subnet_name: $(spokeSubnetName) + TF_VAR_agent_rg: $(agentRG) + TF_VAR_agent_vnet_name: $(agentVnetName) + TF_VAR_agent_subnet_name: $(agentSubnetName) + TF_VAR_agent_subscription_id: $(agentSubscriptionId) + + # - task: FileTransform@2 + # displayName: "File Transform: WebJob" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: AzureCLI@2 + # displayName: "Azure Fulfilment Webjob Deployment" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + + + # - task: FileTransform@2 + # displayName: "File Transform: WebAppSettings" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: AzureWebApp@1 + # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # appType: webApp + # appName: "$(WEB_APP_NAME)" + # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + # deployToSlotOrASE: true + # slotName: $(WEB_APP_SLOT_NAME) + + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) + + # - task: PowerShell@2 + # displayName: "Check the status of production slot" + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot - Rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) + + # - task: PowerShell@2 + # displayName: "Check the status of production slot after rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 61644e5ea..e8fa17729 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -13,25 +13,25 @@ steps: xmlTransformationRules: jsonTargetFiles: '**/appsettings.json' - # - task: PowerShell@2 - # displayName: "terraform devdeploy" - # inputs: - # targetType: filePath - # filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run.ps1' - # arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' - # env: - # ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) - # ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) - # ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) - # ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) - # TF_VAR_allowed_ips: $(whiteListedIps) - # TF_VAR_spoke_rg: $(spokeRG) - # TF_VAR_spoke_vnet_name: $(spokeVnetName) - # TF_VAR_spoke_subnet_name: $(spokeSubnetName) - # TF_VAR_agent_rg: $(agentRG) - # TF_VAR_agent_vnet_name: $(agentVnetName) - # TF_VAR_agent_subnet_name: $(agentSubnetName) - # TF_VAR_agent_subscription_id: $(agentSubscriptionId) + - task: powershell@2 + displayname: "terraform devdeploy" + inputs: + targettype: filepath + filepath: '$(pipeline.workspace)/terraformartifact/terraform_conditional_run.ps1' + arguments: '-deploymentresourcegroupname $(deploymentresourcegroupname) -deploymentstorageaccountname $(deploymentstorageaccountname) -workspace $(environment) -continueevenifresourcesaregettingdestroyed $${{ parameters.continueevenifresourcesaregettingdestroyed }} -terraformjsonoutputfile $(pipeline.workspace)/terraformartifact/terraform_output.json -elasticapmserverurl $(elasticapm.serverurl) -elasticapmapikey $(elasticapm.apikey)' + env: + arm_client_id: $(terraform-client-id) + arm_client_secret: $(terraform-client-secret) + arm_tenant_id: $(terraform-tenant-id) + arm_subscription_id: $(terraform-subscription-id) + tf_var_allowed_ips: $(whitelistedips) + tf_var_spoke_rg: $(spokerg) + tf_var_spoke_vnet_name: $(spokevnetname) + tf_var_spoke_subnet_name: $(spokesubnetname) + tf_var_agent_rg: $(agentrg) + tf_var_agent_vnet_name: $(agentvnetname) + tf_var_agent_subnet_name: $(agentsubnetname) + tf_var_agent_subscription_id: $(agentsubscriptionid) # - task: FileTransform@2 # displayName: "File Transform: WebJob" @@ -102,23 +102,3 @@ steps: # targetType: filePath # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" - - - task: PowerShell@2 - displayName: "terraform devdeploy for Version2" - inputs: - targetType: filePath - filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run_v2.ps1' - arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' - env: - ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) - ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) - ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) - ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) - TF_VAR_allowed_ips: $(whiteListedIps) - TF_VAR_spoke_rg: $(spokeRG) - TF_VAR_spoke_vnet_name: $(spokeVnetName) - TF_VAR_spoke_subnet_name: $(spokeSubnetName) - TF_VAR_agent_rg: $(agentRG) - TF_VAR_agent_vnet_name: $(agentVnetName) - TF_VAR_agent_subnet_name: $(agentSubnetName) - TF_VAR_agent_subscription_id: $(agentSubscriptionId) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7c23d558f..cc765fc53 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,6 +533,49 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - stage: Devdeploy + displayName: "Devdeploy (inc terraform, webapp deploy)" + jobs: + - deployment: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # - stage: Devdeploy2 # displayName: "Devdeploy2 for FSSUI ESS" # jobs: From 2bb5c5b02cfcc021b6390fc1da465b1aae9f04be Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 22:16:56 +0530 Subject: [PATCH 012/105] updated pipeline --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cc765fc53..8015619f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -534,10 +534,10 @@ stages: # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - stage: Devdeploy - displayName: "Devdeploy (inc terraform, webapp deploy)" + displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" jobs: - deployment: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App" + displayName: "Dev - deploy terraform and dotnet App for FSSUI" environment: "Ess-Dev" pool: $(DeploymentPool) container: ${{variables.Container}} From b981644acd9d045951c2cf2bdcf68ba4e0e4b883 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 22:18:06 +0530 Subject: [PATCH 013/105] updated pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8015619f5..5cdca8185 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,7 +533,7 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - stage: Devdeploy + - stage: Devdeploy2 displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" jobs: - deployment: DevDeployApp From 1e29efcec09a060e57c767f52ba561986cd39cf1 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 22:22:13 +0530 Subject: [PATCH 014/105] updated yml file --- Deployment/templates/continuous-deployment-v2.yml | 2 +- Deployment/templates/continuous-deployment.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml index 69bd55832..21f1e290b 100644 --- a/Deployment/templates/continuous-deployment-v2.yml +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -14,7 +14,7 @@ steps: jsonTargetFiles: '**/appsettings.json' - task: PowerShell@2 - displayName: "terraform devdeploy for Version2" + displayName: "terraform devdeploy for FSSUI" inputs: targetType: filePath filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run_v2.ps1' diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index e8fa17729..8148bd721 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -16,8 +16,8 @@ steps: - task: powershell@2 displayname: "terraform devdeploy" inputs: - targettype: filepath - filepath: '$(pipeline.workspace)/terraformartifact/terraform_conditional_run.ps1' + targetType: filepath + filePath: '$(pipeline.workspace)/terraformartifact/terraform_conditional_run.ps1' arguments: '-deploymentresourcegroupname $(deploymentresourcegroupname) -deploymentstorageaccountname $(deploymentstorageaccountname) -workspace $(environment) -continueevenifresourcesaregettingdestroyed $${{ parameters.continueevenifresourcesaregettingdestroyed }} -terraformjsonoutputfile $(pipeline.workspace)/terraformartifact/terraform_output.json -elasticapmserverurl $(elasticapm.serverurl) -elasticapmapikey $(elasticapm.apikey)' env: arm_client_id: $(terraform-client-id) From 1a4a7646c2af09249aec3ecefbf42148bd160947 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 23 Feb 2024 23:12:33 +0530 Subject: [PATCH 015/105] updated yml files --- Deployment/templates/continuous-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 8148bd721..ec2bedc9e 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -14,7 +14,7 @@ steps: jsonTargetFiles: '**/appsettings.json' - task: powershell@2 - displayname: "terraform devdeploy" + displayName: "terraform devdeploy" inputs: targetType: filepath filePath: '$(pipeline.workspace)/terraformartifact/terraform_conditional_run.ps1' From e04a403e667a4434f9b4a02a6c3b198e48c70ade Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 00:14:51 +0530 Subject: [PATCH 016/105] updated yml file --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5cdca8185..d13e3eb79 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -536,7 +536,7 @@ stages: - stage: Devdeploy2 displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" jobs: - - deployment: DevDeployApp + - deployment: DevDeployApp2 displayName: "Dev - deploy terraform and dotnet App for FSSUI" environment: "Ess-Dev" pool: $(DeploymentPool) From 2f53e43c6450e97fab3b8f1d5380569bcd39218a Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 00:20:03 +0530 Subject: [PATCH 017/105] updated yml file --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d13e3eb79..4804f4c8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,9 +533,6 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - stage: Devdeploy2 - displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" - jobs: - deployment: DevDeployApp2 displayName: "Dev - deploy terraform and dotnet App for FSSUI" environment: "Ess-Dev" From 7896552bc7d33c13eb272b5a905d5dd967292ac1 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 00:23:35 +0530 Subject: [PATCH 018/105] updated yml file --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4804f4c8c..c6cd74c68 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -534,6 +534,7 @@ stages: # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 + dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for FSSUI" environment: "Ess-Dev" pool: $(DeploymentPool) From fd3a4144d1959eeaa74e26c3e165e38a84c268fd Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 12:10:03 +0530 Subject: [PATCH 019/105] updated yml file --- azure-pipelines.yml | 80 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c6cd74c68..01c3f3070 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,46 +533,46 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - deployment: DevDeployApp2 - dependsOn: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App for FSSUI" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment-v2.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # - deployment: DevDeployApp2 + # dependsOn: DevDeployApp + # displayName: "Dev - deploy terraform and dotnet App for FSSUI" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment-v2.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" # - stage: Devdeploy2 # displayName: "Devdeploy2 for FSSUI ESS" From f9377b362a91ece6385bf5f2d99c43b46f487cfa Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 12:13:50 +0530 Subject: [PATCH 020/105] revert commit --- azure-pipelines.yml | 72 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 01c3f3070..0333c69f4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,41 +533,43 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - # - deployment: DevDeployApp2 - # dependsOn: DevDeployApp - # displayName: "Dev - deploy terraform and dotnet App for FSSUI" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive + - stage: Devdeploy + displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" + jobs: + - deployment: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App for FSSUI" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive # - template: Deployment/templates/continuous-deployment-v2.yml # parameters: From cfe281b9ec21371d1d19a55b422950edf1ec7947 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 12:19:11 +0530 Subject: [PATCH 021/105] updated pipeline --- azure-pipelines.yml | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0333c69f4..7c23d558f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,49 +533,6 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - stage: Devdeploy - displayName: "Devdeploy2 for FSSUI (inc terraform, webapp deploy)" - jobs: - - deployment: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App for FSSUI" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - # - template: Deployment/templates/continuous-deployment-v2.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # - stage: Devdeploy2 # displayName: "Devdeploy2 for FSSUI ESS" # jobs: From 875c5a1138a8f0ecdacc1e27697c1a7726983493 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 12:36:57 +0530 Subject: [PATCH 022/105] Revert "updated suffix code for storage" This reverts commit 72725103f63d2fadbb9dbf50dd94590f2bbe8c6d. --- Deployment/src/main.tf | 4 ++-- Deployment/src/variables.tf | 4 ---- Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 92ef89d23..421bf53ac 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -122,7 +122,7 @@ module "fulfilment_storage" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id - suffix = var.storage_suffix + suffix = var.suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id exchange_set_config = local.config_data.ESSFulfilmentConfiguration @@ -233,5 +233,5 @@ module "cache_storage" { agent_subnet = data.azurerm_subnet.agent_subnet.id env_name = local.env_name service_name = local.service_name - suffix = var.storage_suffix + suffix = var.suffix } \ No newline at end of file diff --git a/Deployment/src/variables.tf b/Deployment/src/variables.tf index ca6bfb4d1..3daf8875b 100644 --- a/Deployment/src/variables.tf +++ b/Deployment/src/variables.tf @@ -90,8 +90,4 @@ variable "elastic_apm_api_key" { variable "suffix" { default = "" -} - -variable "storage_suffix" { - default = "" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 00e1d9bc7..5d38feac3 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" -var storage_suffix="" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 1371e5a61..c525148c2 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" -var storage_suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 64b875fcee80508d55896059a77f793191cad3cc Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 13:01:25 +0530 Subject: [PATCH 023/105] updated azure.tf --- Deployment/src/azure.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index 24f8fbff4..e8d886fb1 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - # key = "terraform.deployment.v2.tfplan" + key = "terraform.deployment.tfplan" } } From 118b0bff610bf2d02ed8124b3cb73f7ae7725463 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 13:21:46 +0530 Subject: [PATCH 024/105] Reapply "updated suffix code for storage" This reverts commit 875c5a1138a8f0ecdacc1e27697c1a7726983493. --- Deployment/src/main.tf | 4 ++-- Deployment/src/variables.tf | 4 ++++ Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 421bf53ac..92ef89d23 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -122,7 +122,7 @@ module "fulfilment_storage" { small_exchange_set_subnets = data.azurerm_subnet.small_exchange_set_subnet[*].id medium_exchange_set_subnets = data.azurerm_subnet.medium_exchange_set_subnet[*].id large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id - suffix = var.suffix + suffix = var.storage_suffix m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id exchange_set_config = local.config_data.ESSFulfilmentConfiguration @@ -233,5 +233,5 @@ module "cache_storage" { agent_subnet = data.azurerm_subnet.agent_subnet.id env_name = local.env_name service_name = local.service_name - suffix = var.suffix + suffix = var.storage_suffix } \ No newline at end of file diff --git a/Deployment/src/variables.tf b/Deployment/src/variables.tf index 3daf8875b..ca6bfb4d1 100644 --- a/Deployment/src/variables.tf +++ b/Deployment/src/variables.tf @@ -90,4 +90,8 @@ variable "elastic_apm_api_key" { variable "suffix" { default = "" +} + +variable "storage_suffix" { + default = "" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 5d38feac3..00e1d9bc7 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="" -var storage_suffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index c525148c2..1371e5a61 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" -var storage_suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From b8e5b2a5f8feb13e7b2f38064ef716f2377a4e3e Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 13:52:06 +0530 Subject: [PATCH 025/105] updated file --- .../templates/continuous-deployment.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index ec2bedc9e..572e7fea4 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -13,25 +13,25 @@ steps: xmlTransformationRules: jsonTargetFiles: '**/appsettings.json' - - task: powershell@2 + - task: PowerShell@2 displayName: "terraform devdeploy" inputs: - targetType: filepath - filePath: '$(pipeline.workspace)/terraformartifact/terraform_conditional_run.ps1' - arguments: '-deploymentresourcegroupname $(deploymentresourcegroupname) -deploymentstorageaccountname $(deploymentstorageaccountname) -workspace $(environment) -continueevenifresourcesaregettingdestroyed $${{ parameters.continueevenifresourcesaregettingdestroyed }} -terraformjsonoutputfile $(pipeline.workspace)/terraformartifact/terraform_output.json -elasticapmserverurl $(elasticapm.serverurl) -elasticapmapikey $(elasticapm.apikey)' + targetType: filePath + filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run.ps1' + arguments: '-deploymentResourceGroupName $(DeploymentResourceGroupName) -deploymentStorageAccountName $(DeploymentStorageAccountName) -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} -terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -elasticApmServerUrl $(ElasticAPM.ServerURL) -elasticApmApiKey $(ElasticAPM.ApiKey)' env: - arm_client_id: $(terraform-client-id) - arm_client_secret: $(terraform-client-secret) - arm_tenant_id: $(terraform-tenant-id) - arm_subscription_id: $(terraform-subscription-id) - tf_var_allowed_ips: $(whitelistedips) - tf_var_spoke_rg: $(spokerg) - tf_var_spoke_vnet_name: $(spokevnetname) - tf_var_spoke_subnet_name: $(spokesubnetname) - tf_var_agent_rg: $(agentrg) - tf_var_agent_vnet_name: $(agentvnetname) - tf_var_agent_subnet_name: $(agentsubnetname) - tf_var_agent_subscription_id: $(agentsubscriptionid) + ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) + ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) + ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) + ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) + TF_VAR_allowed_ips: $(whiteListedIps) + TF_VAR_spoke_rg: $(spokeRG) + TF_VAR_spoke_vnet_name: $(spokeVnetName) + TF_VAR_spoke_subnet_name: $(spokeSubnetName) + TF_VAR_agent_rg: $(agentRG) + TF_VAR_agent_vnet_name: $(agentVnetName) + TF_VAR_agent_subnet_name: $(agentSubnetName) + TF_VAR_agent_subscription_id: $(agentSubscriptionId) # - task: FileTransform@2 # displayName: "File Transform: WebJob" From 00efc14e80972300dfa7e98db7fb684504e959c7 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 14:05:19 +0530 Subject: [PATCH 026/105] updated v2 changes --- Deployment/src/azure.tf | 2 +- azure-pipelines.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index e8d886fb1..94eca6485 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - key = "terraform.deployment.tfplan" + #key = "terraform.deployment.tfplan" } } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7c23d558f..9101b23d0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -533,6 +533,46 @@ stages: # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - deployment: DevDeployApp2 + displayName: "Dev - deploy terraform and dotnet App for ESS UI" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # - stage: Devdeploy2 # displayName: "Devdeploy2 for FSSUI ESS" # jobs: From 4250305802118a931a9f6676381c4adc154b9033 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 15:32:28 +0530 Subject: [PATCH 027/105] updated apim changes --- Deployment/src/Modules/APIM/variables.tf | 12 ++++++++---- Deployment/terraform_conditional_run_apim.ps1 | 4 ++-- azure-pipelines.yml | 18 +++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 986038cb9..984239411 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -111,13 +111,17 @@ variable "cors_origin_values" { type = string } +variable "suffix" { + default = "" +} + locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? var.group_name : "${var.group_name} ${var.env_suffix[local.env_name]}" - product_name = local.env_name == "prod" ? var.product_name : "${var.product_name} ${var.env_suffix[local.env_name]}" - ui_product_name = local.env_name == "prod" ? var.ui_product_name : "${var.ui_product_name} ${var.env_suffix[local.env_name]}" - api_name = local.env_name == "prod" ? var.api_name : "${var.api_name} ${var.env_suffix[local.env_name]}" + group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" apim_api_path = local.env_name == "prod" ? local.service_name : "${local.service_name}-${local.env_name}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index 4a11692bc..3e0a34070 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.tfplan" +#terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9101b23d0..39a12045e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -440,15 +440,15 @@ stages: ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) # - task: DownloadBuildArtifacts@0 # displayName: "Download Functional test Artifact" From 0172148f14aa9ea5a2f3e67ff53597bf0af4f84c Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 15:53:02 +0530 Subject: [PATCH 028/105] updated yaml pipeline --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 39a12045e..e0a57066a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -534,6 +534,7 @@ stages: # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 + dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for ESS UI" environment: "Ess-Dev" pool: $(DeploymentPool) From f71391dbb4a80c2ee10733bbc7642226e3fee8ec Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 16:00:19 +0530 Subject: [PATCH 029/105] updated apim variables --- Deployment/src/Modules/APIM/variables.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 984239411..286851753 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -118,10 +118,10 @@ variable "suffix" { locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" apim_api_path = local.env_name == "prod" ? local.service_name : "${local.service_name}-${local.env_name}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) From e7c9c405876cbb62d1c2551cf45545bf35780735 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sat, 24 Feb 2024 16:38:13 +0530 Subject: [PATCH 030/105] updated v2 apim changes --- .../continuous-deployment-apim-v2.yml | 49 +++++++++++++++++++ .../terraform_conditional_run_apim_v2.ps1 | 47 ++++++++++++++++++ azure-pipelines.yml | 10 ++++ 3 files changed, 106 insertions(+) create mode 100644 Deployment/templates/continuous-deployment-apim-v2.yml create mode 100644 Deployment/terraform_conditional_run_apim_v2.ps1 diff --git a/Deployment/templates/continuous-deployment-apim-v2.yml b/Deployment/templates/continuous-deployment-apim-v2.yml new file mode 100644 index 000000000..3ad54a8bf --- /dev/null +++ b/Deployment/templates/continuous-deployment-apim-v2.yml @@ -0,0 +1,49 @@ +parameters: + - name: ContinueEvenIfResourcesAreGettingDestroyed + type: boolean + default: false + - name: AzureSubscription + type: string + - name: TerraformKeyVault + type: string + - name: APIMResourceGroup + type: string + - name: APIMServiceInstance + type: string + - name: tfstateStorageAccountRG + type: string + - name: tfstateStorageAccountName + type: string + +steps: + - task: AzureKeyVault@1 + displayName: 'Read APIM terraform Variables' + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + KeyVaultName: "${{ parameters.TerraformKeyVault }}" + SecretsFilter: '*' + RunAsPreJob: false + + - task: PowerShell@2 + name: APIMDeployment + displayName: "terraform APIM deployment" + inputs: + targetType: filePath + filePath: '$(Pipeline.Workspace)/terraformartifact/terraform_conditional_run_apim_v2.ps1' + arguments: '-deploymentResourceGroupName ${{ parameters.tfstateStorageAccountRG }} -deploymentStorageAccountName ${{ parameters.tfstateStorageAccountName }} -workSpace $(Environment) -continueEvenIfResourcesAreGettingDestroyed $${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}' + env: + ARM_CLIENT_ID: $(TERRAFORM-CLIENT-ID) + ARM_CLIENT_SECRET: $(TERRAFORM-CLIENT-SECRET) + ARM_TENANT_ID: $(TERRAFORM-TENANT-ID) + ARM_SUBSCRIPTION_ID: $(TERRAFORM-SUBSCRIPTION-ID) + TF_VAR_apim_rg: ${{ parameters.APIMResourceGroup }} + TF_VAR_apim_name: ${{ parameters.APIMServiceInstance }} + TF_VAR_apim_api_backend_url: $(EssApiUrl) + TF_VAR_client_credentials_tenant_id: $(AzureAdB2CConfiguration.TenantId) + TF_VAR_client_credentials_scope: "$(AzureAdB2CConfiguration.ClientId)/.default" + TF_VAR_b2c_token_issuer: "$(APIM_B2C_TOKEN_ISSUER)" + TF_VAR_b2c_client_id: "$(APIM_B2C_CLIENT_ID)" + TF_VAR_cors_origin_values: "$(APIM_CORS_ORIGIN_VALUES)" + TF_VAR_ess_ui_product_call_limit: $(essuiproductcalllimit) + TF_VAR_ess_ui_product_call_renewal_period: $(essuiproductcallrenewalperiod) + TF_VAR_ess_ui_product_daily_quota_limit: $(essuiproductdailyquotalimit) \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 new file mode 100644 index 000000000..c9fad0316 --- /dev/null +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -0,0 +1,47 @@ +param ( + [Parameter(Mandatory = $true)] [string] $deploymentResourceGroupName, + [Parameter(Mandatory = $true)] [string] $deploymentStorageAccountName, + [Parameter(Mandatory = $true)] [string] $workSpace, + [Parameter(Mandatory = $true)] [boolean] $continueEvenIfResourcesAreGettingDestroyed +) + +cd $env:AGENT_BUILDDIRECTORY/terraformartifact/src/Modules/APIM/ + +Write-output "Executing terraform scripts for APIM deployment in $workSpace enviroment..." + +terraform init -backend-config="resource_group_name=$deploymentResourceGroupName" -backend-config="storage_account_name=$deploymentStorageAccountName" -backend-config="key=terraform.ess.apim.deployment.tfplan" +if ( !$? ) { echo "Something went wrong during terraform initialization"; throw "Error" } + +Write-output "Selecting workspace..." + +$ErrorActionPreference = 'SilentlyContinue' +terraform workspace new $WorkSpace 2>&1 > $null +$ErrorActionPreference = 'Continue' + +terraform workspace select $workSpace +if ( !$? ) { echo "Error while selecting workspace"; throw "Error" } + +Write-output "Validating terraform..." +terraform validate +if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } + +Write-output "Execute Terraform plan..." +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="-v2" | tee terraform_output.txt +if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } + +$totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length +if($totalDestroyLines -ge 2) +{ + write-Host("Terraform is destroying some resources, please verify...................") + if ( !$ContinueEvenIfResourcesAreGettingDestroyed) + { + write-Host("exiting...................") + Write-Output $_ + exit 1 + } + write-host("Continue executing terraform apply - as continueEvenIfResourcesAreGettingDestroyed param is set to true in pipeline...") +} + +Write-output "Executing terraform apply..." +#terraform apply "terraform.ess.apim.deployment.tfplan" +if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e0a57066a..15f2add34 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -574,6 +574,16 @@ stages: ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + - template: Deployment/templates/continuous-deployment-apim-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - stage: Devdeploy2 # displayName: "Devdeploy2 for FSSUI ESS" # jobs: From aba2afcbabd52f3339b910b576e57eb7fdd186b3 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sun, 25 Feb 2024 00:22:43 +0530 Subject: [PATCH 031/105] updated tfplan file --- Deployment/src/Modules/APIM/azure.tf | 2 +- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Deployment/src/Modules/APIM/azure.tf b/Deployment/src/Modules/APIM/azure.tf index 47b273f04..a2d1f8b68 100644 --- a/Deployment/src/Modules/APIM/azure.tf +++ b/Deployment/src/Modules/APIM/azure.tf @@ -9,7 +9,7 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - key = "terraform.ess.apim.deployment.tfplan" + #key = "terraform.ess.apim.deployment.tfplan" } } diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index c9fad0316..e4c8d5692 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -9,7 +9,7 @@ cd $env:AGENT_BUILDDIRECTORY/terraformartifact/src/Modules/APIM/ Write-output "Executing terraform scripts for APIM deployment in $workSpace enviroment..." -terraform init -backend-config="resource_group_name=$deploymentResourceGroupName" -backend-config="storage_account_name=$deploymentStorageAccountName" -backend-config="key=terraform.ess.apim.deployment.tfplan" +terraform init -backend-config="resource_group_name=$deploymentResourceGroupName" -backend-config="storage_account_name=$deploymentStorageAccountName" -backend-config="key=terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform initialization"; throw "Error" } Write-output "Selecting workspace..." From bc3fd57ab9a49baeb635b9a96235943ae2edd83d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Mon, 26 Feb 2024 12:50:53 +0530 Subject: [PATCH 032/105] added variable group for dev2 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 15f2add34..76a300110 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -543,7 +543,7 @@ stages: clean: all variables: - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" + - group: "ESS-Dev2-Variables" - name: "ESSAzureADConfiguration.ClientId" value: $(ESSClientId) - name: "ESSAzureADConfiguration.TenantId" From 574f31333956e5602cc8848b6aa24c90c2acbc4a Mon Sep 17 00:00:00 2001 From: Amogh14893 Date: Mon, 26 Feb 2024 18:59:38 +0530 Subject: [PATCH 033/105] Commenting Devdeploy job for original set of ESS resources and allowing new set of resources to be set for deployment --- azure-pipelines.yml | 262 ++++++++++++++++++++++---------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 76a300110..24fec2208 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -400,138 +400,138 @@ stages: - stage: Devdeploy displayName: "Devdeploy (inc terraform, webapp deploy)" jobs: - - deployment: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - deployment: DevDeployApp + # displayName: "Dev - deploy terraform and dotnet App" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # # - task: DownloadBuildArtifacts@0 + # # displayName: "Download Functional test Artifact" + # # inputs: + # # buildType: 'current' + # # downloadType: 'single' + # # artifactName: 'functionaltests' + # # downloadPath: '$(Build.SourcesDirectory)' + + # # - task: DownloadBuildArtifacts@0 + # # displayName: "Download Terraform Artifact" + # # inputs: + # # buildType: 'current' + # # downloadType: 'single' + # # artifactName: 'terraformartifact' + # # downloadPath: '$(Build.SourcesDirectory)' + + # # - task: FileTransform@2 + # # displayName: "File Transform: functionaltests" + # # inputs: + # # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # # xmlTransformationRules: + # # jsonTargetFiles: '**/appsettings.json' + + # # - task: UseDotNet@2 + # # displayName: 'Use .NET SDK' + # # inputs: + # # packageType: sdk + # # useGlobalJson: true + # # workingDirectory: '$(Build.SourcesDirectory)' + + # # - task: AzureCLI@2 + # # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # # condition: always() + # # inputs: + # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # # scriptType: 'pscore' + # # scriptLocation: 'scriptPath' + # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIOEnabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIOEnabled' + # # testRunTitle: "Dev-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # # - task: AzureCLI@2 + # # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # # inputs: + # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # # scriptType: 'pscore' + # # scriptLocation: 'scriptPath' + # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # # - task: DotNetCoreCLI@2 + # # displayName: "Run Functional tests AIODisabled" + # # inputs: + # # command: "test" + # # projects: | + # # **/*FunctionalTest*.dll + # # !**/*TestAdapter.dll + # # !**/obj/** + # # arguments: '--filter Category=SmokeTest-AIODisabled' + # # testRunTitle: "Dev-AutomationTests" + # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # # - task: AzureCLI@2 + # # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # # condition: always() + # # inputs: + # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # # scriptType: 'pscore' + # # scriptLocation: 'scriptPath' + # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 dependsOn: DevDeployApp From 31d0283eeaa7dc0e79f3accc0bd41b6d8fc6f33c Mon Sep 17 00:00:00 2001 From: Amogh14893 Date: Mon, 26 Feb 2024 19:01:11 +0530 Subject: [PATCH 034/105] Commente dependency parameter --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 24fec2208..c7a16b693 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -534,7 +534,7 @@ stages: # # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 - dependsOn: DevDeployApp + # dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for ESS UI" environment: "Ess-Dev" pool: $(DeploymentPool) From 97ca705ac51b6d99cc982707023e2c4b08e6f017 Mon Sep 17 00:00:00 2001 From: Amogh14893 Date: Mon, 26 Feb 2024 19:55:46 +0530 Subject: [PATCH 035/105] Uncommented terraform apply fom V2 resources --- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index e4c8d5692..949592095 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.tfplan" +terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 1371e5a61..65b32f161 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -#terraform apply "terraform.deployment.tfplan" +terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" From c51eae143043b9d4470a28d77523362ff937c6b9 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 27 Feb 2024 12:55:37 +0530 Subject: [PATCH 036/105] code deployment for v2 --- .../templates/continuous-deployment-v2.yml | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml index 21f1e290b..fc2fe2add 100644 --- a/Deployment/templates/continuous-deployment-v2.yml +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - # - task: FileTransform@2 - # displayName: "File Transform: WebJob" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebJob" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureCLI@2 - # displayName: "Azure Fulfilment Webjob Deployment" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + - task: AzureCLI@2 + displayName: "Azure Fulfilment Webjob Deployment" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - # - task: FileTransform@2 - # displayName: "File Transform: WebAppSettings" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebAppSettings" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureWebApp@1 - # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # appType: webApp - # appName: "$(WEB_APP_NAME)" - # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - # deployToSlotOrASE: true - # slotName: $(WEB_APP_SLOT_NAME) + - task: AzureWebApp@1 + displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + appType: webApp + appName: "$(WEB_APP_NAME)" + package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + deployToSlotOrASE: true + slotName: $(WEB_APP_SLOT_NAME) - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) - # - task: PowerShell@2 - # displayName: "Check the status of production slot" - # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + - task: PowerShell@2 + displayName: "Check the status of production slot" + inputs: + targetType: filePath + filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot - Rollback" - # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot - Rollback" + condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) - # - task: PowerShell@2 - # displayName: "Check the status of production slot after rollback" - # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + - task: PowerShell@2 + displayName: "Check the status of production slot after rollback" + condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + inputs: + targetType: filePath + filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" From 7035463bb929a8f4ce66f320b9f2a15de78d09d4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 27 Feb 2024 13:09:07 +0530 Subject: [PATCH 037/105] updated script --- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 949592095..99a7e1360 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="-v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 3bc01ece94eb89ea380fa685a0592bd68118efd4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 27 Feb 2024 14:11:50 +0530 Subject: [PATCH 038/105] updated yml file --- .../templates/continuous-deployment-v2.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml index fc2fe2add..89e6e08da 100644 --- a/Deployment/templates/continuous-deployment-v2.yml +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -77,12 +77,12 @@ steps: swapWithProduction: true sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot" - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + # - task: PowerShell@2 + # displayName: "Check the status of production slot" + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - task: AzureAppServiceManage@0 displayName: "Swap with production slot - Rollback" @@ -95,10 +95,10 @@ steps: swapWithProduction: true sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot after rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + # - task: PowerShell@2 + # displayName: "Check the status of production slot after rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" From 64d8cf5303c1aca2b8f5867ac1bdfe8e50578980 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 27 Feb 2024 15:35:23 +0530 Subject: [PATCH 039/105] updated tf file --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 286851753..743593da8 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -122,7 +122,7 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? local.service_name : "${local.service_name}-${local.env_name}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix} : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From f34b728c1b34e2d28d5ac4be13c7201dd5460bcd Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 27 Feb 2024 15:57:49 +0530 Subject: [PATCH 040/105] updated tf --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 743593da8..5347cbce1 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -122,7 +122,7 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix} : "${local.service_name}-${local.env_name}-${var.suffix}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 4d279890f097992d13cb190c76dd0d972d490e49 Mon Sep 17 00:00:00 2001 From: Harshal Shukla Date: Thu, 29 Feb 2024 14:04:09 +0530 Subject: [PATCH 041/105] Webjob helth check changes for v2 --- .../appsettings.json | 3 ++- .../appsettings.local.overrides.json | 3 ++- .../EssFulfilmentStorageConfiguration.cs | 1 + .../AzureWebJobsHealthCheckService.cs | 24 ++++++++++++++++--- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json index 09eeaf319..20d98172f 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json @@ -71,7 +71,8 @@ "LargeMediaExchangeSetSizeInMB": 700, "LargeExchangeSetSizeInMB": 300, "SmallExchangeSetSizeInMB": 50, - "ExchangeSetTypes": "sxs,mxs,lxs" + "ExchangeSetTypes": "sxs,mxs,lxs", + "WebAppVersion": "dev" }, "ESSManagedIdentity": { "ClientId": "", diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.local.overrides.json b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.local.overrides.json index 387a38740..cc9ebc9e9 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.local.overrides.json +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.local.overrides.json @@ -32,7 +32,8 @@ "LargeMediaExchangeSetSizeInMB": 700, "LargeExchangeSetSizeInMB": 300, "SmallExchangeSetSizeInMB": 50, - "ExchangeSetTypes": "sxs,mxs,lxs" + "ExchangeSetTypes": "sxs,mxs,lxs", + "WebAppVersion": "dev" }, "CacheConfiguration": { "CacheStorageAccountName": "", diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Configuration/EssFulfilmentStorageConfiguration.cs b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Configuration/EssFulfilmentStorageConfiguration.cs index 67c4968d8..d460c4146 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Configuration/EssFulfilmentStorageConfiguration.cs +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Configuration/EssFulfilmentStorageConfiguration.cs @@ -23,5 +23,6 @@ public class EssFulfilmentStorageConfiguration : IEssFulfilmentStorageConfigurat public double SmallExchangeSetSizeInMB { get; set; } public string ExchangeSetTypes { get; set; } public double LargeMediaExchangeSetSizeInMB { get; set; } + public string WebAppVersion { get; set; } } } diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/HealthCheck/AzureWebJobsHealthCheckService.cs b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/HealthCheck/AzureWebJobsHealthCheckService.cs index 5c6e7b8cd..c389a15a1 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/HealthCheck/AzureWebJobsHealthCheckService.cs +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/HealthCheck/AzureWebJobsHealthCheckService.cs @@ -36,15 +36,33 @@ public AzureWebJobsHealthCheckService(IOptions CheckHealthAsync(CancellationToken cancellationToken = default) { string[] exchangeSetTypes = essFulfilmentStorageConfiguration.Value.ExchangeSetTypes.Split(","); + string webAppVersion = essFulfilmentStorageConfiguration.Value.WebAppVersion; + string userNameKey, passwordKey, webJobUri = string.Empty; List webJobs = new List(); foreach (string exchangeSetTypeName in exchangeSetTypes) { Enum.TryParse(exchangeSetTypeName, out ExchangeSetType exchangeSetType); for (int instance = 1; instance <= azureBlobStorageService.GetInstanceCountBasedOnExchangeSetType(exchangeSetType); instance++) { - string userNameKey = $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-scm-username"; - string passwordKey = $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-scm-password"; - string webJobUri = $"https://ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp.scm.azurewebsites.net/api/continuouswebjobs/ESSFulfilmentWebJob"; + if (webAppVersion.ToLowerInvariant() != "v2") + { + userNameKey = + $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-scm-username"; + passwordKey = + $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-scm-password"; + webJobUri = + $"https://ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp.scm.azurewebsites.net/api/continuouswebjobs/ESSFulfilmentWebJob"; + } + else + { + userNameKey = + $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-v2-scm-username"; + passwordKey = + $"ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-v2-scm-password"; + webJobUri = + $"https://ess-{webHostEnvironment.EnvironmentName}-{exchangeSetType}-{instance}-webapp-v2.scm.azurewebsites.net/api/continuouswebjobs/ESSFulfilmentWebJob"; + } + string userPassword = webJobsAccessKeyProvider.GetWebJobsAccessKey(userNameKey) + ":" + webJobsAccessKeyProvider.GetWebJobsAccessKey(passwordKey); userPassword = Convert.ToBase64String(Encoding.Default.GetBytes(userPassword)); From 396b120a860f98335fc080419a3c134c156d5867 Mon Sep 17 00:00:00 2001 From: Harshal Shukla Date: Thu, 29 Feb 2024 15:07:37 +0530 Subject: [PATCH 042/105] Webjob healthcheck issue fixed for v2 --- .../HealthCheck/AzureMessageQueueHealthCheckTest.cs | 2 +- .../HealthCheck/AzureWebJobsHealthCheckServiceTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureMessageQueueHealthCheckTest.cs b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureMessageQueueHealthCheckTest.cs index 5911f5547..9fe108cfa 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureMessageQueueHealthCheckTest.cs +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureMessageQueueHealthCheckTest.cs @@ -31,7 +31,7 @@ public void Setup() this.fakeAzureBlobStorageService = A.Fake(); this.fakeEssFulfilmentStorageConfiguration = Options.Create(new EssFulfilmentStorageConfiguration() - { QueueName = "testessdevqueue", StorageAccountKey = "testaccountkey", StorageAccountName = "testessdevstorage", StorageContainerName = "testContainer", DynamicQueueName = "testDynamicQueue", ExchangeSetTypes= "test" }); + { QueueName = "testessdevqueue", StorageAccountKey = "testaccountkey", StorageAccountName = "testessdevstorage", StorageContainerName = "testContainer", DynamicQueueName = "testDynamicQueue", ExchangeSetTypes= "test", WebAppVersion = "" }); azureMessageQueueHealthCheck = new AzureMessageQueueHealthCheck(fakeAzureMessageQueueHelperClient, fakeSalesCatalogueStorageService, fakeEssFulfilmentStorageConfiguration, fakeLogger, fakeAzureBlobStorageService); } diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs index 698610323..59b739698 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs @@ -24,7 +24,7 @@ public class AzureWebJobsHealthCheckServiceTest [SetUp] public void Setup() { - this.fakeEssFulfilmentStorageConfiguration = Options.Create(new EssFulfilmentStorageConfiguration() { ExchangeSetTypes = "sxs,mxs,lxs" }); + this.fakeEssFulfilmentStorageConfiguration = Options.Create(new EssFulfilmentStorageConfiguration() { ExchangeSetTypes = "sxs,mxs,lxs", WebAppVersion = ""}); this.fakeWebJobsAccessKeyProvider = A.Fake(); this.fakeWebHostEnvironment = A.Fake(); this.fakeAzureBlobStorageService = A.Fake(); From b762eacfaeae0667215883f10bdbf535aebc9665 Mon Sep 17 00:00:00 2001 From: Harshal Shukla Date: Thu, 29 Feb 2024 15:41:10 +0530 Subject: [PATCH 043/105] Webjob health check tests added for v2 --- .../AzureWebJobsHealthCheckServiceTest.cs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs index 59b739698..85eff0d96 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common.UnitTests/HealthCheck/AzureWebJobsHealthCheckServiceTest.cs @@ -56,5 +56,33 @@ public async Task WhenAzureWebJobStatusIsRunning_ThenReturnHealthy() Assert.AreEqual(HealthStatus.Healthy, response.Status); } + + [Test] + public async Task WhenAzureWebJobStatusIsNotRunningForV2_ThenReturnUnhealthy() + { + this.fakeEssFulfilmentStorageConfiguration.Value.WebAppVersion = "v2"; + + A.CallTo(() => fakeAzureBlobStorageService.GetInstanceCountBasedOnExchangeSetType(A.Ignored)).Returns(1); + A.CallTo(() => fakeAzureWebJobsHealthCheckClient.CheckAllWebJobsHealth(A>.Ignored)) + .Returns(new HealthCheckResult(HealthStatus.Unhealthy, "Azure message queue is unhealthy")); + + var response = await azureWebJobsHealthCheckService.CheckHealthAsync(); + + Assert.AreEqual(HealthStatus.Unhealthy, response.Status); + } + + [Test] + public async Task WhenAzureWebJobStatusIsRunningForV2_ThenReturnHealthy() + { + this.fakeEssFulfilmentStorageConfiguration.Value.WebAppVersion = "v2"; + + A.CallTo(() => fakeAzureBlobStorageService.GetInstanceCountBasedOnExchangeSetType(A.Ignored)).Returns(1); + A.CallTo(() => fakeAzureWebJobsHealthCheckClient.CheckAllWebJobsHealth(A>.Ignored)) + .Returns(new HealthCheckResult(HealthStatus.Healthy, "Azure message queue is healthy")); + + var response = await azureWebJobsHealthCheckService.CheckHealthAsync(); + + Assert.AreEqual(HealthStatus.Healthy, response.Status); + } } -} +} \ No newline at end of file From f7fd7c2b503d7c46b2c5b509d9a1d584bfd9264f Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 29 Feb 2024 16:30:16 +0530 Subject: [PATCH 044/105] updated pipelines --- .../appsettings.json | 2 +- azure-pipelines.yml | 136 ------------------ 2 files changed, 1 insertion(+), 137 deletions(-) diff --git a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json index 20d98172f..bfd5174d4 100644 --- a/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json +++ b/UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/appsettings.json @@ -72,7 +72,7 @@ "LargeExchangeSetSizeInMB": 300, "SmallExchangeSetSizeInMB": 50, "ExchangeSetTypes": "sxs,mxs,lxs", - "WebAppVersion": "dev" + "WebAppVersion": "" }, "ESSManagedIdentity": { "ClientId": "", diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c7a16b693..413fe0e8d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -584,142 +584,6 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - stage: Devdeploy2 - # displayName: "Devdeploy2 for FSSUI ESS" - # jobs: - # - deployment: DevDeployApp2 - # displayName: "Dev2 - deploy terraform and dotnet App" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev2-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - # - stage: QCdeploy # dependsOn: # - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH From b71bcacaf89100b80e03e4f548ebe4f479802a4d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 29 Feb 2024 20:22:01 +0530 Subject: [PATCH 045/105] updated apim variables --- Deployment/src/Modules/APIM/variables.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 5347cbce1..70d70dd8f 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -118,10 +118,10 @@ variable "suffix" { locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) From 462a373681ce3ae2559c23fbd6f5288e25ba59c0 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 09:21:49 +0530 Subject: [PATCH 046/105] updated azure pipeline --- azure-pipelines.yml | 98 ++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 413fe0e8d..4ca6b2c22 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -400,55 +400,55 @@ stages: - stage: Devdeploy displayName: "Devdeploy (inc terraform, webapp deploy)" jobs: - # - deployment: DevDeployApp - # displayName: "Dev - deploy terraform and dotnet App" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - deployment: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) # # - task: DownloadBuildArtifacts@0 # # displayName: "Download Functional test Artifact" From 355b99587aeffc980d5acf1451d0b945d603f4bd Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 09:46:56 +0530 Subject: [PATCH 047/105] updated tf files --- Deployment/src/Modules/APIM/variables.tf | 8 ++++---- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 70d70dd8f..5347cbce1 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -118,10 +118,10 @@ variable "suffix" { locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 99a7e1360..21e338550 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 674becf8815fcdfef42fd91c60264aee1cfea848 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 10:20:46 +0530 Subject: [PATCH 048/105] updated api path variable --- Deployment/src/Modules/APIM/variables.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 5347cbce1..4e0ce00ab 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -122,7 +122,8 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" + #apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" + apim_api_path = var.suffix == "v2" ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 0a49d7369a878b9c4db5efaacc9841a8a3f5e0f9 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 10:27:33 +0530 Subject: [PATCH 049/105] updated variable.tf --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 4e0ce00ab..8f4a51a33 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -123,7 +123,7 @@ locals { ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" #apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" - apim_api_path = var.suffix == "v2" ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") + apim_api_path = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 0df740c7e8f8e9d012366250d45ca220455e37a4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 10:46:05 +0530 Subject: [PATCH 050/105] updated pipeline --- .../templates/continuous-deployment.yml | 122 +++++++++--------- Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_apim.ps1 | 2 +- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 572e7fea4..5b98816ef 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - # - task: FileTransform@2 - # displayName: "File Transform: WebJob" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebJob" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureCLI@2 - # displayName: "Azure Fulfilment Webjob Deployment" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + - task: AzureCLI@2 + displayName: "Azure Fulfilment Webjob Deployment" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - # - task: FileTransform@2 - # displayName: "File Transform: WebAppSettings" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebAppSettings" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureWebApp@1 - # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # appType: webApp - # appName: "$(WEB_APP_NAME)" - # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - # deployToSlotOrASE: true - # slotName: $(WEB_APP_SLOT_NAME) + - task: AzureWebApp@1 + displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + appType: webApp + appName: "$(WEB_APP_NAME)" + package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + deployToSlotOrASE: true + slotName: $(WEB_APP_SLOT_NAME) - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) - # - task: PowerShell@2 - # displayName: "Check the status of production slot" - # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + - task: PowerShell@2 + displayName: "Check the status of production slot" + inputs: + targetType: filePath + filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot - Rollback" - # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot - Rollback" + condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) - # - task: PowerShell@2 - # displayName: "Check the status of production slot after rollback" - # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + - task: PowerShell@2 + displayName: "Check the status of production slot after rollback" + condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + inputs: + targetType: filePath + filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 00e1d9bc7..0261f9bd9 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -#terraform apply "terraform.deployment.tfplan" +terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index 3e0a34070..e14bf52eb 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.tfplan" +terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file From 5c98171921161ea4c26952345a41444c518fa5c3 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 11:10:11 +0530 Subject: [PATCH 051/105] updated pipeline --- Deployment/src/Modules/APIM/variables.tf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 8f4a51a33..2b1055df7 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -118,10 +118,14 @@ variable "suffix" { locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + #group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" + group_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}" + #product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + product_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") + #ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + ui_product_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") + #api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + api_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") #apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_path = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") From 8e85b736a9c585b7a1717ccea47d07558ed682f0 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 11:13:48 +0530 Subject: [PATCH 052/105] updated tf files --- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 21e338550..99a7e1360 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From df7d817f7b52756412cc0b331615462d2f40dec3 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 11:42:09 +0530 Subject: [PATCH 053/105] updated variable.tf --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 2b1055df7..b72096165 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -119,7 +119,7 @@ locals { env_name = lower(terraform.workspace) service_name = "ess" #group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - group_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}" + group_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") #product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" product_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") #ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" From 1ca5eb4673d3786d34a42ba028cf954417b7584e Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 12:20:43 +0530 Subject: [PATCH 054/105] updated pipeline --- Deployment/src/Modules/APIM/variables.tf | 10 +- azure-pipelines.yml | 172 +++++++++++------------ 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index b72096165..f75c4fcaf 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -119,15 +119,15 @@ locals { env_name = lower(terraform.workspace) service_name = "ess" #group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - group_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") + group_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") #product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - product_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") + product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") #ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - ui_product_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") + ui_product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") #api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - api_name = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") + api_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") #apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" - apim_api_path = strcontains("var.suffix", "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") + apim_api_path = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ca6b2c22..35d956d6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -450,88 +450,88 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # # - task: DownloadBuildArtifacts@0 - # # displayName: "Download Functional test Artifact" - # # inputs: - # # buildType: 'current' - # # downloadType: 'single' - # # artifactName: 'functionaltests' - # # downloadPath: '$(Build.SourcesDirectory)' - - # # - task: DownloadBuildArtifacts@0 - # # displayName: "Download Terraform Artifact" - # # inputs: - # # buildType: 'current' - # # downloadType: 'single' - # # artifactName: 'terraformartifact' - # # downloadPath: '$(Build.SourcesDirectory)' - - # # - task: FileTransform@2 - # # displayName: "File Transform: functionaltests" - # # inputs: - # # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # # xmlTransformationRules: - # # jsonTargetFiles: '**/appsettings.json' - - # # - task: UseDotNet@2 - # # displayName: 'Use .NET SDK' - # # inputs: - # # packageType: sdk - # # useGlobalJson: true - # # workingDirectory: '$(Build.SourcesDirectory)' - - # # - task: AzureCLI@2 - # # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # # condition: always() - # # inputs: - # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # # scriptType: 'pscore' - # # scriptLocation: 'scriptPath' - # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIOEnabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIOEnabled' - # # testRunTitle: "Dev-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # # - task: AzureCLI@2 - # # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # # inputs: - # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # # scriptType: 'pscore' - # # scriptLocation: 'scriptPath' - # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIODisabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIODisabled' - # # testRunTitle: "Dev-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # # - task: AzureCLI@2 - # # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # # condition: always() - # # inputs: - # # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # # scriptType: 'pscore' - # # scriptLocation: 'scriptPath' - # # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - task: downloadbuildartifacts@0 + displayname: "download functional test artifact" + inputs: + buildtype: 'current' + downloadtype: 'single' + artifactname: 'functionaltests' + downloadpath: '$(build.sourcesdirectory)' + + - task: downloadbuildartifacts@0 + displayname: "download terraform artifact" + inputs: + buildtype: 'current' + downloadtype: 'single' + artifactname: 'terraformartifact' + downloadpath: '$(build.sourcesdirectory)' + + - task: filetransform@2 + displayname: "file transform: functionaltests" + inputs: + folderpath: '$(build.sourcesdirectory)/functionaltests/' + xmltransformationrules: + jsontargetfiles: '**/appsettings.json' + + - task: usedotnet@2 + displayname: 'use .net sdk' + inputs: + packagetype: sdk + useglobaljson: true + workingdirectory: '$(build.sourcesdirectory)' + + - task: azurecli@2 + displayname: "swap ess api and ess fulfilmentservice configuration aioenabled" + condition: always() + inputs: + azuresubscription: "exchange-set-service-dev-a-008-02" + scripttype: 'pscore' + scriptlocation: 'scriptpath' + scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(aioconfiguration.aiocells_ft) -aioenabled "true" -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' + + - task: dotnetcorecli@2 + displayname: "run functional tests aioenabled" + inputs: + command: "test" + projects: | + **/*functionaltest*.dll + !**/*testadapter.dll + !**/obj/** + arguments: '--filter category=smoketest-aioenabled' + testruntitle: "dev-automationtests" + workingdirectory: '$(build.sourcesdirectory)/functionaltests' + + - task: azurecli@2 + displayname: "swap ess api and ess fulfilmentservice configuration aiodisabled" + inputs: + azuresubscription: "exchange-set-service-dev-a-008-02" + scripttype: 'pscore' + scriptlocation: 'scriptpath' + scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(aioconfiguration.aiocells_ft) -aioenabled "false" -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' + + - task: dotnetcorecli@2 + displayname: "run functional tests aiodisabled" + inputs: + command: "test" + projects: | + **/*functionaltest*.dll + !**/*testadapter.dll + !**/obj/** + arguments: '--filter category=smoketest-aiodisabled' + testruntitle: "dev-automationtests" + workingdirectory: '$(build.sourcesdirectory)/functionaltests' + + - task: azurecli@2 + displayname: "swap ess api and ess fulfilmentservice configuration" + condition: always() + inputs: + azuresubscription: "exchange-set-service-dev-a-008-02" + scripttype: 'pscore' + scriptlocation: 'scriptpath' + scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(aioconfiguration.aiocells) -aioenabled $(aioconfiguration.aioenabled) -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' - deployment: DevDeployApp2 # dependsOn: DevDeployApp @@ -569,10 +569,10 @@ stages: - checkout: self submodules: recursive - - template: Deployment/templates/continuous-deployment-v2.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # - template: Deployment/templates/continuous-deployment-v2.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - template: Deployment/templates/continuous-deployment-apim-v2.yml parameters: From c7a8dbc52c32aab91e53f563ea7b3f137f44f66d Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 12:23:44 +0530 Subject: [PATCH 055/105] updated pipeline --- azure-pipelines.yml | 119 ++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 35d956d6f..7e0844b28 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -450,88 +450,89 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: downloadbuildartifacts@0 - displayname: "download functional test artifact" + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" inputs: - buildtype: 'current' - downloadtype: 'single' - artifactname: 'functionaltests' - downloadpath: '$(build.sourcesdirectory)' + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' - - task: downloadbuildartifacts@0 - displayname: "download terraform artifact" + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" inputs: - buildtype: 'current' - downloadtype: 'single' - artifactname: 'terraformartifact' - downloadpath: '$(build.sourcesdirectory)' + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' - - task: filetransform@2 - displayname: "file transform: functionaltests" + - task: FileTransform@2 + displayName: "File Transform: functionaltests" inputs: - folderpath: '$(build.sourcesdirectory)/functionaltests/' - xmltransformationrules: - jsontargetfiles: '**/appsettings.json' + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - - task: usedotnet@2 - displayname: 'use .net sdk' + - task: UseDotNet@2 + displayName: 'Use .NET SDK' inputs: - packagetype: sdk - useglobaljson: true - workingdirectory: '$(build.sourcesdirectory)' + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' - - task: azurecli@2 - displayname: "swap ess api and ess fulfilmentservice configuration aioenabled" + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" condition: always() inputs: - azuresubscription: "exchange-set-service-dev-a-008-02" - scripttype: 'pscore' - scriptlocation: 'scriptpath' - scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(aioconfiguration.aiocells_ft) -aioenabled "true" -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' - - - task: dotnetcorecli@2 - displayname: "run functional tests aioenabled" + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" inputs: command: "test" projects: | - **/*functionaltest*.dll - !**/*testadapter.dll + **/*FunctionalTest*.dll + !**/*TestAdapter.dll !**/obj/** - arguments: '--filter category=smoketest-aioenabled' - testruntitle: "dev-automationtests" - workingdirectory: '$(build.sourcesdirectory)/functionaltests' + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: azurecli@2 - displayname: "swap ess api and ess fulfilmentservice configuration aiodisabled" + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" inputs: - azuresubscription: "exchange-set-service-dev-a-008-02" - scripttype: 'pscore' - scriptlocation: 'scriptpath' - scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(aioconfiguration.aiocells_ft) -aioenabled "false" -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' - - - task: dotnetcorecli@2 - displayname: "run functional tests aiodisabled" + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" inputs: command: "test" projects: | - **/*functionaltest*.dll - !**/*testadapter.dll + **/*FunctionalTest*.dll + !**/*TestAdapter.dll !**/obj/** - arguments: '--filter category=smoketest-aiodisabled' - testruntitle: "dev-automationtests" - workingdirectory: '$(build.sourcesdirectory)/functionaltests' + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: azurecli@2 - displayname: "swap ess api and ess fulfilmentservice configuration" + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" condition: always() inputs: - azuresubscription: "exchange-set-service-dev-a-008-02" - scripttype: 'pscore' - scriptlocation: 'scriptpath' - scriptpath: "$(build.sourcesdirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(aioconfiguration.aiocells) -aioenabled $(aioconfiguration.aioenabled) -resourcegroup $(resource_group_name) -webappname $(web_app_name) -fulfilmentwebappsname $(fulfilmentwebappsname)' + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - deployment: DevDeployApp2 # dependsOn: DevDeployApp From 9ddd502a2b7b6f80f4585f847d9d03da33aa61c5 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 12:47:45 +0530 Subject: [PATCH 056/105] updated tf file --- Deployment/src/Modules/APIM/variables.tf | 24 +++++++++++-------- .../terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index f75c4fcaf..ad5a31fed 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -115,19 +115,23 @@ variable "suffix" { default = "" } +variable "pathsuffix" { + default = "" +} + locals { env_name = lower(terraform.workspace) service_name = "ess" - #group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - group_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") - #product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") - #ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - ui_product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") - #api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - api_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") - #apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" - apim_api_path = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") + group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" + #group_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") + product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + #product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + #ui_product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") + api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + #api_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") + apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" + #apim_api_path = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 99a7e1360..f8415df60 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" -var pathsuffix="-v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 7e011064a827eb3b41394eda55f08cb73dae975e Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 13:11:03 +0530 Subject: [PATCH 057/105] updated pipeline --- azure-pipelines.yml | 262 ++++++++++++++++++++++---------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e0844b28..131ee0099 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -400,138 +400,138 @@ stages: - stage: Devdeploy displayName: "Devdeploy (inc terraform, webapp deploy)" jobs: - - deployment: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - deployment: DevDeployApp + # displayName: "Dev - deploy terraform and dotnet App" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 From 15ea9cec3c758cd127532c603e73710d008c2635 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 13:30:28 +0530 Subject: [PATCH 058/105] updated variable --- Deployment/src/Modules/APIM/variables.tf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index ad5a31fed..e686611ea 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -123,15 +123,10 @@ locals { env_name = lower(terraform.workspace) service_name = "ess" group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - #group_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.group_name}" : "${var.group_name} ${var.env_suffix[local.env_name]}") product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - #product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.product_name}" : "${var.product_name} ${var.env_suffix[local.env_name]}") ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - #ui_product_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}") : (local.env_name == "prod" ? "${var.ui_product_name}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}") api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - #api_name = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" ) : (local.env_name == "prod" ? "${var.api_name}" : "${var.api_name} ${var.env_suffix[local.env_name]}") apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" - #apim_api_path = contains([var.suffix] , "v2") ? (local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}") : (local.env_name == "prod" ? "${local.service_name}" : "${local.service_name}-${local.env_name}") apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 919a15e7db83821948eabde2506f1fa901728763 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 14:03:56 +0530 Subject: [PATCH 059/105] updated variable --- Deployment/src/Modules/APIM/variables.tf | 2 +- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index e686611ea..9f48a281a 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -126,7 +126,7 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.pathsuffix}" : "${local.service_name}-${local.env_name}-${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index f8415df60..7c48a271c 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" -var pathsuffix="-v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" -var pathsuffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From fe6c4a3d8b743ca51687d1dde998128139d09cef Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 14:16:06 +0530 Subject: [PATCH 060/105] updated variable --- Deployment/src/Modules/APIM/variables.tf | 10 +++++----- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 9f48a281a..18352be84 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -122,11 +122,11 @@ variable "pathsuffix" { locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.pathsuffix}" : "${local.service_name}-${local.env_name}-${var.pathsuffix}" + group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 7c48a271c..d4eb28433 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix=" v2" -var pathsuffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" -var pathsuffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 6c7ee0f6b5e70b99ba2eb02380adc7e94629f2b3 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 14:33:50 +0530 Subject: [PATCH 061/105] updated variable --- Deployment/src/Modules/APIM/variables.tf | 4 ---- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 18352be84..70d70dd8f 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -115,10 +115,6 @@ variable "suffix" { default = "" } -variable "pathsuffix" { - default = "" -} - locals { env_name = lower(terraform.workspace) service_name = "ess" diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index d4eb28433..99a7e1360 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" -var pathsuffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 0a175cb1ad8b45d7474bf7e340d2deb8f0898570 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 14:56:44 +0530 Subject: [PATCH 062/105] updated terraform --- Deployment/terraform_conditional_run_apim_v2.ps1 | 4 ++-- Deployment/terraform_conditional_run_v2.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 99a7e1360..9969f32e7 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.v2.tfplan" -var suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.tfplan" +terraform apply "terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 65b32f161..14422b4d1 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -28,7 +28,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan" -terraform plan -out "terraform.deployment.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" -var storage_suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.deployment.v2.tfplan" -var elastic_apm_server_url=$elasticApmServerUrl -var elastic_apm_api_key=$elasticApmApiKey -var suffix="-v2" -var storage_suffix="v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.tfplan" +terraform apply "terraform.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" From f9163f3e6e6bdb93acf42f0960d64a2d64534b9a Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 15:45:52 +0530 Subject: [PATCH 063/105] updated pipeline --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 131ee0099..4f6c19386 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -570,10 +570,10 @@ stages: - checkout: self submodules: recursive - # - template: Deployment/templates/continuous-deployment-v2.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - template: Deployment/templates/continuous-deployment-apim-v2.yml parameters: From 1f605bc010b35123a4b03d2cb3f9f9d005dcbce4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 15:55:37 +0530 Subject: [PATCH 064/105] updated variable.tf --- Deployment/src/Modules/APIM/variables.tf | 14 +++++++++----- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 70d70dd8f..9f48a281a 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -115,14 +115,18 @@ variable "suffix" { default = "" } +variable "pathsuffix" { + default = "" +} + locals { env_name = lower(terraform.workspace) service_name = "ess" - group_name = local.env_name == "prod" ? "${var.group_name} ${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - product_name = local.env_name == "prod" ? "${var.product_name} ${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - ui_product_name = local.env_name == "prod" ? "${var.ui_product_name} ${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - api_name = local.env_name == "prod" ? "${var.api_name} ${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]} ${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.suffix}" : "${local.service_name}-${local.env_name}-${var.suffix}" + group_name = local.env_name == "prod" ? "${var.group_name}${var.suffix}" : "${var.group_name} ${var.env_suffix[local.env_name]}${var.suffix}" + product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" + api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.pathsuffix}" : "${local.service_name}-${local.env_name}-${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index 9969f32e7..d6d646ecc 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.v2.tfplan" -var suffix="v2" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.v2.tfplan" -var suffix=" v2" -var pathsuffix="-v2" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length From 58d137b1ae2ed2349c256639faa9afae06fb1318 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 16:34:20 +0530 Subject: [PATCH 065/105] updated variables --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 9f48a281a..e686611ea 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -126,7 +126,7 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" - apim_api_path = local.env_name == "prod" ? "${local.service_name}-${var.pathsuffix}" : "${local.service_name}-${local.env_name}-${var.pathsuffix}" + apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 130f2c6188d55181f3a5b8597d9b0bb04a239d88 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 16:50:31 +0530 Subject: [PATCH 066/105] updated ps files --- Deployment/terraform_conditional_run_apim.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index e14bf52eb..dab68f9ab 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -26,7 +26,7 @@ terraform validate if ( !$? ) { echo "Something went wrong during terraform validation" ; throw "Error" } Write-output "Execute Terraform plan..." -terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="" | tee terraform_output.txt +terraform plan -out "terraform.ess.apim.deployment.tfplan" -var suffix="" -var pathsuffix="" | tee terraform_output.txt if ( !$? ) { echo "Something went wrong during terraform plan" ; throw "Error" } $totalDestroyLines=(Get-Content -Path terraform_output.txt | Select-String -Pattern "destroy" -CaseSensitive | where {$_ -ne ""}).length @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.tfplan" +#terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file From aff265c6a4ae9f9761969b4a00f0f6c80557813b Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 18:40:57 +0530 Subject: [PATCH 067/105] updated pipeline --- azure-pipelines.yml | 98 ++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4f6c19386..0f04dc981 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -400,55 +400,55 @@ stages: - stage: Devdeploy displayName: "Devdeploy (inc terraform, webapp deploy)" jobs: - # - deployment: DevDeployApp - # displayName: "Dev - deploy terraform and dotnet App" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - deployment: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) # - task: DownloadBuildArtifacts@0 # displayName: "Download Functional test Artifact" From b0a69323ad2f43d535a3eda825f54c0be5d29355 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 19:34:29 +0530 Subject: [PATCH 068/105] updated pipeline --- Deployment/terraform_conditional_run_apim.ps1 | 2 +- azure-pipelines.yml | 164 +++++++++--------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index dab68f9ab..34b536e5f 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.tfplan" +terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0f04dc981..a79968515 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -450,88 +450,88 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 From 91d96d9e3dfc067604f028176994bee640cb11c4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 20:07:41 +0530 Subject: [PATCH 069/105] updated pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a79968515..4357554de 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -535,7 +535,7 @@ stages: - deployment: DevDeployApp2 - # dependsOn: DevDeployApp + dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for ESS UI" environment: "Ess-Dev" pool: $(DeploymentPool) From 23c6815e6b4fbf59800867d503a8927d2fadab86 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 22:48:29 +0530 Subject: [PATCH 070/105] updated tf file --- Deployment/src/Modules/APIM/azure.tf | 1 - Deployment/src/azure.tf | 1 - azure-pipelines.yml | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Deployment/src/Modules/APIM/azure.tf b/Deployment/src/Modules/APIM/azure.tf index a2d1f8b68..437f90782 100644 --- a/Deployment/src/Modules/APIM/azure.tf +++ b/Deployment/src/Modules/APIM/azure.tf @@ -9,7 +9,6 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - #key = "terraform.ess.apim.deployment.tfplan" } } diff --git a/Deployment/src/azure.tf b/Deployment/src/azure.tf index 94eca6485..ce4ce883c 100644 --- a/Deployment/src/azure.tf +++ b/Deployment/src/azure.tf @@ -9,7 +9,6 @@ terraform { required_version = "=1.7.2" backend "azurerm" { container_name = "tfstate" - #key = "terraform.deployment.tfplan" } } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4357554de..db0c1396a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -535,7 +535,7 @@ stages: - deployment: DevDeployApp2 - dependsOn: DevDeployApp + #dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for ESS UI" environment: "Ess-Dev" pool: $(DeploymentPool) From e1954571bc1aa7d730fa32bed465d318d3de7525 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 1 Mar 2024 23:30:19 +0530 Subject: [PATCH 071/105] updated pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index db0c1396a..4357554de 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -535,7 +535,7 @@ stages: - deployment: DevDeployApp2 - #dependsOn: DevDeployApp + dependsOn: DevDeployApp displayName: "Dev - deploy terraform and dotnet App for ESS UI" environment: "Ess-Dev" pool: $(DeploymentPool) From 1201f1363c7ff69cb547edb56c043ab4a6aa87bb Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 5 Mar 2024 10:20:17 +0530 Subject: [PATCH 072/105] updated azure pipeline --- azure-pipelines.yml | 1327 +++++++++++++++++++++++-------------------- 1 file changed, 706 insertions(+), 621 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4357554de..d739fbb82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -536,7 +536,7 @@ stages: - deployment: DevDeployApp2 dependsOn: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App for ESS UI" + displayName: "Dev - deploy terraform and dotnet App for FSS UI" environment: "Ess-Dev" pool: $(DeploymentPool) container: ${{variables.Container}} @@ -585,627 +585,712 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - stage: QCdeploy - # dependsOn: - # - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH - # displayName: "QCdeploy (inc terraform, mock webapp deploy)" - # jobs: - # - deployment: QCDeployApp - # displayName: "QC - deploy terraform and WebApps" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # #This variables are overridden since they are different from dev and we have used same library - # - name: "Environment" - # value: "qc" - # - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" - # value: 1 - # - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" - # value: 1 - # - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" - # value: 1 - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml - # parameters: - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=QCOnlyTest-AIOEnabled' - # testRunTitle: "QC-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=QCOnlyTest-AIODisabled' - # testRunTitle: "QC-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - # - stage: QAdeploy - # dependsOn: - # - Devdeploy - # - QCdeploy - # displayName: QAdeploy (inc terraform, webapp deploy) - # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - # jobs: - # - deployment: QADeployApp - # displayName: QA - deploy terraform and dotnet App - # environment: "Ess-Qa" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-QA" - # - group: "ESS-QA-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-QA-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - stage: QCdeploy + dependsOn: + - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH + displayName: "QCdeploy (inc terraform, mock webapp deploy)" + jobs: + - deployment: QCDeployApp + displayName: "QC - deploy terraform and WebApps" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + #This variables are overridden since they are different from dev and we have used same library + - name: "Environment" + value: "qc" + - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" + value: 1 + - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" + value: 1 + - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" + value: 1 + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml + parameters: + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=QCOnlyTest-AIOEnabled' + testRunTitle: "QC-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=QCOnlyTest-AIODisabled' + testRunTitle: "QC-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + - stage: QAdeploy + dependsOn: + - Devdeploy + - QCdeploy + displayName: QAdeploy (inc terraform, webapp deploy) + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + jobs: + - deployment: QADeployApp + displayName: QA - deploy terraform and dotnet App + environment: "Ess-Qa" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-QA" + - group: "ESS-QA-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-QA-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - job: Run_ADDS_E2E_tests - # displayName: Run ADDS E2E tests - # dependsOn: QADeployApp - # pool: $(DeploymentPool) - # variables: - # - group: "ADDS-E2E" - # container: ${{variables.Container}} - # steps: - # - task: PowerShell@2 - # displayName: "Run ADDS E2E pipeline tests" - # inputs: - # pwsh: true - # targetType: filePath - # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' - # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' - - # - stage: Livedeploy - # dependsOn: - # - QAdeploy - # displayName: Livedeploy (inc terraform, webapp deploy) - # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) - # jobs: - # - deployment: LiveDeployApp - # displayName: Live - deploy terraform and dotnet App - # environment: "Ess-Live" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-LIVE" - # - group: "ESS-Live-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # strategy: - # runOnce: - # deploy: - # steps: - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Live-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "UKHO-APIM-Live" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - # - job: PostDeploymentActions - # dependsOn: - # - LiveDeployApp - # pool: $(WindowPool) - # displayName: Post Deployment Actions - # steps: - # - template: Deployment/templates/retain-pipeline.yml - - # - stage: vnextiatDeploy - # dependsOn: - # - Devdeploy - # displayName: vNext IAT Deploy (inc terraform, webapp deploy) - # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) - # jobs: - # - deployment: vnextiatDeploy - # displayName: VnexT IAT - deploy terraform and dotnet App - # environment: "Ess-vnextiat" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-vNextIAT" - # - group: "ESS-vNextIAT-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "QA-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "QA-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - deployment: QADeployApp2 + dependsOn: QADeployApp + displayName: "QA - deploy terraform and dotnet App for FSS UI" + environment: "Ess-Qa" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-QA" + - group: "ESS-QA-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-QA-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + - job: Run_ADDS_E2E_tests + displayName: Run ADDS E2E tests + dependsOn: QADeployApp + pool: $(DeploymentPool) + variables: + - group: "ADDS-E2E" + container: ${{variables.Container}} + steps: + - task: PowerShell@2 + displayName: "Run ADDS E2E pipeline tests" + inputs: + pwsh: true + targetType: filePath + filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' + arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' + + - stage: Livedeploy + dependsOn: + - QAdeploy + displayName: Livedeploy (inc terraform, webapp deploy) + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + jobs: + - deployment: LiveDeployApp + displayName: Live - deploy terraform and dotnet App + environment: "Ess-Live" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-LIVE" + - group: "ESS-Live-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + strategy: + runOnce: + deploy: + steps: + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Live-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "UKHO-APIM-Live" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + - deployment: LiveDeployApp2 + dependsOn: LiveDeployApp + displayName: "Live - deploy terraform and dotnet App for FSS UI" + environment: "Ess-Live" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-LIVE" + - group: "ESS-Live-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + strategy: + runOnce: + deploy: + steps: + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Live-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "UKHO-APIM-Live" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + - job: PostDeploymentActions + dependsOn: + - LiveDeployApp2 + pool: $(WindowPool) + displayName: Post Deployment Actions + steps: + - template: Deployment/templates/retain-pipeline.yml + + - stage: vnextiatDeploy + dependsOn: + - Devdeploy + displayName: vNext IAT Deploy (inc terraform, webapp deploy) + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) + jobs: + - deployment: vnextiatDeploy + displayName: VnexT IAT - deploy terraform and dotnet App + environment: "Ess-vnextiat" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-vNextIAT" + - group: "ESS-vNextIAT-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET Core $(SdkVersion) sdk' - # inputs: - # packageType: sdk - # version: $(SdkVersion) - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIOEnabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIOEnabled' - # # testRunTitle: "QA-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIODisabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIODisabled' - # # testRunTitle: "QA-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - job: Run_ADDS_E2E_tests - # # displayName: Run ADDS E2E tests - # # dependsOn: vnextiatDeploy - # # pool: $(DeploymentPool) - # # variables: - # # - group: "ADDS-E2E" - # # container: ${{variables.Container}} - # # steps: - # # - task: PowerShell@2 - # # displayName: "Run ADDS E2E pipeline tests" - # # inputs: - # # pwsh: true - # # targetType: filePath - # # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' - # # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET Core $(SdkVersion) sdk' + inputs: + packageType: sdk + version: $(SdkVersion) + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-vNext-IAT-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - job: Run_ADDS_E2E_tests + # displayName: Run ADDS E2E tests + # dependsOn: vnextiatDeploy + # pool: $(DeploymentPool) + # variables: + # - group: "ADDS-E2E" + # container: ${{variables.Container}} + # steps: + # - task: PowerShell@2 + # displayName: "Run ADDS E2E pipeline tests" + # inputs: + # pwsh: true + # targetType: filePath + # filePath: '$(System.DefaultWorkingDirectory)/Deployment/ADDS-e2e-tests.ps1' + # arguments: '-queueSecret $(QueueSecret) -pollSecret $(PollSecret) -pollTimeInSecs $(PollTimeInSecs) -functionEndPoint $(FunctionEndPoint)' - # - stage: vnexte2eDeploy - # dependsOn: - # - vnextiatDeploy - # displayName: vNext E2E Deploy (inc terraform, webapp deploy) - # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) - # jobs: - # - deployment: E2EDeploy - # displayName: vnexte2e - deploy terraform and dotnet App - # environment: "Ess-vnexte2e" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-vNextE2E" - # - group: "ESS-vNextE2E-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - stage: vnexte2eDeploy + dependsOn: + - vnextiatDeploy + displayName: vNext E2E Deploy (inc terraform, webapp deploy) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) + jobs: + - deployment: E2EDeploy + displayName: vnexte2e - deploy terraform and dotnet App + environment: "Ess-vnexte2e" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-vNextE2E" + - group: "ESS-vNextE2E-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET Core $(SdkVersion) sdk' - # inputs: - # packageType: sdk - # version: $(SdkVersion) - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIOEnabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIOEnabled' - # # testRunTitle: "QA-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # # - task: DotNetCoreCLI@2 - # # displayName: "Run Functional tests AIODisabled" - # # inputs: - # # command: "test" - # # projects: | - # # **/*FunctionalTest*.dll - # # !**/*TestAdapter.dll - # # !**/obj/** - # # arguments: '--filter Category=SmokeTest-AIODisabled' - # # testRunTitle: "QA-AutomationTests" - # # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET Core $(SdkVersion) sdk' + inputs: + packageType: sdk + version: $(SdkVersion) + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-vNext-E2E-A.011.08" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' From 3af023d582dbb8f186f9cd7dfdad9977a2a110d1 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 6 Mar 2024 10:34:13 +0530 Subject: [PATCH 073/105] updated pipeline for qa deployment --- .../terraform_conditional_run_apim_v2.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- azure-pipelines.yml | 650 +++++++++--------- 3 files changed, 327 insertions(+), 327 deletions(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index d6d646ecc..da789b05a 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.v2.tfplan" +#terraform apply "terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 14422b4d1..0f8646a9f 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.v2.tfplan" +#terraform apply "terraform.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d739fbb82..385907cba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -397,334 +397,334 @@ stages: PathtoPublish: '$(Build.SourcesDirectory)\MockApiDeployment' ArtifactName: mockapiterraformartifact - - stage: Devdeploy - displayName: "Devdeploy (inc terraform, webapp deploy)" - jobs: - - deployment: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - stage: Devdeploy + # displayName: "Devdeploy (inc terraform, webapp deploy)" + # jobs: + # - deployment: DevDeployApp + # displayName: "Dev - deploy terraform and dotnet App" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - - deployment: DevDeployApp2 - dependsOn: DevDeployApp - displayName: "Dev - deploy terraform and dotnet App for FSS UI" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev2-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment-v2.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim-v2.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - - stage: QCdeploy - dependsOn: - - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH - displayName: "QCdeploy (inc terraform, mock webapp deploy)" - jobs: - - deployment: QCDeployApp - displayName: "QC - deploy terraform and WebApps" - environment: "Ess-Dev" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-DEV" - - group: "ESS-Dev-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - #This variables are overridden since they are different from dev and we have used same library - - name: "Environment" - value: "qc" - - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" - value: 1 - - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" - value: 1 - - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" - value: 1 - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml - parameters: - AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=QCOnlyTest-AIOEnabled' - testRunTitle: "QC-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=QCOnlyTest-AIODisabled' - testRunTitle: "QC-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + + # - deployment: DevDeployApp2 + # dependsOn: DevDeployApp + # displayName: "Dev - deploy terraform and dotnet App for FSS UI" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev2-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment-v2.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim-v2.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + # - stage: QCdeploy + # dependsOn: + # - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH + # displayName: "QCdeploy (inc terraform, mock webapp deploy)" + # jobs: + # - deployment: QCDeployApp + # displayName: "QC - deploy terraform and WebApps" + # environment: "Ess-Dev" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-DEV" + # - group: "ESS-Dev-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # #This variables are overridden since they are different from dev and we have used same library + # - name: "Environment" + # value: "qc" + # - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" + # value: 1 + # - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" + # value: 1 + # - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" + # value: 1 + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml + # parameters: + # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=QCOnlyTest-AIOEnabled' + # testRunTitle: "QC-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=QCOnlyTest-AIODisabled' + # testRunTitle: "QC-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - stage: QAdeploy dependsOn: - - Devdeploy - - QCdeploy + # - Devdeploy + # - QCdeploy displayName: QAdeploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: @@ -871,7 +871,7 @@ stages: clean: all variables: - group: "ESS-Deployment-Variables-QA" - - group: "ESS-QA-Variables" + - group: "ESS-QA2-Variables" - name: "ESSAzureADConfiguration.ClientId" value: $(ESSClientId) - name: "ESSAzureADConfiguration.TenantId" From e7a2bb3494d9cad1b125bd4eafb07923876a61f9 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 6 Mar 2024 10:40:11 +0530 Subject: [PATCH 074/105] updated pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 385907cba..b86a64846 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1011,7 +1011,7 @@ stages: - stage: vnextiatDeploy dependsOn: - - Devdeploy + # - Devdeploy displayName: vNext IAT Deploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) jobs: From 8e2ea6af3c74e7ad882248788129934961a2ea3e Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 6 Mar 2024 11:00:51 +0530 Subject: [PATCH 075/105] deploy pipeline --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b86a64846..a964043c8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -725,6 +725,7 @@ stages: dependsOn: # - Devdeploy # - QCdeploy + - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH displayName: QAdeploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: From 426f75e54d8f09925801b7a51b59b4052d1bea12 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 6 Mar 2024 11:11:11 +0530 Subject: [PATCH 076/105] updated pipeline --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a964043c8..2b01568f6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -725,9 +725,8 @@ stages: dependsOn: # - Devdeploy # - QCdeploy - - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH displayName: QAdeploy (inc terraform, webapp deploy) - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - deployment: QADeployApp displayName: QA - deploy terraform and dotnet App From 1971533b5348c1fe96e545073f0a382819cedf92 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 6 Mar 2024 11:24:04 +0530 Subject: [PATCH 077/105] updated pipeline --- Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_apim.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 0261f9bd9..00e1d9bc7 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.tfplan" +#terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index 34b536e5f..dab68f9ab 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.tfplan" +#terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file From b50c14ab34c80e5ad466b706aa23e3eb206871e2 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 7 Mar 2024 08:45:52 +0530 Subject: [PATCH 078/105] updated the pipeline --- azure-pipelines.yml | 264 ++++++++++++++++++++++---------------------- 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2b01568f6..a0b30c89b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -728,141 +728,141 @@ stages: displayName: QAdeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - - deployment: QADeployApp - displayName: QA - deploy terraform and dotnet App - environment: "Ess-Qa" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-QA" - - group: "ESS-QA-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.TenantId" - value: $(TenantId) - - name: "EssAuthorizationConfiguration.AutoTestClientId" - value: $(AutoTestClientId_Authed) - - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - value: $(AutoTestClientSecret_Authed) - - name: "EssAuthorizationConfiguration.EssClientId" - value: $(ESSClientId) - - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - value: $(AutoTestClientId_NoAuth) - - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - value: $(AutoTestClientSecret_NoAuth) - - name: "AzureAdB2CTestConfiguration.ClientSecret" - value: $(AUTOTEST-ESS-SECRET) - strategy: - runOnce: - deploy: - steps: - - checkout: self - submodules: recursive - - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-QA-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Fleet Manager Dev/Test" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - deployment: QADeployApp + # displayName: QA - deploy terraform and dotnet App + # environment: "Ess-Qa" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-QA" + # - group: "ESS-QA-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.TenantId" + # value: $(TenantId) + # - name: "EssAuthorizationConfiguration.AutoTestClientId" + # value: $(AutoTestClientId_Authed) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + # value: $(AutoTestClientSecret_Authed) + # - name: "EssAuthorizationConfiguration.EssClientId" + # value: $(ESSClientId) + # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + # value: $(AutoTestClientId_NoAuth) + # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + # value: $(AutoTestClientSecret_NoAuth) + # - name: "AzureAdB2CTestConfiguration.ClientSecret" + # value: $(AUTOTEST-ESS-SECRET) + # strategy: + # runOnce: + # deploy: + # steps: + # - checkout: self + # submodules: recursive + + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-QA-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Fleet Manager Dev/Test" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' - - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' - - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' + + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: QADeployApp2 - dependsOn: QADeployApp + #dependsOn: QADeployApp displayName: "QA - deploy terraform and dotnet App for FSS UI" environment: "Ess-Qa" pool: $(DeploymentPool) From 3fdeb17d91eeecdacb0cb15200aa4a4de5b8f9f6 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 7 Mar 2024 08:48:15 +0530 Subject: [PATCH 079/105] updated pipeline --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a0b30c89b..8c42ab56f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -914,7 +914,7 @@ stages: - job: Run_ADDS_E2E_tests displayName: Run ADDS E2E tests - dependsOn: QADeployApp + #dependsOn: QADeployApp pool: $(DeploymentPool) variables: - group: "ADDS-E2E" @@ -930,7 +930,7 @@ stages: - stage: Livedeploy dependsOn: - - QAdeploy + # - QAdeploy displayName: Livedeploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: From d3f1ee0e291b851bde09314674bc9f1e3e3740d8 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 7 Mar 2024 09:06:47 +0530 Subject: [PATCH 080/105] apply terraform command --- Deployment/terraform_conditional_run_v2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 0f8646a9f..14422b4d1 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -#terraform apply "terraform.deployment.v2.tfplan" +terraform apply "terraform.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" From 9b486b70fa093f2b3e970a82b22c139bee41fc0e Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Thu, 7 Mar 2024 15:48:51 +0530 Subject: [PATCH 081/105] updated pipeline --- Deployment/terraform_conditional_run_apim_v2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index da789b05a..d6d646ecc 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.v2.tfplan" +terraform apply "terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file From e4395e8d38df21d4325a538edbd79e51ae7d89e4 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Fri, 8 Mar 2024 22:30:17 +0530 Subject: [PATCH 082/105] updated main.tf --- Deployment/src/Modules/Webapp/main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Deployment/src/Modules/Webapp/main.tf b/Deployment/src/Modules/Webapp/main.tf index e04a2a3df..c91a16ffb 100644 --- a/Deployment/src/Modules/Webapp/main.tf +++ b/Deployment/src/Modules/Webapp/main.tf @@ -35,6 +35,12 @@ resource "azurerm_app_service" "webapp_service" { } } + lifecycle { + ignore_changes = [ + ip_restriction, + ] + } + app_settings = var.app_settings identity { From 888dae19ce42e6d233eaadb51c4c2924b3b68c74 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Sun, 10 Mar 2024 13:07:43 +0530 Subject: [PATCH 083/105] Revert "updated main.tf" This reverts commit e4395e8d38df21d4325a538edbd79e51ae7d89e4. --- Deployment/src/Modules/Webapp/main.tf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Deployment/src/Modules/Webapp/main.tf b/Deployment/src/Modules/Webapp/main.tf index c91a16ffb..e04a2a3df 100644 --- a/Deployment/src/Modules/Webapp/main.tf +++ b/Deployment/src/Modules/Webapp/main.tf @@ -35,12 +35,6 @@ resource "azurerm_app_service" "webapp_service" { } } - lifecycle { - ignore_changes = [ - ip_restriction, - ] - } - app_settings = var.app_settings identity { From 26178bbac825232b5e271e063695e01732599760 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 12 Mar 2024 19:54:43 +0530 Subject: [PATCH 084/105] updated pipeline for qa deployment --- Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_apim.ps1 | 2 +- azure-pipelines.yml | 270 +++++++++--------- 3 files changed, 138 insertions(+), 136 deletions(-) diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 00e1d9bc7..0261f9bd9 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -#terraform apply "terraform.deployment.tfplan" +terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index dab68f9ab..34b536e5f 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.tfplan" +terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c42ab56f..ddeebc44a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -728,141 +728,141 @@ stages: displayName: QAdeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - # - deployment: QADeployApp - # displayName: QA - deploy terraform and dotnet App - # environment: "Ess-Qa" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-QA" - # - group: "ESS-QA-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-QA-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - deployment: QADeployApp + displayName: QA - deploy terraform and dotnet App + environment: "Ess-Qa" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-QA" + - group: "ESS-QA-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-QA-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "QA-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-QA-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "QA-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "QA-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-QA-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: QADeployApp2 - #dependsOn: QADeployApp + dependsOn: QADeployApp displayName: "QA - deploy terraform and dotnet App for FSS UI" environment: "Ess-Qa" pool: $(DeploymentPool) @@ -914,7 +914,9 @@ stages: - job: Run_ADDS_E2E_tests displayName: Run ADDS E2E tests - #dependsOn: QADeployApp + dependsOn: + - QADeployApp + - QADeployApp2 pool: $(DeploymentPool) variables: - group: "ADDS-E2E" @@ -930,7 +932,7 @@ stages: - stage: Livedeploy dependsOn: - # - QAdeploy + - QAdeploy displayName: Livedeploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: From 9fb243755a946125b952a30f0f150a6e5286f5df Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 12 Mar 2024 20:01:59 +0530 Subject: [PATCH 085/105] updated live deployment pipeline --- azure-pipelines.yml | 67 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ddeebc44a..af4f3c9d7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -936,38 +936,38 @@ stages: displayName: Livedeploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - - deployment: LiveDeployApp - displayName: Live - deploy terraform and dotnet App - environment: "Ess-Live" - pool: $(DeploymentPool) - container: ${{variables.Container}} - workspace: - clean: all - variables: - - group: "ESS-Deployment-Variables-LIVE" - - group: "ESS-Live-Variables" - - name: "ESSAzureADConfiguration.ClientId" - value: $(ESSClientId) - - name: "ESSAzureADConfiguration.TenantId" - value: $(TenantId) - strategy: - runOnce: - deploy: - steps: - - template: Deployment/templates/continuous-deployment.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "Exchange-Set-Service-Live-A-008-02" - - - template: Deployment/templates/continuous-deployment-apim.yml - parameters: - ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - AzureSubscription: "UKHO-APIM-Live" - TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - APIMServiceInstance: $(APIM_SERVICE_NAME) - tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + # - deployment: LiveDeployApp + # displayName: Live - deploy terraform and dotnet App + # environment: "Ess-Live" + # pool: $(DeploymentPool) + # container: ${{variables.Container}} + # workspace: + # clean: all + # variables: + # - group: "ESS-Deployment-Variables-LIVE" + # - group: "ESS-Live-Variables" + # - name: "ESSAzureADConfiguration.ClientId" + # value: $(ESSClientId) + # - name: "ESSAzureADConfiguration.TenantId" + # value: $(TenantId) + # strategy: + # runOnce: + # deploy: + # steps: + # - template: Deployment/templates/continuous-deployment.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "Exchange-Set-Service-Live-A-008-02" + + # - template: Deployment/templates/continuous-deployment-apim.yml + # parameters: + # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + # AzureSubscription: "UKHO-APIM-Live" + # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + # APIMServiceInstance: $(APIM_SERVICE_NAME) + # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - deployment: LiveDeployApp2 dependsOn: LiveDeployApp @@ -979,7 +979,7 @@ stages: clean: all variables: - group: "ESS-Deployment-Variables-LIVE" - - group: "ESS-Live-Variables" + - group: "ESS-Live2-Variables" - name: "ESSAzureADConfiguration.ClientId" value: $(ESSClientId) - name: "ESSAzureADConfiguration.TenantId" @@ -1005,6 +1005,7 @@ stages: - job: PostDeploymentActions dependsOn: + - LiveDeployApp - LiveDeployApp2 pool: $(WindowPool) displayName: Post Deployment Actions From ece536bf6a7c00c810a4ac6af08a0863a239b055 Mon Sep 17 00:00:00 2001 From: Amogh14893 Date: Tue, 12 Mar 2024 20:18:50 +0530 Subject: [PATCH 086/105] added vulnerability suppression code in nvdsuppression.xml --- NVDSuppressions.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NVDSuppressions.xml b/NVDSuppressions.xml index 968fa2643..6f441278c 100644 --- a/NVDSuppressions.xml +++ b/NVDSuppressions.xml @@ -463,4 +463,14 @@ CVE-2024-21907 + + + + + CVE-2024-21386 + CVE-2024-21404 + From 126a88606b37c3574860d9f47e8ae4fb247526c6 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 12 Mar 2024 20:21:29 +0530 Subject: [PATCH 087/105] updated pipeline --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index af4f3c9d7..610717087 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -970,7 +970,7 @@ stages: # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - deployment: LiveDeployApp2 - dependsOn: LiveDeployApp + #dependsOn: LiveDeployApp displayName: "Live - deploy terraform and dotnet App for FSS UI" environment: "Ess-Live" pool: $(DeploymentPool) @@ -1005,7 +1005,7 @@ stages: - job: PostDeploymentActions dependsOn: - - LiveDeployApp + #- LiveDeployApp - LiveDeployApp2 pool: $(WindowPool) displayName: Post Deployment Actions From 9a0c25ad6a44729abd8b70bf42c9caeb879f43cd Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Tue, 12 Mar 2024 21:27:42 +0530 Subject: [PATCH 088/105] updated pipeline with live stage --- .../templates/continuous-deployment-v2.yml | 118 ++-- .../terraform_conditional_run_apim_v2.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- azure-pipelines.yml | 652 +++++++++--------- 4 files changed, 387 insertions(+), 387 deletions(-) diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml index 89e6e08da..e9f788d79 100644 --- a/Deployment/templates/continuous-deployment-v2.yml +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - - task: FileTransform@2 - displayName: "File Transform: WebJob" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - - task: AzureCLI@2 - displayName: "Azure Fulfilment Webjob Deployment" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + # - task: FileTransform@2 + # displayName: "File Transform: WebJob" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' + # - task: AzureCLI@2 + # displayName: "Azure Fulfilment Webjob Deployment" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - - task: FileTransform@2 - displayName: "File Transform: WebAppSettings" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' - - task: AzureWebApp@1 - displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - appType: webApp - appName: "$(WEB_APP_NAME)" - package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - deployToSlotOrASE: true - slotName: $(WEB_APP_SLOT_NAME) + # - task: FileTransform@2 + # displayName: "File Transform: WebAppSettings" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # - task: AzureWebApp@1 + # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # appType: webApp + # appName: "$(WEB_APP_NAME)" + # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + # deployToSlotOrASE: true + # slotName: $(WEB_APP_SLOT_NAME) - # - task: PowerShell@2 - # displayName: "Check the status of production slot" + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot" # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot - Rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # # - task: PowerShell@2 + # # displayName: "Check the status of production slot" + # # inputs: + # # targetType: filePath + # # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - # - task: PowerShell@2 - # displayName: "Check the status of production slot after rollback" + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot - Rollback" # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) # inputs: - # targetType: filePath - # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) + + # # - task: PowerShell@2 + # # displayName: "Check the status of production slot after rollback" + # # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # # inputs: + # # targetType: filePath + # # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index d6d646ecc..da789b05a 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.v2.tfplan" +#terraform apply "terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 14422b4d1..0f8646a9f 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.v2.tfplan" +#terraform apply "terraform.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 610717087..9655c09a2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -397,334 +397,334 @@ stages: PathtoPublish: '$(Build.SourcesDirectory)\MockApiDeployment' ArtifactName: mockapiterraformartifact - # - stage: Devdeploy - # displayName: "Devdeploy (inc terraform, webapp deploy)" - # jobs: - # - deployment: DevDeployApp - # displayName: "Dev - deploy terraform and dotnet App" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - stage: Devdeploy + displayName: "Devdeploy (inc terraform, webapp deploy)" + jobs: + - deployment: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIOEnabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=SmokeTest-AIODisabled' - # testRunTitle: "Dev-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - - # - deployment: DevDeployApp2 - # dependsOn: DevDeployApp - # displayName: "Dev - deploy terraform and dotnet App for FSS UI" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev2-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: Deployment/templates/continuous-deployment-v2.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim-v2.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Fleet Manager Dev/Test" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - # - stage: QCdeploy - # dependsOn: - # - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH - # displayName: "QCdeploy (inc terraform, mock webapp deploy)" - # jobs: - # - deployment: QCDeployApp - # displayName: "QC - deploy terraform and WebApps" - # environment: "Ess-Dev" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-DEV" - # - group: "ESS-Dev-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.TenantId" - # value: $(TenantId) - # - name: "EssAuthorizationConfiguration.AutoTestClientId" - # value: $(AutoTestClientId_Authed) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecret" - # value: $(AutoTestClientSecret_Authed) - # - name: "EssAuthorizationConfiguration.EssClientId" - # value: $(ESSClientId) - # - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" - # value: $(AutoTestClientId_NoAuth) - # - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" - # value: $(AutoTestClientSecret_NoAuth) - # - name: "AzureAdB2CTestConfiguration.ClientSecret" - # value: $(AUTOTEST-ESS-SECRET) - # #This variables are overridden since they are different from dev and we have used same library - # - name: "Environment" - # value: "qc" - # - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" - # value: 1 - # - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" - # value: 1 - # - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" - # value: 1 - # strategy: - # runOnce: - # deploy: - # steps: - # - checkout: self - # submodules: recursive - - # - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml - # parameters: - # AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Functional test Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'functionaltests' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: DownloadBuildArtifacts@0 - # displayName: "Download Terraform Artifact" - # inputs: - # buildType: 'current' - # downloadType: 'single' - # artifactName: 'terraformartifact' - # downloadPath: '$(Build.SourcesDirectory)' - - # - task: FileTransform@2 - # displayName: "File Transform: functionaltests" - # inputs: - # folderPath: '$(Build.SourcesDirectory)/functionaltests/' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' - - # - task: UseDotNet@2 - # displayName: 'Use .NET SDK' - # inputs: - # packageType: sdk - # useGlobalJson: true - # workingDirectory: '$(Build.SourcesDirectory)' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIOEnabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=QCOnlyTest-AIOEnabled' - # testRunTitle: "QC-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - - # - task: DotNetCoreCLI@2 - # displayName: "Run Functional tests AIODisabled" - # inputs: - # command: "test" - # projects: | - # **/*FunctionalTest*.dll - # !**/*TestAdapter.dll - # !**/obj/** - # arguments: '--filter Category=QCOnlyTest-AIODisabled' - # testRunTitle: "QC-AutomationTests" - # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - # - task: AzureCLI@2 - # displayName: "Swap ESS API and ESS FulfilmentService Configuration" - # condition: always() - # inputs: - # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIOEnabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=SmokeTest-AIODisabled' + testRunTitle: "Dev-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + + + - deployment: DevDeployApp2 + dependsOn: DevDeployApp + displayName: "Dev - deploy terraform and dotnet App for FSS UI" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev2-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: Deployment/templates/continuous-deployment-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim-v2.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Fleet Manager Dev/Test" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + + - stage: QCdeploy + dependsOn: + - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH + displayName: "QCdeploy (inc terraform, mock webapp deploy)" + jobs: + - deployment: QCDeployApp + displayName: "QC - deploy terraform and WebApps" + environment: "Ess-Dev" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-DEV" + - group: "ESS-Dev-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.TenantId" + value: $(TenantId) + - name: "EssAuthorizationConfiguration.AutoTestClientId" + value: $(AutoTestClientId_Authed) + - name: "EssAuthorizationConfiguration.AutoTestClientSecret" + value: $(AutoTestClientSecret_Authed) + - name: "EssAuthorizationConfiguration.EssClientId" + value: $(ESSClientId) + - name: "EssAuthorizationConfiguration.AutoTestClientIdNoAuth" + value: $(AutoTestClientId_NoAuth) + - name: "EssAuthorizationConfiguration.AutoTestClientSecretNoAuth" + value: $(AutoTestClientSecret_NoAuth) + - name: "AzureAdB2CTestConfiguration.ClientSecret" + value: $(AUTOTEST-ESS-SECRET) + #This variables are overridden since they are different from dev and we have used same library + - name: "Environment" + value: "qc" + - name: "ESSFulfilmentConfiguration.SmallExchangeSetInstance" + value: 1 + - name: "ESSFulfilmentConfiguration.MediumExchangeSetInstance" + value: 1 + - name: "ESSFulfilmentConfiguration.LargeExchangeSetInstance" + value: 1 + strategy: + runOnce: + deploy: + steps: + - checkout: self + submodules: recursive + + - template: MockApiDeployment/templates/mock-api-continuous-deployment.yml + parameters: + AzureSubscription: "Exchange-Set-Service-Dev-A-008-02" + + - task: DownloadBuildArtifacts@0 + displayName: "Download Functional test Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'functionaltests' + downloadPath: '$(Build.SourcesDirectory)' + + - task: DownloadBuildArtifacts@0 + displayName: "Download Terraform Artifact" + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'terraformartifact' + downloadPath: '$(Build.SourcesDirectory)' + + - task: FileTransform@2 + displayName: "File Transform: functionaltests" + inputs: + folderPath: '$(Build.SourcesDirectory)/functionaltests/' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + useGlobalJson: true + workingDirectory: '$(Build.SourcesDirectory)' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIOEnabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=QCOnlyTest-AIOEnabled' + testRunTitle: "QC-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' + + - task: DotNetCoreCLI@2 + displayName: "Run Functional tests AIODisabled" + inputs: + command: "test" + projects: | + **/*FunctionalTest*.dll + !**/*TestAdapter.dll + !**/obj/** + arguments: '--filter Category=QCOnlyTest-AIODisabled' + testRunTitle: "QC-AutomationTests" + workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + + - task: AzureCLI@2 + displayName: "Swap ESS API and ESS FulfilmentService Configuration" + condition: always() + inputs: + azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - stage: QAdeploy dependsOn: - # - Devdeploy - # - QCdeploy + - Devdeploy + - QCdeploy displayName: QAdeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: @@ -934,7 +934,7 @@ stages: dependsOn: - QAdeploy displayName: Livedeploy (inc terraform, webapp deploy) - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: # - deployment: LiveDeployApp # displayName: Live - deploy terraform and dotnet App @@ -1014,7 +1014,7 @@ stages: - stage: vnextiatDeploy dependsOn: - # - Devdeploy + - Devdeploy displayName: vNext IAT Deploy (inc terraform, webapp deploy) condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) jobs: From cbb3b9278188e2ba56223598cc165ea31811dc5c Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 19:26:45 +0530 Subject: [PATCH 089/105] updated pipeline for live deployment --- .../templates/continuous-deployment.yml | 122 +++--- Deployment/terraform_conditional_run.ps1 | 2 +- Deployment/terraform_conditional_run_apim.ps1 | 2 +- azure-pipelines.yml | 362 +++++++++--------- 4 files changed, 244 insertions(+), 244 deletions(-) diff --git a/Deployment/templates/continuous-deployment.yml b/Deployment/templates/continuous-deployment.yml index 5b98816ef..572e7fea4 100644 --- a/Deployment/templates/continuous-deployment.yml +++ b/Deployment/templates/continuous-deployment.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - - task: FileTransform@2 - displayName: "File Transform: WebJob" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: WebJob" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureCLI@2 - displayName: "Azure Fulfilment Webjob Deployment" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + # - task: AzureCLI@2 + # displayName: "Azure Fulfilment Webjob Deployment" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - - task: FileTransform@2 - displayName: "File Transform: WebAppSettings" - inputs: - folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: WebAppSettings" + # inputs: + # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: AzureWebApp@1 - displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - appType: webApp - appName: "$(WEB_APP_NAME)" - package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - deployToSlotOrASE: true - slotName: $(WEB_APP_SLOT_NAME) + # - task: AzureWebApp@1 + # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # appType: webApp + # appName: "$(WEB_APP_NAME)" + # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + # deployToSlotOrASE: true + # slotName: $(WEB_APP_SLOT_NAME) - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot" - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot" + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot" - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + # - task: PowerShell@2 + # displayName: "Check the status of production slot" + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - - task: AzureAppServiceManage@0 - displayName: "Swap with production slot - Rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - azureSubscription: "${{ parameters.AzureSubscription }}" - resourceGroupName: $(RESOURCE_GROUP_NAME) - webAppName: $(WEB_APP_NAME) - action: "Swap Slots" - swapWithProduction: true - sourceSlot: $(WEB_APP_SLOT_NAME) + # - task: AzureAppServiceManage@0 + # displayName: "Swap with production slot - Rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # azureSubscription: "${{ parameters.AzureSubscription }}" + # resourceGroupName: $(RESOURCE_GROUP_NAME) + # webAppName: $(WEB_APP_NAME) + # action: "Swap Slots" + # swapWithProduction: true + # sourceSlot: $(WEB_APP_SLOT_NAME) - - task: PowerShell@2 - displayName: "Check the status of production slot after rollback" - condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - inputs: - targetType: filePath - filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + # - task: PowerShell@2 + # displayName: "Check the status of production slot after rollback" + # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + # inputs: + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/terraform_conditional_run.ps1 b/Deployment/terraform_conditional_run.ps1 index 0261f9bd9..00e1d9bc7 100644 --- a/Deployment/terraform_conditional_run.ps1 +++ b/Deployment/terraform_conditional_run.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -terraform apply "terraform.deployment.tfplan" +#terraform apply "terraform.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/Deployment/terraform_conditional_run_apim.ps1 b/Deployment/terraform_conditional_run_apim.ps1 index 34b536e5f..dab68f9ab 100644 --- a/Deployment/terraform_conditional_run_apim.ps1 +++ b/Deployment/terraform_conditional_run_apim.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -terraform apply "terraform.ess.apim.deployment.tfplan" +#terraform apply "terraform.ess.apim.deployment.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9655c09a2..09dc68628 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -450,88 +450,88 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "Dev-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "Dev-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-Dev-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-Dev-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: DevDeployApp2 @@ -778,88 +778,88 @@ stages: tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - - task: DownloadBuildArtifacts@0 - displayName: "Download Functional test Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'functionaltests' - downloadPath: '$(Build.SourcesDirectory)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Functional test Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'functionaltests' + # downloadPath: '$(Build.SourcesDirectory)' - - task: DownloadBuildArtifacts@0 - displayName: "Download Terraform Artifact" - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'terraformartifact' - downloadPath: '$(Build.SourcesDirectory)' + # - task: DownloadBuildArtifacts@0 + # displayName: "Download Terraform Artifact" + # inputs: + # buildType: 'current' + # downloadType: 'single' + # artifactName: 'terraformartifact' + # downloadPath: '$(Build.SourcesDirectory)' - - task: FileTransform@2 - displayName: "File Transform: functionaltests" - inputs: - folderPath: '$(Build.SourcesDirectory)/functionaltests/' - xmlTransformationRules: - jsonTargetFiles: '**/appsettings.json' + # - task: FileTransform@2 + # displayName: "File Transform: functionaltests" + # inputs: + # folderPath: '$(Build.SourcesDirectory)/functionaltests/' + # xmlTransformationRules: + # jsonTargetFiles: '**/appsettings.json' - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIOEnabled" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "true" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIOEnabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIOEnabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIOEnabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIOEnabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration AIODisabled" + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells_FT) -aioenabled "false" -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - - task: DotNetCoreCLI@2 - displayName: "Run Functional tests AIODisabled" - inputs: - command: "test" - projects: | - **/*FunctionalTest*.dll - !**/*TestAdapter.dll - !**/obj/** - arguments: '--filter Category=SmokeTest-AIODisabled' - testRunTitle: "QA-AutomationTests" - workingDirectory: '$(Build.SourcesDirectory)/functionaltests' + # - task: DotNetCoreCLI@2 + # displayName: "Run Functional tests AIODisabled" + # inputs: + # command: "test" + # projects: | + # **/*FunctionalTest*.dll + # !**/*TestAdapter.dll + # !**/obj/** + # arguments: '--filter Category=SmokeTest-AIODisabled' + # testRunTitle: "QA-AutomationTests" + # workingDirectory: '$(Build.SourcesDirectory)/functionaltests' - - task: AzureCLI@2 - displayName: "Swap ESS API and ESS FulfilmentService Configuration" - condition: always() - inputs: - azureSubscription: "Exchange-Set-Service-QA-A-008-02" - scriptType: 'pscore' - scriptLocation: 'scriptPath' - scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" - arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' + # - task: AzureCLI@2 + # displayName: "Swap ESS API and ESS FulfilmentService Configuration" + # condition: always() + # inputs: + # azureSubscription: "Exchange-Set-Service-QA-A-008-02" + # scriptType: 'pscore' + # scriptLocation: 'scriptPath' + # scriptPath: "$(Build.SourcesDirectory)/terraformartifact/set_api_webjob_aio_feature_configuration.ps1" + # arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(RESOURCE_GROUP_NAME) -webappname $(WEB_APP_NAME) -fulfilmentwebappsname $(fulfilmentWebAppsName)' - deployment: QADeployApp2 dependsOn: QADeployApp @@ -936,41 +936,41 @@ stages: displayName: Livedeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - # - deployment: LiveDeployApp - # displayName: Live - deploy terraform and dotnet App - # environment: "Ess-Live" - # pool: $(DeploymentPool) - # container: ${{variables.Container}} - # workspace: - # clean: all - # variables: - # - group: "ESS-Deployment-Variables-LIVE" - # - group: "ESS-Live-Variables" - # - name: "ESSAzureADConfiguration.ClientId" - # value: $(ESSClientId) - # - name: "ESSAzureADConfiguration.TenantId" - # value: $(TenantId) - # strategy: - # runOnce: - # deploy: - # steps: - # - template: Deployment/templates/continuous-deployment.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "Exchange-Set-Service-Live-A-008-02" - - # - template: Deployment/templates/continuous-deployment-apim.yml - # parameters: - # ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} - # AzureSubscription: "UKHO-APIM-Live" - # TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) - # APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) - # APIMServiceInstance: $(APIM_SERVICE_NAME) - # tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) - # tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) + - deployment: LiveDeployApp + displayName: Live - deploy terraform and dotnet App + environment: "Ess-Live" + pool: $(DeploymentPool) + container: ${{variables.Container}} + workspace: + clean: all + variables: + - group: "ESS-Deployment-Variables-LIVE" + - group: "ESS-Live-Variables" + - name: "ESSAzureADConfiguration.ClientId" + value: $(ESSClientId) + - name: "ESSAzureADConfiguration.TenantId" + value: $(TenantId) + strategy: + runOnce: + deploy: + steps: + - template: Deployment/templates/continuous-deployment.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "Exchange-Set-Service-Live-A-008-02" + + - template: Deployment/templates/continuous-deployment-apim.yml + parameters: + ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }} + AzureSubscription: "UKHO-APIM-Live" + TerraformKeyVault: $(APIM_TERRAFORM_KEYVAULT) + APIMResourceGroup: $(APIM_RESOURCE_GROUP_NAME) + APIMServiceInstance: $(APIM_SERVICE_NAME) + tfstateStorageAccountRG: $(APIM_TFSTATE_STORAGE_ACCOUNT_RG) + tfstateStorageAccountName: $(APIM_TFSTATE_STORAGE_ACCOUNT_NAME) - deployment: LiveDeployApp2 - #dependsOn: LiveDeployApp + dependsOn: LiveDeployApp displayName: "Live - deploy terraform and dotnet App for FSS UI" environment: "Ess-Live" pool: $(DeploymentPool) From 20692365fbd3a0c748e811e84bacfd74f226216c Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 22:07:49 +0530 Subject: [PATCH 090/105] updated pipeline --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 09dc68628..41d97e04f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -932,7 +932,7 @@ stages: - stage: Livedeploy dependsOn: - - QAdeploy + #- QAdeploy displayName: Livedeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: From 39363ac8f91f56d4e7043c008b57d8ae7fc6db05 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 22:38:00 +0530 Subject: [PATCH 091/105] updated storage deployment variable --- Deployment/src/Modules/CacheStorage/main.tf | 2 +- Deployment/src/Modules/CacheStorage/variables.tf | 7 +------ Deployment/src/main.tf | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Deployment/src/Modules/CacheStorage/main.tf b/Deployment/src/Modules/CacheStorage/main.tf index 937cc01ae..82e3f4e0c 100644 --- a/Deployment/src/Modules/CacheStorage/main.tf +++ b/Deployment/src/Modules/CacheStorage/main.tf @@ -1,5 +1,5 @@ resource "azurerm_storage_account" "ess_cache_storage" { - name = lower("${var.service_name}${var.env_name}cachestorageukho${var.suffix}") + name = lower("${var.name}") resource_group_name = var.resource_group_name location = var.location account_tier = "Standard" diff --git a/Deployment/src/Modules/CacheStorage/variables.tf b/Deployment/src/Modules/CacheStorage/variables.tf index e3a681bc3..a1ffbe7b6 100644 --- a/Deployment/src/Modules/CacheStorage/variables.tf +++ b/Deployment/src/Modules/CacheStorage/variables.tf @@ -6,10 +6,6 @@ variable "location" { type = string } -variable "env_name" { - type = string -} - variable "tags" { } @@ -38,6 +34,5 @@ variable "medium_exchange_set_subnets" { variable "large_exchange_set_subnets" { } -variable "suffix" { - default = "" +variable name { } \ No newline at end of file diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 92ef89d23..90f0efeda 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -222,6 +222,7 @@ module "azure-dashboard" { } module "cache_storage" { source = "./Modules/CacheStorage" + name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${var.service_name}${var.env_name}cachestorageukho2"" : "${var.service_name}${var.env_name}cachestorageukho${var.suffix}" resource_group_name = azurerm_resource_group.rg.name allowed_ips = var.allowed_ips location = var.location @@ -231,7 +232,5 @@ module "cache_storage" { large_exchange_set_subnets = data.azurerm_subnet.large_exchange_set_subnet[*].id m_spoke_subnet = data.azurerm_subnet.main_subnet.id agent_subnet = data.azurerm_subnet.agent_subnet.id - env_name = local.env_name service_name = local.service_name - suffix = var.storage_suffix } \ No newline at end of file From 85e06231a57e5854c8c6ebd9b1f77d17ccca2086 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 23:03:53 +0530 Subject: [PATCH 092/105] updated pipeline --- Deployment/src/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index 90f0efeda..a0067b0f8 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -222,7 +222,7 @@ module "azure-dashboard" { } module "cache_storage" { source = "./Modules/CacheStorage" - name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${var.service_name}${var.env_name}cachestorageukho2"" : "${var.service_name}${var.env_name}cachestorageukho${var.suffix}" + name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${var.service_name}${var.env_name}cachestorageukho2" : "${var.service_name}${var.env_name}cachestorageukho${var.suffix}" resource_group_name = azurerm_resource_group.rg.name allowed_ips = var.allowed_ips location = var.location From 072004b28275845a77a39a290c053ba73c26730a Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 23:15:29 +0530 Subject: [PATCH 093/105] updated variable name in main.tf --- Deployment/src/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index a0067b0f8..b94c5c338 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -222,7 +222,7 @@ module "azure-dashboard" { } module "cache_storage" { source = "./Modules/CacheStorage" - name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${var.service_name}${var.env_name}cachestorageukho2" : "${var.service_name}${var.env_name}cachestorageukho${var.suffix}" + name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${local.service_name}${local.env_name}cachestorageukho2" : "${local.service_name}${local.env_name}cachestorageukho${var.suffix}" resource_group_name = azurerm_resource_group.rg.name allowed_ips = var.allowed_ips location = var.location From ec7e664ba88632dfbb879e1a9ec278affd596a3b Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 23:23:54 +0530 Subject: [PATCH 094/105] updated pipeline --- azure-pipelines.yml | 180 ++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41d97e04f..720ef4e97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,96 +85,96 @@ stages: displayName: "Build (inc DependencyChecker, Dotnet Build , dotnet test and publish artifact )" dependsOn: [] jobs: - - job: Dependencychecker - workspace: - clean: all - displayName: "Dependencychecker" - steps: - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: DotNetCoreCLI@2 - displayName: ".Net Core - NuGet restore non test projects only" - inputs: - command: "restore" - projects: | - **/*.csproj - !**/*Tests.csproj - feedsToUse: config - noCache: true - nugetConfigPath: '$(Build.SourcesDirectory)\BuildNuget.config' - workingDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API' - packagesDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API\packages' - - - task: CmdLine@1 - displayName: "Run OWASP Dependency Checker" - inputs: - filename: 'dependency-check.bat' - arguments: '--project "Exchange-Set-Service - $(Build.SourceBranchName)" --scan "$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API" --out "$(Build.ArtifactStagingDirectory)\DCReport" --suppression $(Build.SourcesDirectory)\NVDSuppressions.xml --noupdate' - - - task: PublishBuildArtifacts@1 - displayName: "Publish Artifact: OWASP Dependency Checker Report" - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\DCReport' - ArtifactName: "OWASP Dependency Checker Report" - - - task: PowerShell@1 - displayName: "Fail Build if Dependency Check Finds Any Vulnerabilities" - inputs: - scriptType: inlineScript - arguments: '-ReportLocation $(Build.ArtifactStagingDirectory)\DCReport\*' - inlineScript: | - param($ReportLocation) - Invoke-VulnerabilityCheck -ReportLocation $ReportLocation - - - job: UnitTestsAndCodeCoverage - workspace: - clean: all - displayName: "Dotnet Test and Publish Code Coverage" - steps: - - task: UseDotNet@2 - displayName: 'Use .NET SDK' - inputs: - packageType: sdk - useGlobalJson: true - workingDirectory: '$(Build.SourcesDirectory)' - - - task: DotNetCoreCLI@2 - displayName: ".Net Core - NuGet restore test projects only" - inputs: - command: "restore" - projects: "**/*Tests.csproj" - feedsToUse: config - noCache: true - nugetConfigPath: '$(Build.SourcesDirectory)\BuildNuget.config' - workingDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API' - packagesDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API\packagesForTests' - - - task: DotNetCoreCLI@2 - displayName: "dotnet test - Perform Unit Tests" - inputs: - command: "test" - projects: "**/*UnitTests.csproj" - arguments: '--configuration $(BuildConfiguration) --settings "$(Build.SourcesDirectory)\test.runsettings" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' - publishTestResults: true - testRunTitle: "UnitTests" - - - task: PowerShell@2 - displayName: "Generate code coverage report" - inputs: - targetType: filePath - filePath: '$(Build.SourcesDirectory)\CodeCoverageReport.ps1' - arguments: '-source "$(Build.SourcesDirectory)" -reportFolder "$(Build.ArtifactStagingDirectory)"' - - - task: PublishBuildArtifacts@1 - displayName: "Publish Code coverage" - inputs: - PathtoPublish: "$(Build.ArtifactStagingDirectory)/codecoveragereport" - ArtifactName: codecoveragereport + # - job: Dependencychecker + # workspace: + # clean: all + # displayName: "Dependencychecker" + # steps: + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: DotNetCoreCLI@2 + # displayName: ".Net Core - NuGet restore non test projects only" + # inputs: + # command: "restore" + # projects: | + # **/*.csproj + # !**/*Tests.csproj + # feedsToUse: config + # noCache: true + # nugetConfigPath: '$(Build.SourcesDirectory)\BuildNuget.config' + # workingDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API' + # packagesDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API\packages' + + # - task: CmdLine@1 + # displayName: "Run OWASP Dependency Checker" + # inputs: + # filename: 'dependency-check.bat' + # arguments: '--project "Exchange-Set-Service - $(Build.SourceBranchName)" --scan "$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API" --out "$(Build.ArtifactStagingDirectory)\DCReport" --suppression $(Build.SourcesDirectory)\NVDSuppressions.xml --noupdate' + + # - task: PublishBuildArtifacts@1 + # displayName: "Publish Artifact: OWASP Dependency Checker Report" + # inputs: + # PathtoPublish: '$(Build.ArtifactStagingDirectory)\DCReport' + # ArtifactName: "OWASP Dependency Checker Report" + + # - task: PowerShell@1 + # displayName: "Fail Build if Dependency Check Finds Any Vulnerabilities" + # inputs: + # scriptType: inlineScript + # arguments: '-ReportLocation $(Build.ArtifactStagingDirectory)\DCReport\*' + # inlineScript: | + # param($ReportLocation) + # Invoke-VulnerabilityCheck -ReportLocation $ReportLocation + + # - job: UnitTestsAndCodeCoverage + # workspace: + # clean: all + # displayName: "Dotnet Test and Publish Code Coverage" + # steps: + # - task: UseDotNet@2 + # displayName: 'Use .NET SDK' + # inputs: + # packageType: sdk + # useGlobalJson: true + # workingDirectory: '$(Build.SourcesDirectory)' + + # - task: DotNetCoreCLI@2 + # displayName: ".Net Core - NuGet restore test projects only" + # inputs: + # command: "restore" + # projects: "**/*Tests.csproj" + # feedsToUse: config + # noCache: true + # nugetConfigPath: '$(Build.SourcesDirectory)\BuildNuget.config' + # workingDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API' + # packagesDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API\packagesForTests' + + # - task: DotNetCoreCLI@2 + # displayName: "dotnet test - Perform Unit Tests" + # inputs: + # command: "test" + # projects: "**/*UnitTests.csproj" + # arguments: '--configuration $(BuildConfiguration) --settings "$(Build.SourcesDirectory)\test.runsettings" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' + # publishTestResults: true + # testRunTitle: "UnitTests" + + # - task: PowerShell@2 + # displayName: "Generate code coverage report" + # inputs: + # targetType: filePath + # filePath: '$(Build.SourcesDirectory)\CodeCoverageReport.ps1' + # arguments: '-source "$(Build.SourcesDirectory)" -reportFolder "$(Build.ArtifactStagingDirectory)"' + + # - task: PublishBuildArtifacts@1 + # displayName: "Publish Code coverage" + # inputs: + # PathtoPublish: "$(Build.ArtifactStagingDirectory)/codecoveragereport" + # ArtifactName: codecoveragereport - job: BuildAndPublishAPI workspace: From 127d9e3e94b2771ca467e9888c802550af7ef290 Mon Sep 17 00:00:00 2001 From: tejasi15072 Date: Wed, 13 Mar 2024 23:48:16 +0530 Subject: [PATCH 095/105] updated variable --- Deployment/src/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/main.tf b/Deployment/src/main.tf index b94c5c338..13b354065 100644 --- a/Deployment/src/main.tf +++ b/Deployment/src/main.tf @@ -222,7 +222,7 @@ module "azure-dashboard" { } module "cache_storage" { source = "./Modules/CacheStorage" - name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${local.service_name}${local.env_name}cachestorageukho2" : "${local.service_name}${local.env_name}cachestorageukho${var.suffix}" + name = local.env_name == "prod" && var.storage_suffix == "v2" ? "${local.service_name}${local.env_name}cachestorageukho2" : "${local.service_name}${local.env_name}cachestorageukho${var.storage_suffix}" resource_group_name = azurerm_resource_group.rg.name allowed_ips = var.allowed_ips location = var.location From 0fc9405c82628ad6f3a8293033638b2e88aa8fe8 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 28 Mar 2024 11:48:34 +0000 Subject: [PATCH 096/105] uncommenting changes --- .../templates/continuous-deployment-v2.yml | 118 +++++++++--------- .../terraform_conditional_run_apim_v2.ps1 | 2 +- Deployment/terraform_conditional_run_v2.ps1 | 2 +- azure-pipelines.yml | 4 +- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/Deployment/templates/continuous-deployment-v2.yml b/Deployment/templates/continuous-deployment-v2.yml index e9f788d79..89e6e08da 100644 --- a/Deployment/templates/continuous-deployment-v2.yml +++ b/Deployment/templates/continuous-deployment-v2.yml @@ -33,72 +33,72 @@ steps: TF_VAR_agent_subnet_name: $(agentSubnetName) TF_VAR_agent_subscription_id: $(agentSubscriptionId) - # - task: FileTransform@2 - # displayName: "File Transform: WebJob" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebJob" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetService/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureCLI@2 - # displayName: "Azure Fulfilment Webjob Deployment" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # scriptType: 'pscore' - # scriptLocation: 'scriptPath' - # scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' - # arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' + - task: AzureCLI@2 + displayName: "Azure Fulfilment Webjob Deployment" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + scriptType: 'pscore' + scriptLocation: 'scriptPath' + scriptPath: '$(Pipeline.Workspace)/terraformartifact/fulfilment_webjob_deployment.ps1' + arguments: '-terraformJsonOutputFile $(Pipeline.Workspace)/terraformartifact/terraform_output.json -packagePath "$(Pipeline.Workspace)/ExchangeSetService" -packageName "ExchangeSetFulFilmentService.zip"' - # - task: FileTransform@2 - # displayName: "File Transform: WebAppSettings" - # inputs: - # folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' - # xmlTransformationRules: - # jsonTargetFiles: '**/appsettings.json' + - task: FileTransform@2 + displayName: "File Transform: WebAppSettings" + inputs: + folderPath: '$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/*.zip' + xmlTransformationRules: + jsonTargetFiles: '**/appsettings.json' - # - task: AzureWebApp@1 - # displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" - # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # appType: webApp - # appName: "$(WEB_APP_NAME)" - # package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" - # deployToSlotOrASE: true - # slotName: $(WEB_APP_SLOT_NAME) + - task: AzureWebApp@1 + displayName: "Azure App Deploy: ess-$(Environment)-webapp to Staging slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + appType: webApp + appName: "$(WEB_APP_NAME)" + package: "$(Pipeline.Workspace)/ExchangeSetServiceWebAPI/UKHO.ExchangeSetService.API.zip" + deployToSlotOrASE: true + slotName: $(WEB_APP_SLOT_NAME) - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot" + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot" + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) + + # - task: PowerShell@2 + # displayName: "Check the status of production slot" # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" - # # - task: PowerShell@2 - # # displayName: "Check the status of production slot" - # # inputs: - # # targetType: filePath - # # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 1" + - task: AzureAppServiceManage@0 + displayName: "Swap with production slot - Rollback" + condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) + inputs: + azureSubscription: "${{ parameters.AzureSubscription }}" + resourceGroupName: $(RESOURCE_GROUP_NAME) + webAppName: $(WEB_APP_NAME) + action: "Swap Slots" + swapWithProduction: true + sourceSlot: $(WEB_APP_SLOT_NAME) - # - task: AzureAppServiceManage@0 - # displayName: "Swap with production slot - Rollback" + # - task: PowerShell@2 + # displayName: "Check the status of production slot after rollback" # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) # inputs: - # azureSubscription: "${{ parameters.AzureSubscription }}" - # resourceGroupName: $(RESOURCE_GROUP_NAME) - # webAppName: $(WEB_APP_NAME) - # action: "Swap Slots" - # swapWithProduction: true - # sourceSlot: $(WEB_APP_SLOT_NAME) - - # # - task: PowerShell@2 - # # displayName: "Check the status of production slot after rollback" - # # condition: and(succeeded(), eq(variables['IS_HEALTHY'], 'false')) - # # inputs: - # # targetType: filePath - # # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" - # # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" + # targetType: filePath + # filePath: "$(Pipeline.Workspace)/terraformartifact/check_service_status.ps1" + # arguments: "-healthEndPointUrl $(EssApiUrl)/health -waitTimeInMinute $(waitTimeInMinute) -onErrorContinue 0" diff --git a/Deployment/terraform_conditional_run_apim_v2.ps1 b/Deployment/terraform_conditional_run_apim_v2.ps1 index da789b05a..d6d646ecc 100644 --- a/Deployment/terraform_conditional_run_apim_v2.ps1 +++ b/Deployment/terraform_conditional_run_apim_v2.ps1 @@ -43,5 +43,5 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply..." -#terraform apply "terraform.ess.apim.deployment.v2.tfplan" +terraform apply "terraform.ess.apim.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } \ No newline at end of file diff --git a/Deployment/terraform_conditional_run_v2.ps1 b/Deployment/terraform_conditional_run_v2.ps1 index 0f8646a9f..14422b4d1 100644 --- a/Deployment/terraform_conditional_run_v2.ps1 +++ b/Deployment/terraform_conditional_run_v2.ps1 @@ -45,7 +45,7 @@ if($totalDestroyLines -ge 2) } Write-output "Executing terraform apply" -#terraform apply "terraform.deployment.v2.tfplan" +terraform apply "terraform.deployment.v2.tfplan" if ( !$? ) { echo "Something went wrong during terraform apply" ; throw "Error" } Write-output "Terraform output as json" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 720ef4e97..d357230bb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -932,9 +932,9 @@ stages: - stage: Livedeploy dependsOn: - #- QAdeploy + - QAdeploy displayName: Livedeploy (inc terraform, webapp deploy) - #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: - deployment: LiveDeployApp displayName: Live - deploy terraform and dotnet App From 922e8b09c299d273867ce70bf6ec174af1834cac Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 15:02:23 +0100 Subject: [PATCH 097/105] added ess ui api back --- .../APIM/Modules/ExchangeSetService/main.tf | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/Modules/ExchangeSetService/main.tf b/Deployment/src/Modules/APIM/Modules/ExchangeSetService/main.tf index 8d3e282aa..12a6e328c 100644 --- a/Deployment/src/Modules/APIM/Modules/ExchangeSetService/main.tf +++ b/Deployment/src/Modules/APIM/Modules/ExchangeSetService/main.tf @@ -226,12 +226,42 @@ resource "azurerm_api_management_product_api" "ess_ui_product_api_mapping" { product_id = azurerm_api_management_product.ess_ui_product.product_id } +resource "azurerm_api_management_api" "ess_ui_api" { + resource_group_name = data.azurerm_resource_group.rg.name + api_management_name = data.azurerm_api_management.apim_instance.name + name = lower(replace(var.apim_ui_api_name, " ", "-")) + display_name = var.apim_ui_api_name + description = var.apim_ui_api_description + revision = "1" + path = var.apim_ui_api_path + protocols = ["https"] + service_url = var.apim_api_backend_url + + subscription_key_parameter_names { + header = "Ocp-Apim-Subscription-Key" + query = "subscription-key" + } + + import { + content_format = "openapi" + content_value = var.apim_ui_openapi + } +} + +# Add ESS UI API to ESS Product +resource "azurerm_api_management_product_api" "ess_product_ui_api_mapping" { + resource_group_name = data.azurerm_resource_group.rg.name + api_management_name = data.azurerm_api_management.apim_instance.name + api_name = azurerm_api_management_api.ess_ui_api.name + product_id = azurerm_api_management_product.ess_ui_product.product_id +} + # ESS UI Product poliy resource "azurerm_api_management_product_policy" "ess_ui_product_policy" { resource_group_name = data.azurerm_resource_group.rg.name api_management_name = data.azurerm_api_management.apim_instance.name product_id = azurerm_api_management_product.ess_ui_product.product_id - depends_on = [azurerm_api_management_product.ess_ui_product, azurerm_api_management_product_api.ess_ui_product_api_mapping] + depends_on = [azurerm_api_management_product.ess_ui_product, azurerm_api_management_product_api.ess_ui_product_api_mapping, azurerm_api_management_product_api.ess_product_ui_api_mapping] xml_content = < From 0ccf3f48f208d2041e1e931faa1164334a36b101 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 15:23:20 +0100 Subject: [PATCH 098/105] fixed apim vars --- .../APIM/Modules/ExchangeSetService/variables.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Deployment/src/Modules/APIM/Modules/ExchangeSetService/variables.tf b/Deployment/src/Modules/APIM/Modules/ExchangeSetService/variables.tf index f4d12f7ef..54d2b9c96 100644 --- a/Deployment/src/Modules/APIM/Modules/ExchangeSetService/variables.tf +++ b/Deployment/src/Modules/APIM/Modules/ExchangeSetService/variables.tf @@ -14,6 +14,10 @@ variable "apim_api_path" { type = string } +variable "apim_ui_api_path" { + type = string +} + variable "apim_api_backend_url" { type = string description = "The URL of the backend service serving the API." @@ -51,10 +55,22 @@ variable "apim_api_description" { type = string } +variable "apim_ui_api_name" { + type = string +} + +variable "apim_ui_api_description" { + type = string +} + variable "apim_api_openapi" { type = string } +variable "apim_ui_openapi" { + type = string +} + variable "client_credentials_operation_id" { type = string } From 0a42e1ee89db9c28f049887f8945297ce7845d32 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 15:24:35 +0100 Subject: [PATCH 099/105] updated apim main.tf --- Deployment/src/Modules/APIM/main.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/main.tf b/Deployment/src/Modules/APIM/main.tf index 50aae6f13..065f572dc 100644 --- a/Deployment/src/Modules/APIM/main.tf +++ b/Deployment/src/Modules/APIM/main.tf @@ -3,15 +3,19 @@ module "exchange_set_service" { apim_name = var.apim_name apim_rg = var.apim_rg env_name = local.env_name - apim_api_path = local.apim_api_path + apim_api_path = local.apim_api_path + apim_ui_api_path = local.apim_ui_api_path apim_api_backend_url = var.apim_api_backend_url apim_group_name = local.group_name apim_group_description = var.group_description apim_ess_product_name = local.product_name apim_ess_product_description = var.product_description apim_api_name = local.api_name + apim_ui_api_name = local.ui_api_name apim_api_description = var.api_description + apim_ui_api_description = var.ui_api_description apim_api_openapi = local.apim_api_openapi + apim_ui_openapi = local.apim_ui_openapi product_rate_limit = var.product_rate_limit product_quota = var.product_quota client_credentials_operation_id = var.client_credentials_operation_id From 3aad3d9184fa93af2561394ae43b81fdc596807a Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 16:35:28 +0100 Subject: [PATCH 100/105] added ui api definition --- Deployment/src/Modules/APIM/variables.tf | 13 + exchangeSetService_Ui_OpenApi_definition.yaml | 352 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 exchangeSetService_Ui_OpenApi_definition.yaml diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index e686611ea..f927159fe 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -40,6 +40,16 @@ variable "api_description" { default = "The Exchange Set Service APIs to request ENC Exchange Sets for loading onto an ECDIS." } +variable "ui_api_name" { + type = string + default = "The Exchange Set Service UI API" +} + +variable "ui_api_description" { + type = string + default = "The Exchange Set Service UI api to facilitate ESS UI Application Requests." +} + variable "ui_product_name" { type = string default = "Exchange Set Service UI" @@ -126,7 +136,10 @@ locals { product_name = local.env_name == "prod" ? "${var.product_name}${var.suffix}" : "${var.product_name} ${var.env_suffix[local.env_name]}${var.suffix}" ui_product_name = local.env_name == "prod" ? "${var.ui_product_name}${var.suffix}" : "${var.ui_product_name} ${var.env_suffix[local.env_name]}${var.suffix}" api_name = local.env_name == "prod" ? "${var.api_name}${var.suffix}" : "${var.api_name} ${var.env_suffix[local.env_name]}${var.suffix}" + ui_api_name = local.env_name == "prod" ? "${var.ui_api_name}${var.suffix}" : "${var.ui_api_name} ${var.env_suffix[local.env_name]}${var.suffix}" apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" + apim_ui_api_path = local.env_name == "prod" ? "${local.service_name}-ui-${var.pathsuffix}" : "${local.service_name}-ui-${local.env_name}${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") + apim_ui_openapi = file("${path.module}/exchangeSetService_UI_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/exchangeSetService_Ui_OpenApi_definition.yaml b/exchangeSetService_Ui_OpenApi_definition.yaml new file mode 100644 index 000000000..823e0c6ce --- /dev/null +++ b/exchangeSetService_Ui_OpenApi_definition.yaml @@ -0,0 +1,352 @@ +openapi: "3.0.0" +info: + version: "0.3" + title: Exchange Set Service UI API + description: | + This API is for the Exchange Set Service UI. + contact: + name: Martin Rock-Evans + email: martin.rock-evans@ukho.gov.uk + +externalDocs: + url: https://github.com/UKHO/exchange-set-service + +servers: + - url: https://exchangeset.admiralty.co.uk/avcsData/[version]/ + +security: + - jwtBearerAuth: [] + +paths: + /productInformation/productIdentifiers: + post: + summary: Provide ENC information from sales catalog service. + + operationId: postProductIdentifiers + + description: | + Given a list of ENC name identifiers, return all the versions of the ENCs from sales catalog service. + + requestBody: + description: | + The JSON body containing product identifiers. + content: + application/json: + schema: + $ref: "#/components/schemas/productIdentifiers" + example: ["GB102505", "GB100160", "AU334550"] + + responses: + "200": + description: A JSON body that containing the information of ENCs. + content: + application/json: + schema: + $ref: "#/components/schemas/scsResponse" + + "400": + description: Bad request. + content: + application/json: + schema: + $ref: "#/components/schemas/errorDescription" + + "401": + $ref: "#/components/responses/unauthorised" + + "403": + $ref: "#/components/responses/forbidden" + + "429": + $ref: "#/components/responses/tooManyRequests" + + "500": + $ref: "#/components/responses/internalServerError" + + + /productInformation: + get: + summary: Get all releasable changes to products since a date + description: | + Given a datetime, get all ENC versions that have been issued since that datetime. + + operationId: getProducts + + parameters: + - $ref: "#/components/parameters/sinceDateTime" + + responses: + "200": + description: A JSON body of product objects + headers: + Last-Modified: + schema: + $ref: "#/components/schemas/Date-Header" + content: + application/json: + schema: + $ref: "#/components/schemas/scsResponse" + + "304": + description: Not modified. + headers: + Last-Modified: + schema: + $ref: "#/components/schemas/Date-Header" + + "400": + description: Bad request. + content: + application/json: + schema: + $ref: "#/components/schemas/errorDescription" + + "401": + $ref: "#/components/responses/unauthorised" + + "403": + $ref: "#/components/responses/forbidden" + + "429": + $ref: "#/components/responses/tooManyRequests" + + "500": + $ref: "#/components/responses/internalServerError" + + +components: + ################################################################################ + # Parameter Definitions # + ################################################################################ + + parameters: + sinceDateTime: + in: query + name: sinceDateTime + required: true + description: | + The date and time from which changes are requested. Any changes since the date will be returned. The date is in RFC 1123 format. The date and time must be within 28 days and cannot be in future. + schema: + type: string + format: date-time + example: Wed, 21 Oct 2015 07:28:00 GMT + + ################################################################################ + # Common Response Definitions # + ################################################################################ + + responses: + unauthorised: + description: Unauthorised - either you have not provided any credentials, or your credentials are not recognised. + + forbidden: + description: Forbidden - you have been authorised, but you are not allowed to access this resource. + + tooManyRequests: + description: You have sent too many requests in a given amount of time. Please back-off for the time in the Retry-After header (in seconds) and try again. + headers: + Retry-After: + schema: + type: integer + description: Specifies the time you should wait in seconds before retrying. + + internalServerError: + description: Internal Server Error. + content: + application/json: + schema: + $ref: "#/components/schemas/DefaultErrorResponse" + + ################################################################################ + # Object Definitions # + ################################################################################ + + schemas: + #################################### + # Request Objects # + #################################### + + productIdentifiers: + type: array + items: + type: string + + #################################### + # Response Objects # + #################################### + + scsResponse: + type: object + required: + - "products" + - "productCounts" + properties: + products: + type: array + items: + type: object + required: + - "productName" + - "editionNumber" + - "updateNumbers" + - "fileSize" + properties: + productName: + type: string + description: The unique product identifiers + example: "GB102505" + editionNumber: + type: integer + description: The edition number + example: 1 + updateNumbers: + type: array + description: an array of update numbers + items: + type: integer + description: The update number, including update 0 if relevant + example: [0,1,2] + dates: + type: array + items: + type: object + description: issue and update dates + properties: + updateNumber: + type: integer + description: The update number, including update 0 if relevant + updateApplicationDate: + type: string + format: date-time + description: | + The update application date for the catalog.031 UADT data field + The base cell issue date or, for re-issues, the issue date of the previous update + This is optional if not relevant + example: "2019-10-27T00:00:00Z" + issueDate: + type: string + format: date-time + description: | + The issue date for the catalog.031 ISDT data field + example: "2019-10-27T00:00:00Z" + cancellation: + type: object + description: The details of the cancellation, if one exists + properties: + editionNumber: + type: integer + description: The edition number of the cancellation, i.e. 0 + updateNumber: + type: integer + description: The cancellation update number + example: {"editionNumber": 0, "updateNumber": 8} + fileSize: + type: integer + description: The total file size in bytes of all the files for this product + example: 2012 + ignoreCache: + type: boolean + bundle: + type: array + description: | + Collection of physical bundles that are associated with the latest update of this product + items: + type: object + properties: + bundleType: + type: string + description: | + Media type of the bundle, which can be one of the following values:- DVD + example: "DVD" + location: + type: string + description: | + DVDs: This field is divided into two subfields delimited by a semi colon. + The first subfield contains the media number ID and the second the exchange set number. + The Media ID is designated with a M followed by a number. + + Examples: + - base cell: "M1;B3", + - updates: "M2;U1" + example: "M1;B3" + productCounts: + type: object + required: + - "requestedProductsNotReturned" + properties: + requestedProductCount: + type: integer + description: number of products explicitly requested. + returnedProductCount: + type: integer + description: number of products that have data included in the produced exchange set. + requestedProductsAlreadyUpToDateCount: + type: integer + requestedProductsNotReturned: + type: array + description: | + Where a requested product is not included in the return, the product will be listed in the requestedProductNotReturned portion of the response along with a reason. The reason will be one of: + * productWithdrawn (the product has been withdrawn from the AVCS service) + * invalidProduct (the product is not part of the AVCS Service, i.e. is an invalid or unknown ENC) + * noDataAvailableForCancelledProduct (the product has been cancelled, and is beyond the retention period. Cancelled cells within the retention period will be returned with the cancellation data in the exchange set) + * duplicateProduct (the product was included in the request more than once) + items: + type: object + required: + - "productName" + - "reason" + properties: + productName: + type: string + example: "GB102505" + reason: + type: string + enum: [productWithdrawn, invalidProduct, noDataAvailableForCancelledProduct, duplicateProduct] + + Date-Header: + type: string + format: date-time + description: | + Returns the current date and time on the server and should be used in subsequent requests to the productData operation to ensure that there are no gaps due to minor time difference between your own and UKHO systems. The date format is in RFC 1123 format. + example: Wed, 21 Oct 2015 07:28:00 GMT + + #################################### + # Error Response Objects # + #################################### + + DefaultErrorResponse: + type: object + title: Error + properties: + correlationId: + type: string + detail: + type: string + + errorDescription: + type: object + properties: + correlationId: + type: string + errors: + type: array + items: + $ref: "#/components/schemas/fieldError" + + fieldError: + type: object + properties: + source: + type: string + description: + type: string + + #################################### + # Security Objects # + #################################### + + securitySchemes: + jwtBearerAuth: + type: http + scheme: bearer + bearerFormat: JWT \ No newline at end of file From 30261773aaa30dda6bd86a249fd72ba7b4035251 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 17:07:18 +0100 Subject: [PATCH 101/105] added copyfile task --- Deployment/src/Modules/APIM/variables.tf | 2 +- azure-pipelines.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index f927159fe..66d8f3d46 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -140,6 +140,6 @@ locals { apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" apim_ui_api_path = local.env_name == "prod" ? "${local.service_name}-ui-${var.pathsuffix}" : "${local.service_name}-ui-${local.env_name}${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") - apim_ui_openapi = file("${path.module}/exchangeSetService_UI_OpenApi_definition.yaml") + apim_ui_openapi = file("${path.module}/exchangeSetService_UI_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf6160c1c..31efab8d7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -336,6 +336,13 @@ stages: SourceFolder: '$(Build.SourcesDirectory)' Contents: 'exchangeSetService_OpenApi_definition.yaml' TargetFolder: '$(Build.SourcesDirectory)\Deployment\src\Modules\APIM' + + - task: CopyFiles@2 + displayName: "Copy OpenAPI spec for new UI API for deployment" + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: 'exchangeSetService_Ui_OpenApi_definition.yaml' + TargetFolder: '$(Build.SourcesDirectory)\Deployment\src\Modules\APIM' - task: PublishBuildArtifacts@1 displayName: "Publish terraform Artifacts" From d9c06c1e36c378269b9036c3cb1dee0285505f91 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 17:16:01 +0100 Subject: [PATCH 102/105] fixed casing in filename --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 66d8f3d46..9baae18e6 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -140,6 +140,6 @@ locals { apim_api_path = local.env_name == "prod" ? "${local.service_name}${var.pathsuffix}" : "${local.service_name}-${local.env_name}${var.pathsuffix}" apim_ui_api_path = local.env_name == "prod" ? "${local.service_name}-ui-${var.pathsuffix}" : "${local.service_name}-ui-${local.env_name}${var.pathsuffix}" apim_api_openapi = file("${path.module}/exchangeSetService_OpenApi_definition.yaml") - apim_ui_openapi = file("${path.module}/exchangeSetService_UI_OpenApi_definition.yaml") + apim_ui_openapi = file("${path.module}/exchangeSetService_Ui_OpenApi_definition.yaml") cors_origins = split(";", var.cors_origin_values) } \ No newline at end of file From 5c666c84c561f8046ce2f7139c578da305a49175 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Thu, 4 Apr 2024 17:24:40 +0100 Subject: [PATCH 103/105] updated ui api name --- Deployment/src/Modules/APIM/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deployment/src/Modules/APIM/variables.tf b/Deployment/src/Modules/APIM/variables.tf index 9baae18e6..17446fd10 100644 --- a/Deployment/src/Modules/APIM/variables.tf +++ b/Deployment/src/Modules/APIM/variables.tf @@ -42,7 +42,7 @@ variable "api_description" { variable "ui_api_name" { type = string - default = "The Exchange Set Service UI API" + default = "Exchange Set Service UI API" } variable "ui_api_description" { From d36778b49c8967ee71d4401244d441666da5e2d1 Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Fri, 5 Apr 2024 16:18:16 +0100 Subject: [PATCH 104/105] added QA into pipeline --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31efab8d7..740fd1b32 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -750,9 +750,9 @@ stages: arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - stage: QAdeploy - dependsOn: - - Devdeploy - - QCdeploy + # dependsOn: + # - Devdeploy + # - QCdeploy displayName: QAdeploy (inc terraform, webapp deploy) #condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) jobs: From ea55e59b7c16c6bf343e143b916e547ccf21b1dc Mon Sep 17 00:00:00 2001 From: MattWin90 Date: Mon, 8 Apr 2024 16:15:34 +0100 Subject: [PATCH 105/105] made QA deployable without dependson --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 740fd1b32..d22161786 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -750,7 +750,8 @@ stages: arguments: '-aiocells $(AioConfiguration.AioCells) -aioenabled $(AioConfiguration.AioEnabled) -resourcegroup $(webAppResourceGroup) -webappname $(essWebAppName) -fulfilmentwebappsname $(essFulfilmentWebAppname)' - stage: QAdeploy - # dependsOn: + dependsOn: + - PERFORM_DEPENDENCYCHECK_DOTNETBUILD_DOTNETTEST_AND_PUBLISH # - Devdeploy # - QCdeploy displayName: QAdeploy (inc terraform, webapp deploy)