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

Feature Request: Configurable Timeout for AzureCLICredential in azidentity #21985

Closed
Aricg opened this issue Nov 15, 2023 · 5 comments
Closed
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.

Comments

@Aricg
Copy link

Aricg commented Nov 15, 2023

Feature Request: Configurable Timeout for AzureCLICredential

Description

make the timeout duration configurable in the AzureCLICredential of the azidentity package. Currently, the timeout is hardcoded to 10 seconds.

Justification

  Error: Failed to get release foo in namespace default: exit status 1: Error: failed to get token: expected an empty error but received: AzureCLICredential: signal: killed

Suggested Implementation

The timeout could be made configurable through the AzureCLICredentialOptions struct. For instance, a new field Timeout could be added to this struct. This new field would then be used in the authenticate method of AzureCLICredential.
this would I believe be a Non-Intrusive Addition: Adding a new field to a struct in Go does not alter the existing behavior of the struct for current users. Existing code that creates and uses AzureCLICredentialOptions without setting the new Timeout field will continue to function as before, as Go initializes unspecified fields to their zero value.

Current Code Reference

The current implementation with the hardcoded timeout is located here:
azure_sdk_for_go/azure_cli_credential.go at e1d15b65278a1c714f2dd1349fa4098d72d0fe7b

Additional Context

This feature request is motivated by intermittent failures observed in projects that use azidentity, specifically when integrating with tools like kubelogin. An example of such an issue can be found here: kubelogin issue #223

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 15, 2023
@jhendrixMSFT jhendrixMSFT added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. labels Nov 15, 2023
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 15, 2023
@Aricg
Copy link
Author

Aricg commented Nov 15, 2023

Its configurable in the python sdk

from azure.identity.aio import AzureCliCredential

# Create an AzureCliCredential with a custom timeout of 30 seconds
credential = AzureCliCredential(process_timeout=30)

https://github.com/Azure/azure-sdk-for-python/blob/ca7bc6c1ab786160c96dad4c1d1b2457001bf91c/sdk/identity/azure-identity/azure/identity/_credentials/default.py#L181

@chlowell
Copy link
Member

You can control this timeout by setting a deadline on the Context you pass to the client method or to GetToken(). Since v1.3.0 we impose the default timeout only when the given Context has no deadline:

// set a default timeout for this authentication iff the application hasn't done so already
var cancel context.CancelFunc
if _, hasDeadline := ctx.Deadline(); !hasDeadline {
ctx, cancel = context.WithTimeout(ctx, timeoutCLIRequest)
defer cancel()
}

@chlowell chlowell added issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team feature-request This issue requires a new behavior in the product in order be resolved. labels Nov 15, 2023
Copy link

Hi @Aricg. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@Aricg
Copy link
Author

Aricg commented Nov 16, 2023

thanks. Azure/kubelogin#362

Copy link

Hi @Aricg, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close.
Projects
Development

No branches or pull requests

3 participants