azkv: Allow specifying auth method and add cachable authentication methods #1777
+140
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Azure is just really awful and slow to work with, and using sops with a azkv key to edit secrets from e.g. your laptop where you are authenticating with your user and not through a SP/MSI is nightmarishly slow.
To improve the situation this PR implements:
InteractiveBrowserCredential
andDeviceCodeCredential
which adds a very significant speedup compared toAzureCliCredential
. See below.The time to unlock a secret using sops
v3.9.4
and authenticating as a user throughazure-cli
:The time to unlock a secret using my PR and authenticating as a user with
InteractiveBrowserCredential
after the initial authentication:Related issues: #885, #1606
I'm happy to add documentation, tests or whatever is needed. I just don't want to go through the trouble before I know if the design is acceptable, and that there is a chance that this could be merged.