Skip to content

Upgrade Deprecated Azure SDK Clients  #277

Open
@pinkfloydx33

Description

@pinkfloydx33

The current Azure-backed Foundatio libraries are using the older, deprecated Azure SDK clients. For example Queues are using CloudQueue instead of the much newer QueueClient.

More generally you are making using of the Microsoft.* prefixed packages, instead of the newer Azure.* prefixed ones.

Repository Package Replacement
Foundatio.AzureStorage Microsoft.Azure.Storage.Blob Azure.Storage.Blobs
Foundatio.AzureStorage Microsoft.Azure.Storage.Queue Azure.Storage.Queues
Foundatio.AzureServiceBus Microsoft.Azure.ServiceBus Azure.Messaging.ServiceBus
Foundatio.AzureServiceBus Microsoft.Azure.Management.ServiceBus Azure.ResourceManager.ServiceBus

This matters for many reasons. Here's some of them:

  • The Microsoft.* packages are old and they are officially deprecated (except for the last one)
  • Azure.* clients support newer Azure API Versions
  • There are bug fixes and general enhancements
  • The Azure packages leverage Azure.Identity (instead of Microsoft.Identity.Client) which supports more forms of passwordless authentication, including MSAL and Azure Workload Federated Identity
  • The Azure.* packages integrate with Microsoft.Extensions.Logging
  • The Azure.* packages integrate with telemetry/distributed tracing and metrics in a fashion that can be configured by the user
  • They include configurable retries, transport settings and more (see here)
  • The Azure clients also support dependency injection. The Microsoft.Extensions.Azure package includes factory interfaces as well as a way to configure default options shared across clients of different types (storage, keyvault, servicebus, etc. )
  • The Azure.* packages can read connection information from IConfiguration properties and/or IConfigurationSection of particular shapes
  • The clients and responses can be mocked (helpers for which are included in the SDK)
  • I'm sure there's more I'm overlooking. See the Azure SDK for .NET for more info.

If our projects are already using the new (Azure.*) clients, then we have a few other problems. Use of any of the Azure-backed Foundatio projects now requires that we reference both sets of SDKs which of course increases the size of the published applications. But worse (IMO) we must configure the clients using totally different types of settings and manners of configuration.

For us, the latter case is actually the major driving force behind this issue. We are leveraging Azure Federated credentials (via Azure Workload Identity) to use Kubernetes Service Accounts to authenticate as managed identities. This is great, however it means we cannot use Foundatio's Azure libraries since they use the older identity packages and don't recognize new-style connection information. We'd have to maintain an extra connection string with credentials which defeats the purpose of using Azure Workload.

There is already a pull request in the Foundatio.AzureStorage repository from December 2020 that moved this library over to the Azure.* prefixed clients. It seems to be in permanent limbo.

There doesn't appear to be an official issue tracking that migration (just the PR) and as this actually impacts ServiceBus as well, I felt it made more sense to open the issue here (rather than in each repository). Apologies in advanced if I should have created multiple issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions