Skip to content

fix: use ClientSecretCredential instead of DefaultAzureCredential in graph-connector template#15416

Merged
Alive-Fish merged 2 commits intodevfrom
copilot/cherry-pick-fix-credential
Mar 4, 2026
Merged

fix: use ClientSecretCredential instead of DefaultAzureCredential in graph-connector template#15416
Alive-Fish merged 2 commits intodevfrom
copilot/cherry-pick-fix-credential

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Cherry-pick of PR #15400 to dev. The graph-connector template was using DefaultAzureCredential with a non-standard requiredEnvVars option, which doesn't reliably authenticate with a service principal. Replace it with explicit ClientSecretCredential.

Changes

  • templates/vsc/ts/graph-connector/src/graphClient.ts
    • Swap DefaultAzureCredentialClientSecretCredential
    • Pass AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET explicitly
// Before
const credential = new DefaultAzureCredential({
  requiredEnvVars: ["AZURE_TOKEN_CREDENTIALS"],
});

// After
const credential = new ClientSecretCredential(
  process.env.AZURE_TENANT_ID!,
  process.env.AZURE_CLIENT_ID!,
  process.env.AZURE_CLIENT_SECRET!
);
Original prompt

This section details on the original issue you should resolve

<issue_title>[Cherry-pick] PR #15400 needs to be synchronized to other branches</issue_title>
<issue_description>

Cherry-pick Reminder

@Alive-Fish Hello!

This is an automatically created reminder. Your PR #15400 (fix: not use DefaultAzureCredential but use ClientSecretCredential) is being merged into the release/6.5 branch.

Please ensure to cherry-pick these changes to the following branches:

Steps to Follow:

  1. Wait for the current PR to be merged.
  2. Execute the following commands locally:
    git fetch origin
    git checkout <target_branch>
    git cherry-pick <commit_hash>
    git push origin <target_branch>
  3. Or create a new PR to merge these changes into the above branches.

After completion, please check the items above ✓

Note: This is an automatically created issue. You can close this issue after completing all the operations.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Alive-Fish <15262146+Alive-Fish@users.noreply.github.com>
Copilot AI changed the title [WIP] Cherry-pick fix for credential usage in multiple branches fix: use ClientSecretCredential instead of DefaultAzureCredential in graph-connector template Mar 4, 2026
@Alive-Fish Alive-Fish marked this pull request as ready for review March 4, 2026 06:36
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.30%. Comparing base (5e96d3e) to head (effc274).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #15416   +/-   ##
=======================================
  Coverage   89.30%   89.30%           
=======================================
  Files         620      620           
  Lines       38089    38089           
  Branches     7557     7559    +2     
=======================================
  Hits        34017    34017           
  Misses       1972     1972           
  Partials     2100     2100           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Alive-Fish Alive-Fish merged commit 4c7608a into dev Mar 4, 2026
64 of 65 checks passed
@Alive-Fish Alive-Fish deleted the copilot/cherry-pick-fix-credential branch March 4, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cherry-pick] PR #15400 needs to be synchronized to other branches

3 participants