From c9f7f5fd9ab0a8137b54a9b2afbf5d2d517cd122 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Thu, 12 Sep 2024 10:24:05 -0400 Subject: [PATCH 1/2] Azure publish action always uses basic authentication when pushing to Git. Signed-off-by: Matt Moore --- .../src/actions/azure.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/scaffolder-backend-module-azure/src/actions/azure.ts b/plugins/scaffolder-backend-module-azure/src/actions/azure.ts index a284f463a6..518d2acbf7 100644 --- a/plugins/scaffolder-backend-module-azure/src/actions/azure.ts +++ b/plugins/scaffolder-backend-module-azure/src/actions/azure.ts @@ -207,13 +207,10 @@ export function createPublishAzureAction(options: { : config.getOptionalString('scaffolder.defaultAuthor.email'), }; - const auth = - ctx.input.token || credentials?.type === 'pat' - ? { - username: 'notempty', - password: ctx.input.token ?? credentials!.token, - } - : { token: credentials!.token }; + const auth = { + username: 'notempty', + password: ctx.input.token ?? credentials!.token, + }; const commitResult = await initRepoAndPush({ dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath), From 59d8da4fc83782a09ffdb8fb5c260ca998cae424 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Thu, 12 Sep 2024 10:54:55 -0400 Subject: [PATCH 2/2] Added changeset. Signed-off-by: Matt Moore --- .changeset/tricky-pigs-smoke.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tricky-pigs-smoke.md diff --git a/.changeset/tricky-pigs-smoke.md b/.changeset/tricky-pigs-smoke.md new file mode 100644 index 0000000000..e147d49e3e --- /dev/null +++ b/.changeset/tricky-pigs-smoke.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-azure': patch +--- + +Publish Azure action now uses basic authentication to authenticate to Git when Azure integration is configured to use App Registration/Service Account or Managed Identity.