Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Description

Reintroduces BicepFunction.GetResourceId and BicepFunction.GetExtensionResourceId APIs that were temporarily removed in the 1.4.0 stable release pending API review. These methods provide access to the corresponding Bicep built-in functions for resource ID resolution.

Changes

  • BicepFunction.cs: Uncommented GetResourceId() and GetExtensionResourceId() methods
  • ResourceIdFunctionsTests.cs: Uncommented corresponding test cases
  • CHANGELOG.md: Documented reintroduction in 1.5.0-beta.1 features
  • API files: Refreshed API surface files for all target frameworks (net8.0, net10.0, netstandard2.0) to include the reintroduced methods

Usage

// Get resource ID with subscription, resource group, type and name
var id = BicepFunction.GetResourceId(
    "00000000-0000-0000-0000-000000000000",
    "myResourceGroup", 
    "Microsoft.Storage/storageAccounts",
    "myStorageAccount"
);

// Get extension resource ID
var vmId = BicepFunction.GetResourceId("Microsoft.Compute/virtualMachines", "myVm");
var extensionId = BicepFunction.GetExtensionResourceId(
    vmId,
    "Microsoft.GuestConfigurations/configurations",
    "myConfiguration"
);

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>[provisioning] Reintroduce removed APIs into new beta version</issue_title>
<issue_description>In Azure.Provisioning library, we removed two APIs BicepFunction.GetResourceId and BicepFunction.GetExtensionResourceId in this PR for the stable version because they did not pass the api review yet.
Since the new stable version has been released, we could reintroduce them back in new versions.</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: ArcturusZhang <10554446+ArcturusZhang@users.noreply.github.com>
Copilot AI changed the title [WIP] Reintroduce removed APIs in new beta version [provisioning] Reintroduce GetResourceId and GetExtensionResourceId APIs in 1.5.0-beta.1 Dec 9, 2025
Copilot AI requested a review from ArcturusZhang December 9, 2025 07:17
Copy link
Member

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

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

@copilot please run <RepoRoot>/eng/scripts/Export-API.ps1 provisioning to refresh the API files.

…esourceId

Co-authored-by: ArcturusZhang <10554446+ArcturusZhang@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 9, 2025

@copilot please run <RepoRoot>/eng/scripts/Export-API.ps1 provisioning to refresh the API files.

Done! The API files have been refreshed. The two reintroduced methods (GetResourceId and GetExtensionResourceId) are now included in all three API surface files (net8.0, net10.0, and netstandard2.0). Commit: 8b76fc2

@ArcturusZhang ArcturusZhang marked this pull request as ready for review December 9, 2025 09:09
Copilot AI review requested due to automatic review settings December 9, 2025 09:09
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 reintroduces BicepFunction.GetResourceId and BicepFunction.GetExtensionResourceId APIs that were temporarily removed in version 1.4.0 pending API review. These methods provide C# access to corresponding Bicep built-in functions for resource ID resolution.

Key Changes:

  • Uncommented GetResourceId() and GetExtensionResourceId() methods in BicepFunction.cs
  • Re-enabled corresponding test cases in ResourceIdFunctionsTests.cs
  • Updated API surface files for all target frameworks (netstandard2.0, net8.0, net10.0) to reflect the reintroduced methods

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/provisioning/Azure.Provisioning/src/Expressions/BicepFunction.cs Uncommented the GetResourceId and GetExtensionResourceId methods with their full documentation
sdk/provisioning/Azure.Provisioning/tests/Expressions/BicepFunctionTests/ResourceIdFunctionsTests.cs Uncommented test cases TestGetResourceId and TestGetExtensionResourceId to validate the reintroduced functionality
sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.netstandard2.0.cs Added API surface entries for the two reintroduced methods
sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net8.0.cs Added API surface entries for the two reintroduced methods
sdk/provisioning/Azure.Provisioning/api/Azure.Provisioning.net10.0.cs Added API surface entries for the two reintroduced methods
sdk/provisioning/Azure.Provisioning/CHANGELOG.md Documented the reintroduction of both methods in the 1.5.0-beta.1 release notes

Review Summary: The changes are straightforward and consistent. The PR successfully reintroduces previously removed APIs by uncommenting existing code and tests. The implementation follows established patterns, includes comprehensive documentation, has adequate test coverage, and maintains API consistency across all target frameworks. No issues were identified within the scope of the changed code.

@ArcturusZhang
Copy link
Member

Close this because we would like to do this instead

@ArcturusZhang ArcturusZhang deleted the copilot/reintroduce-removed-apis branch December 11, 2025 06:59
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.

[provisioning] Reintroduce removed APIs into new beta version

2 participants