From f72fe19ebfa2d9045ab1c29efd9d463a384fa5f1 Mon Sep 17 00:00:00 2001 From: Sebastian Meine Date: Fri, 19 Apr 2024 16:52:14 -0400 Subject: [PATCH 1/8] using new " azureSubscription: 'tSQLt CI - Nightly Cleanup - Service Connection'" to authenticate --- CI/Azure-DevOps/AZ_NightlyCleanup.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CI/Azure-DevOps/AZ_NightlyCleanup.yml b/CI/Azure-DevOps/AZ_NightlyCleanup.yml index b88be5c78..01f0e6c83 100644 --- a/CI/Azure-DevOps/AZ_NightlyCleanup.yml +++ b/CI/Azure-DevOps/AZ_NightlyCleanup.yml @@ -35,7 +35,7 @@ steps: AZURE_DEVOPS_EXT_PAT: $(tSQLtCIAzureCLIPatToken) ## black magic: this token ^^^^ is required to make "az pipelines runs show" work below inputs: - azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' + azureSubscription: 'tSQLt CI - Nightly Cleanup - Service Connection' scriptType: 'ps' scriptLocation: 'inlineScript' inlineScript: | @@ -141,7 +141,7 @@ steps: - task: AzurePowerShell@4 name: print_stuff inputs: - azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' + azureSubscription: 'tSQLt CI - Nightly Cleanup - Service Connection' azurePowerShellVersion: 'LatestVersion' failOnStandardError: True ScriptType: 'InlineScript' @@ -159,7 +159,7 @@ steps: condition: succeeded() name: Delete_RGs inputs: - azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' + azureSubscription: 'tSQLt CI - Nightly Cleanup - Service Connection' azurePowerShellVersion: 'LatestVersion' FailOnStandardError: true ScriptType: 'InlineScript' @@ -225,7 +225,7 @@ steps: name: AssertDeleteSuccessful condition: always() inputs: - azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' + azureSubscription: 'tSQLt CI - Nightly Cleanup - Service Connection' azurePowerShellVersion: 'LatestVersion' failOnStandardError: True ScriptType: 'InlineScript' From 3370380ad6541d6229a265ce7096954af1768deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Fri, 19 Apr 2024 23:43:09 +0000 Subject: [PATCH 2/8] changed to ubuntu agent --- CI/Azure-DevOps/AZ_NightlyCleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_NightlyCleanup.yml b/CI/Azure-DevOps/AZ_NightlyCleanup.yml index 01f0e6c83..510e9a008 100644 --- a/CI/Azure-DevOps/AZ_NightlyCleanup.yml +++ b/CI/Azure-DevOps/AZ_NightlyCleanup.yml @@ -4,7 +4,7 @@ # https://aka.ms/yaml pool: - vmImage: 'vs2017-win2016' + vmImage: 'ubuntu-latest' schedules: - cron: 1 16 * * * From 7c8fea97aa388fd9e42df51f5080497ebd43056f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Fri, 19 Apr 2024 23:52:36 +0000 Subject: [PATCH 3/8] ... --- CI/Azure-DevOps/AZ_NightlyCleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_NightlyCleanup.yml b/CI/Azure-DevOps/AZ_NightlyCleanup.yml index 510e9a008..064a5bb67 100644 --- a/CI/Azure-DevOps/AZ_NightlyCleanup.yml +++ b/CI/Azure-DevOps/AZ_NightlyCleanup.yml @@ -39,7 +39,7 @@ steps: scriptType: 'ps' scriptLocation: 'inlineScript' inlineScript: | - + Write-Warning 'GotHere!'; ##Functions $GetAll_tSQLtCI_RGs = { param(); From a271653884716210354afb2abf95423884e0dedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Fri, 19 Apr 2024 23:55:12 +0000 Subject: [PATCH 4/8] back to windows --- CI/Azure-DevOps/AZ_NightlyCleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_NightlyCleanup.yml b/CI/Azure-DevOps/AZ_NightlyCleanup.yml index 064a5bb67..9f6bc3b99 100644 --- a/CI/Azure-DevOps/AZ_NightlyCleanup.yml +++ b/CI/Azure-DevOps/AZ_NightlyCleanup.yml @@ -4,7 +4,7 @@ # https://aka.ms/yaml pool: - vmImage: 'ubuntu-latest' + vmImage: 'windows-latest' #requires windows for azure authentication schedules: - cron: 1 16 * * * From 094026749d356d5ea6548def1fc5e7f5f7d49949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 20 Apr 2024 22:24:42 +0000 Subject: [PATCH 5/8] removed extra print --- CI/Azure-DevOps/AZ_NightlyCleanup.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_NightlyCleanup.yml b/CI/Azure-DevOps/AZ_NightlyCleanup.yml index 9f6bc3b99..c06eb4e90 100644 --- a/CI/Azure-DevOps/AZ_NightlyCleanup.yml +++ b/CI/Azure-DevOps/AZ_NightlyCleanup.yml @@ -39,7 +39,6 @@ steps: scriptType: 'ps' scriptLocation: 'inlineScript' inlineScript: | - Write-Warning 'GotHere!'; ##Functions $GetAll_tSQLtCI_RGs = { param(); From ca74b631eec33591a8ae16844eca9757438817cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 20 Apr 2024 22:28:22 +0000 Subject: [PATCH 6/8] switched main pipeline to new service connection --- CI/Azure-DevOps/AZ_MainPipeline.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 9e62f375e..9c5c41b94 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -102,7 +102,7 @@ stages: - task: AzureKeyVault@1 inputs: - azureSubscription: 'Azure DevOps Main Pipeline Service Principal' + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' KeyVaultName: 'tSQLtSigningKey' SecretsFilter: '*' RunAsPreJob: false @@ -130,7 +130,7 @@ stages: SQLPORTMINIMUM: $(SqlPortMinimum) SQLPORTMAXIMUM: $(SqlPortMaximum) inputs: - azureSubscription: 'Azure DevOps Main Pipeline Service Principal' + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' azurePowerShellVersion: 'LatestVersion' scriptType: ps scriptLocation: inlineScript @@ -218,7 +218,7 @@ stages: - task: AzureKeyVault@1 inputs: - azureSubscription: 'Azure DevOps Main Pipeline Service Principal' + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' KeyVaultName: 'tSQLtSigningKey' - task: PowerShell@2 @@ -426,7 +426,7 @@ stages: - task: AzureKeyVault@1 inputs: - azureSubscription: 'Azure DevOps Main Pipeline Service Principal' + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' KeyVaultName: 'tSQLtSigningKey' - task: PowerShell@2 @@ -665,7 +665,7 @@ stages: - task: AzureCLI@2 name: DeleteAzureVM inputs: - azureSubscription: 'Azure DevOps Main Pipeline Service Principal' + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' azurePowerShellVersion: 'LatestVersion' scriptType: ps scriptLocation: inlineScript From dcce6f2ed9a9dad0a48bc32df6641727e109b889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 21 Apr 2024 01:28:28 +0000 Subject: [PATCH 7/8] what account are we using? --- CI/Azure-DevOps/AZ_MainPipeline.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 9c5c41b94..25c68865b 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -100,6 +100,13 @@ stages: lfs: false path: $(TSQLT_REPO_DIR) + - task: AzureCLI@2 + inputs: + azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' + scriptType: 'ps' + scriptLocation: 'inlineScript' + inlineScript: 'az account show' # This command shows the logged-in Azure account details. + - task: AzureKeyVault@1 inputs: azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' From 1d28ae3cc58b610ca59f91dc7f1ebec343de1305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 21 Apr 2024 01:58:37 +0000 Subject: [PATCH 8/8] removed additional print --- CI/Azure-DevOps/AZ_MainPipeline.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 25c68865b..9c5c41b94 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -100,13 +100,6 @@ stages: lfs: false path: $(TSQLT_REPO_DIR) - - task: AzureCLI@2 - inputs: - azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection' - scriptType: 'ps' - scriptLocation: 'inlineScript' - inlineScript: 'az account show' # This command shows the logged-in Azure account details. - - task: AzureKeyVault@1 inputs: azureSubscription: 'tSQLt CI - Main Pipeline - Service Connection'