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

Support for Secret-less Azure Managed Identity in Python Delta-Sharing Client #633

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

moderakh
Copy link
Collaborator

@moderakh moderakh commented Jan 10, 2025

Add Support for Azure Managed Identity in Python Delta-Sharing Client.

sample share profile file for managed-identity:

{
  "endpoint" : "http://example.com",
  "shareCredentialsVersion": 2,
  "type": "experimental_managed_identity"
}

Note to reviewer please read bellow:

What is Azure Managed Identity?

Azure Managed Identity allows applications running on Azure compute resources (e.g., Azure Virtual Machines) to access Azure services without the need for managing credentials explicitly. The identity is automatically provisioned by Azure infrastructure, eliminating the need for hardcoded secrets.

To obtain an access token, the application can call a specific internal endpoint available only within the Azure VM environment:

GET 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/' HTTP/1.1 Metadata: true

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "access_token": "eyJ0eXAi...",
  "refresh_token": "",
  "expires_in": "3599",
  "expires_on": "1506484173",
  "not_before": "1506480273",
  "resource": "https://management.azure.com/",
  "token_type": "Bearer"
}

This token can then be used by the client to authenticate against Azure services and if delta-sharing server supports accepting this token delta-sharing client can authenticate against the server.

For more details, refer to the official Azure documentation.

How this code is constructed

The code is constructed by following a similar pattern established for the OAuth client credential flow. It subclasses AuthCredentialProvider to implement the managed-identity auth provider.

Future Work

  • Other Cloud Providers: Support for managed identities in AWS, GCP.

@moderakh moderakh changed the title This PR adds support for Azure Managed Identity in Python Delta-Sharing Client Support for Azure Managed Identity in Python Delta-Sharing Client Jan 10, 2025
@moderakh moderakh changed the title Support for Azure Managed Identity in Python Delta-Sharing Client Support for Secret-less Azure Managed Identity in Python Delta-Sharing Client Jan 10, 2025
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.

1 participant