Skip to content

MPG migration - Attestation#54444

Open
mzhongl524 wants to merge 21 commits intoAzure:mainfrom
mzhongl524:pr-attestation-from-tsp
Open

MPG migration - Attestation#54444
mzhongl524 wants to merge 21 commits intoAzure:mainfrom
mzhongl524:pr-attestation-from-tsp

Conversation

@mzhongl524
Copy link
Member

@mzhongl524 mzhongl524 commented Dec 11, 2025

TSP PR: Azure/azure-rest-api-specs#39250 (merged)

TSP PR: Azure/azure-rest-api-specs#40223

Fixes #54478
Blocked by

The main issues are as follows:

  • Failed to generate AttestationPrivateEndpointConnectionResource. Tried renaming and handling on the client side, but it still was not generated.
  • The id parameter type cannot be converted from string to Azure.Core.ResourceIdentifier, which means that the type currently being generated is string.

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.

@github-actions github-actions bot added the Mgmt This issue is related to a management package. label Dec 11, 2025
@github-actions
Copy link

github-actions bot commented Dec 11, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.ResourceManager.Attestation

@mzhongl524 mzhongl524 changed the title [Attestation] Validate the SDK of TypeSpec using the new code generator MPG migration - Attestation Jan 5, 2026
@mzhongl524 mzhongl524 marked this pull request as ready for review January 26, 2026 09:11
Copilot AI review requested due to automatic review settings January 26, 2026 09:11
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 pull request migrates the Azure.ResourceManager.Attestation SDK from the autorest-based generator to the Management Plane Generator (MPG/TypeSpec). The PR includes updates to both the data plane SDK (to suppress obsolete warnings) and the resource manager SDK (complete regeneration with TypeSpec).

Changes:

  • Suppression of SYSLIB0057 warnings in data plane SDK for X509Certificate2 usage
  • Complete regeneration of resource manager SDK using TypeSpec
  • Test updates to reflect API changes in the generated code
  • Addition of tsp-location.yaml configuration file

Reviewed changes

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

Show a summary per file
File Description
PolicyCertificatesResult.cs, AttestationSigner.cs, AttestationToken.cs, AttestationAdministrationClient.cs Added pragma warnings to suppress SYSLIB0057 for obsolete X509Certificate2 constructor usage
tsp-location.yaml New TypeSpec configuration file specifying the spec location and generator settings
Test files (PrivateEndpointConnectionTests.cs, AttestationProviderTest.cs, ResourceDataHelper.cs) Updated to use new property names (ConnectionState → PrivateLinkServiceConnectionState, AttestationProviderCreateOrUpdateContent → AttestationServiceCreationParams)
Sample files Updated to reflect API changes including method name changes and return type changes
Generated model files Complete regeneration with new serialization patterns, property structures, and helper classes
Internal helper files New internal helper classes for serialization, pagination, and type formatting
LongRunningOperation files Updated to use new Azure SDK patterns
Collection results New pageable collection implementation classes

List<X509Certificate2> certificates = new List<X509Certificate2>();
foreach (var cert in token.GetBody<PolicyCertificatesResult>().InternalPolicyCertificates.Keys)
{
#pragma warning disable SYSLIB0057 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

Please don't do this - ESPECIALLY for obsolete members. In this case, the fix is easy and should be made as part of this PR. After, please file an issue for the Attestation team (marked "Service Attention") to follow-up and review before their next release.

List<X509Certificate2> certificates = new List<X509Certificate2>();
foreach (var certificate in Header.X509CertificateChain)
{
#pragma warning disable SYSLIB0057 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

This cannot be merged.

int i = 0;
foreach (var base64Cert in base64certificates)
{
#pragma warning disable SYSLIB0057 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

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

This cannot be merged.

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 - attestation

5 participants