-
Notifications
You must be signed in to change notification settings - Fork 224
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 AAD Workload Identity #2545
Comments
Sorry for reverting back late on this. Are you looking for workload identity based login using "azcopy login" command here? |
No. We are looking for native support for AAD workload identity based login in azcopy. Not a workaround for using AAD workload identity based login.
As we and other people have explained in #2112 etc., this workaround using Azure CLI is very problematic in Kubernetes environments, where AAD workload identity is used. We need to add Azure CLI to pod images if we use this workaround in a K8S environment. But Azure CLI is a massive component comprising 50K+ files totalling over 1.2GB. This addition of Azure CLI will significantly increase pod image sizes, leading to the pod start's slowness. It is technically possible to transparently add AAD workload identity support along with the existing managed identity support. Azure SDK for go supports the AAD workload identity.
And We can find a similar discussion in Azure/azure-cli#26858. Azure CLI already supports authentication using token federations. But Azure/azure-cli#26858 is asking for AAD workload identity support, which internally uses token federations but can be simpler because the AAD workload identity webhook injects all required parameters into execution contexts as environment variables. |
So what youare suggesting here is in K8s environment adding "az cli" is not feasible due to its size and if azcopy can natively support the workload identity its easier for customer. If I understood correctly the suggested code takes a file as input to read token from and you are ok with that kind of solution. In k8s for this to work you will have to make this file accessible to all pods using azcopy. Is that correct understanding about this ask here? |
We are currently assessing the encountered issue and the corresponding feature request. Our aim is to explore more effective solutions to resolve the problem and better meet the requested features. |
This is correct. More precisely, Microsoft AAD Workload Identity webhook is responsible for injecting Kubernetes service account tokens into pods as files.
https://azure.github.io/azure-workload-identity/docs/installation/mutating-admission-webhook.html
We are OK for this solution as the AAD Workload Identity is Microsoft's official solution. Let me precise what "token" means. What AAD Workload Identity webhook injects are not AAD access tokens. The webhook injects Kubernetes service account tokens. The injected service account tokens are not directly used to access Azure resources. But MSAL etc. can use the injected service account tokens to exchange for AAD access tokens. https://azure.github.io/azure-workload-identity/docs/concepts.html
|
Any progress on this? |
Just hit this, it's a roadblock for me in a deployment process. |
As of now AzCopy does not support workload identity natively. You have to rely on "azcli" to login and use azcopy with cli based auth mode. We have this item in our backlog but it not on priority right now, due to our other deliverables. We can update you on this in few weeks after re-assessment. |
I also just hit this. We're now no longer allowed to use Service Connections in AzDO with Service Principals so must use Workload Identities. This makes the |
I was able to work around this by ditching AzCopy in favor of the Azure CLI command "az storage blob upload-batch" |
This still utilizes AzCopy on the backend I think 🗡️ |
trying to leverage Workload identity federation in our service connections in ADO has broken any jobs that utilize the azcopy task, had to revert back all our Service Connections from the from the recommended setup |
Hi all, Workload Identity support is currently being tracked for our upcoming May release. |
The new AzureFileCopy@6 task supports workload identity federation. The task also uses Azure RBAC to access blob storage instead. This requires the identity of the service connection used to have the appropriate RBAC role e.g. Storage Blob Data Contributor. See Assign an Azure role for access to blob data. |
Confirmed working. Thank you very much @geekzter ! |
@geekzter I just ran a pipeline build with
|
@geekzter Thanks! I root caused and submitted an issue - microsoft/azure-pipelines-tasks#19705 |
aggregate report is broken due to azcopy can't do authorization by using AAD Workload Identity. Azure/azure-storage-azcopy#2545 this is a workaround for this known issue
Do you know if Update: what worked for me was to use |
@JamesBurnside if you set |
Hi all, thank you for adding support for this! When will version 10.25.0 be released to include this? Urgently waiting for workload identity auth support to be able to use azcopy in my kubernetes pods :) |
10.25.0 has been released today. |
It works perfectly and is pretty simple. Thank you :) |
@sugibuchi - I'm using azure devops. This does not work. I get this error:
|
Failed to perform Auto-login: no client ID specified. Check pod configuration or set ClientID in the options. |
Which version of the AzCopy was used?
10.22.2
Which platform are you using? (ex: Windows, Mac, Linux)
azcopy
command in a pod using AAD Workload IdentityWhat command did you run?
Example 1:
Example 2:
In both cases,
azcopy
command got stuck without any response.What problem was encountered?
Authorization by using AAD Workload Identity does not work.
How can we reproduce the problem in the simplest way?
There is no simple way, but...
Have you found a mitigation/solution?
A workaround using AzureCLI login was suggested by #2303 (comment). However, this workaround is problematic in Kubernetes environments since this approach requires an installation of AzureCLI in Docker images, which leads to a significant increase in image sizes and the slowness of pod start.
We prefer a native support of AAD Workload Identity in
azcopy
which supports the following two methods for authorization:Option 1: run
azcopy login
Option 2: Set env variable
AZCOPY_AUTO_LOGIN_TYPE
We don't need to explicitly set additional parameters (tenant ID etc.) because the AAD Workload Identity webhook automatically injects all required parameters as the following env variables:
https://azure.github.io/azure-workload-identity/docs/quick-start.html#7-deploy-workload
AZURE_AUTHORITY_HOST
AZURE_CLIENT_ID
AZURE_TENANT_ID
AZURE_FEDERATED_TOKEN_FILE
WorkloadIdentityCredential
provided by Azure SDK for golang automatically uses values of these env variables.The text was updated successfully, but these errors were encountered: