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

feat(kcsb): support use of managed identity resource id #255

Merged

Conversation

sgoings
Copy link
Member

@sgoings sgoings commented Jul 24, 2024

feat(kcsb): support use of managed identity resource id

deprecate WithUserManagedIdentity, with more specific replacements:

  • WithUserAssignedIdentityClientId - Receives the MSI client id
  • WithUserAssignedIdentityResourceId - Receives the MSI resource id

@AsafMah
Copy link
Contributor

AsafMah commented Jul 28, 2024

Making it a heuristic is not great, it's probably better to have it as an explicit different parameter.

@sgoings
Copy link
Member Author

sgoings commented Jul 29, 2024

Making it a heuristic is not great, it's probably better to have it as an explicit different parameter.

The way I'd see this working best is if WithUserAssignedIdentity(...) takes a struct ManagedIdentityOpts with fields AppID or ResourceID and then storing that struct as ManagedServiceIdentity in ConnectionStringBuilder. Another option is to have 2 string fields in the function signature of WithUserAssignedIdentity(...) but... not sure how willing you are to break API compat here.

Another way to handle it could be to have another function (such as WithUserAssignedIdentityV2(opts ManagedIdentityOpts)) and not change behavior of the existing WithUserAssignedIdentity function.

What direction would you prefer me take this?

@AsafMah
Copy link
Contributor

AsafMah commented Aug 4, 2024

I think we should deprecate the old method, add two new methods - WithUserAssignedIdentityClientId and WithUserAssignedIdentityResourceId, and have old one redirect to the client id method.

@sgoings
Copy link
Member Author

sgoings commented Aug 16, 2024

@AsafMah ptal

deprecate kcsb.WithUserManagedIdentity, with more specific replacements:
  - `WithUserAssignedIdentityClientId` - Receives the MSI client id
  - `WithUserAssignedIdentityResourceId` - Receives the MSI resource id
@sgoings sgoings force-pushed the support-user-managed-identity-resource-id branch from 6185265 to 70a0367 Compare August 16, 2024 22:25
@AsafMah AsafMah self-requested a review August 18, 2024 11:12
@AsafMah AsafMah self-assigned this Aug 18, 2024
@AsafMah
Copy link
Contributor

AsafMah commented Aug 21, 2024

Looks great - thanks

@AsafMah AsafMah merged commit ff919ae into Azure:master Aug 21, 2024
4 of 5 checks passed
@sgoings sgoings deleted the support-user-managed-identity-resource-id branch August 21, 2024 15:25
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.

2 participants