Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure.Core 2.0: Update AzureKeyCredential, RetryPolicy, and StatusCodeClassifier #42329

Merged

Conversation

annelo-msft
Copy link
Member

Description

Many of the basic Azure.Core types now have analogous types in the System.ClientModel library. In order to follow the DRY engineering principle, we plan to update Azure.Core to reuse functionality from these types, using either inheritance or adapters in most cases.

This PR makes the following changes:

  • Azure.Core AzureKeyCredential inherits from System.ClientModel ApiKeyCredential
  • Azure.Core RetryPolicy adapts System.ClientModel ClientRetryPolicy
  • Azure.Core StatusCodeClassifier uses new internal implementation copied from System.ClientModel BitVector640

Design Motivation

  • AzureKeyCredential inherits from ApiKeyCredential to reuse the implementation.
  • RetryPolicy wraps ClientRetryPolicy because inheritance is not possible here.
  • StatusCodeClassifier does not reuse anything other than a new implementation we have been meaning to move it to for a while.

Context

This PR is a smaller chunk of #41773 to make it easier to review. In addition, it this PR targets the feature/azure.core-2.0 feature branch because we cannot move the Azure.Core 2.0 integration into main until after System.ClientModel 1.1.0 is GA.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 1, 2024

API change check

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

Azure.Core
System.ClientModel

@annelo-msft annelo-msft marked this pull request as ready for review March 1, 2024 23:47
@annelo-msft annelo-msft requested review from KrzysztofCwalina, tg-msft and a team as code owners March 1, 2024 23:47
annelo-msft added a commit to annelo-msft/azure-sdk-for-net that referenced this pull request Mar 2, 2024
@annelo-msft
Copy link
Member Author

What's the scenario where we'd want to set properties to null?
(I don't have an opinion, I'm just curious about the end-to-end)

We don't currently have a way to un-set a property on a message, so it might be useful for this.

annelo-msft added a commit to annelo-msft/azure-sdk-for-net that referenced this pull request Mar 5, 2024
@annelo-msft annelo-msft merged commit 7c5fec3 into Azure:feature/azure.core-2.0 Mar 5, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants