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

auth azure: support access token #3580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

LiliDeng
Copy link
Collaborator

@LiliDeng LiliDeng commented Jan 3, 2025

managed identity doesn't work with windows container directly for this reason

find a way to auth azure with access token

@LiliDeng LiliDeng requested a review from squirrelsc as a code owner January 3, 2025 16:10
@LiliDeng LiliDeng force-pushed the lildeng/fix_12_25_003 branch 2 times, most recently from d5117f1 to 6e9a2fb Compare January 4, 2025 10:16
@LiliDeng
Copy link
Collaborator Author

LiliDeng commented Jan 5, 2025

During testing, found this token is working for managing azure resources, I am consulting azure python sdk how to handle this.

if "AZURE_ACCESS_TOKEN" in os.environ:
credential = StaticAccessTokenCredential(
os.environ["AZURE_ACCESS_TOKEN"],
int(time.time()) + 3600 * azure_runbook.access_token_expiry_hours,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try to parse the expiration time from the token itself. So, the parameter is not needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@squirrelsc
Copy link
Member

During testing, found this token is working for managing azure resources, I am consulting azure python sdk how to handle this.

What does it mean? Do you mean it fails in some scenarios, so you need have more tests or confirmation before merging? If so, please set it to Draft.

@LiliDeng LiliDeng force-pushed the lildeng/fix_12_25_003 branch from 6e9a2fb to be05158 Compare January 7, 2025 14:33
@LiliDeng LiliDeng force-pushed the lildeng/fix_12_25_003 branch from be05158 to f35f51f Compare January 7, 2025 14:38
@LiliDeng
Copy link
Collaborator Author

LiliDeng commented Jan 7, 2025

During testing, found this token is working for managing azure resources, I am consulting azure python sdk how to handle this.

What does it mean? Do you mean it fails in some scenarios, so you need have more tests or confirmation before merging? If so, please set it to Draft.

Never mind, this one works.

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