Skip to content

Commit

Permalink
Merge pull request backstage#26661 from mattemoore/fix_azure_scaffold…
Browse files Browse the repository at this point in the history
…er_git_push_auth

Fix azure scaffolder git push auth
  • Loading branch information
benjdlambert authored Sep 16, 2024
2 parents 16580da + 59d8da4 commit 83e0a91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-pigs-smoke.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 4 additions & 7 deletions plugins/scaffolder-backend-module-azure/src/actions/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 83e0a91

Please sign in to comment.