Skip to content

MPG migration SDK - Billing#59328

Open
mzhongl524 wants to merge 5 commits into
Azure:mainfrom
mzhongl524:pr-billing-mpg
Open

MPG migration SDK - Billing#59328
mzhongl524 wants to merge 5 commits into
Azure:mainfrom
mzhongl524:pr-billing-mpg

Conversation

@mzhongl524
Copy link
Copy Markdown
Member

Fixed: #58564
TSP PR: Azure/azure-rest-api-specs#43330

Use the new code generator to generate SDK code from TSP.

Contributing to the Azure SDK

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

Copilot AI review requested due to automatic review settings May 19, 2026 05:53
@github-actions github-actions Bot added the Mgmt This issue is related to a management package. label May 19, 2026
Copy link
Copy Markdown
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 starts migrating Azure.ResourceManager.Billing to the TypeSpec-based management-plane generator by pinning the spec location/commit and removing the AutoRest dependency toggle from the project file.

Changes:

  • Added tsp-location.yaml to pin the Billing TypeSpec directory and spec commit SHA.
  • Removed <IncludeAutorestDependency>true</IncludeAutorestDependency> from the Billing SDK project to stop pulling AutoRest tooling.

Reviewed changes

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

File Description
sdk/billing/Azure.ResourceManager.Billing/tsp-location.yaml Adds TypeSpec spec repo/directory/commit pin and emitter package path.
sdk/billing/Azure.ResourceManager.Billing/src/Azure.ResourceManager.Billing.csproj Removes AutoRest dependency flag to align with TypeSpec-based codegen.

Comment thread sdk/billing/Azure.ResourceManager.Billing/tsp-location.yaml
mzhongl524 and others added 4 commits May 19, 2026 20:27
…ta.1)

Major migration from AutoRest/Swagger to TypeSpec-based code generation using
the http-client-csharp-mgmt emitter:

- Updated tsp-location.yaml to point at the pr-billing-mpg branch in the spec repo
- Bumped package version to 2.0.0-beta.1 (major) and updated CHANGELOG
- ApiCompatVersion left empty for this migration; surface is rebuilt and breaking
  changes are documented in CHANGELOG.md
- Regenerated entire Generated/ tree from TypeSpec
- Added Custom partial classes to work around generator quirks:
    * BillingAccountPolicyResource / BillingProfilePolicyResource: re-expose
      Update/UpdateAsync as wrappers over CreateOrUpdate (the tag boilerplate
      expects Update but the resource only has CreateOrUpdate)
    * BillingTransferDetailsResource / PartnerTransferDetailsResource: replace
      the wrongly-typed generator-emitted Update(...,Data,...) with an overload
      that throws NotSupportedException, because the underlying op is
      "initiate" and uses a different request payload
    * BillingRequestContentHelper: provide IEnumerable<T>.ToRequestContent and
      DateTimeOffset.ToRequestContent helpers that the generator currently
      emits as invalid C#
- post-regen-patch.ps1: deterministic post-regeneration script that patches the
  remaining generator quirks (IEnumerable<T>.ToRequestContent call sites,
  DateTimeOffset.ToRequestContent call sites, SubscriptionRenewalTermDetails
  TermDuration TimeSpan -> string, BillingExtensions XML cref repairs). Run
  after each regeneration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point tsp-location.yaml at the post-merge spec commit
69d49addebe83e54eec8fc6d994e6fe957f20d89 which contains the MPG
wrapper-resource additions required to work around the generator's
shared-resource LRO bug, together with the client.tsp customizations
for the Billing MPG migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point tsp-location.yaml at the latest pr-billing-mpg spec commit:

  462da3cc9c9f67e06109e96f23f2c7e21608bc0b

That commit carries the partial MPG scaffolding (tspconfig + client.tsp +
the PaymentMethod 4th-arg friendly-name override + the SavingsPlanModelListResult
extends->spread normalization). All changes there have 0 openapi.json
delta vs Azure/azure-rest-api-specs main.

The migration itself remains blocked by codegen bug
Azure#59362
(KeyNotFoundException in BuildLroHandling when multiple
ResourceClientProviders share one ResourceData type and at least one
has an LRO operation).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mgmt This issue is related to a management package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

** MPG migration - billing

2 participants