-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[BUG]: AzureFileCopyV5: Incorrectly returns "Storage account not found" error for recently created Storage account. #19566
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
Comments
Hi @mm2709, is there any fix do you like to purpose here? |
Yes. I have the following options to fix the issue. Option 1: I have already mentioned it in the description that using Get-AzStorageAccount cmdlet instead of Get-AzResource should fix the issue. All we have to do is replace
Option 2: We can supply the ResourceGroupName (keep it as optional for backward compatibility) as input parameter from the pipeline task. Then we can skip the call Get-AzureStorageAccountResourceGroupName (in below screenshot) if the ResourceGroupName is not null or empty. |
having the exact same issue since a few days, but not constant. 1 out of 5 pipeline runs still get through. Had the same with azurefilecopy@4 lately, and started integrating a 5min wait task before creating the storage account and running azcopy. To no avail. The storage account and container is getting created fine, but the task doesn't see it... |
We recently started having this issue very frequently now. It started for us a couple days ago but would fix itself after about 5 minutes, today it is taking much longer to fix itself. This is occuring even on storage accounts that are brand new and have never been deleted/re-created |
I'm also running into this on the windows-2022 agent in ADO. I create a storage account and a few steps later in the pipeline try to copy a file to it and it fails. |
I am experiencing the same issue with this agent. |
Also happening to me too |
@v-mohithgc Option 1 is a straight-forward fix. Can you please prioritize and assign this bug? |
Hi all, I have created the PR for the proposed changes #19588 Local task test: Step 1: run "npm i" Step 2: Build:
Step 3: Install tfx:
Step 4: Login:
Step 5: Upload:
New task version will be uploaded to your org, please validate the changes by running the pipeline. Step 6: Delete: // optional and can be done after all the testing is completed.
|
This is still occurring very frequently on new storage account deployments, is there any update on the fix suggested @v-mohithgc ? |
I have notified the relevant task owners; team is working on it. |
Hi, the pre-configured PR checks are failing with the same error, and I don't have access to modify/control any input parameter related to PR checks. In order to merge the PR, all those checks should succeed. PR: #19588 Let me see what I can do here. |
Hi, can anyone try to enable the debug logs (system.debug = true) and share us the recent failure logs related to this issue at "[email protected]". and also let us know the type of service connection been used. |
Hi all, can anyone please confirm if there is any recent occurrence on this issue? if so please share us the complete debug logs, details of the task configuration and type of service connection used, if possible, send all these info to [email protected], for team to proceed with further analysis. |
yes we had a pipeline fail this week due to this issue. Let me see if I can get the logs for that. |
I've sent an email with the issue number 19566 in the header. I has a screenshot of the task itself and a debug log output from the pipeline with our subscription, tenant information redacted. It's a very simple thing to set up and replicate. |
@mm2709, The error in the Logs point to the line (line number 13) where we replace Get-AzResource with Get-AzStorageAccount. |
@v-mohithgc any update on this? We are still getting this error today, and it happens in pipelines where we are deploying an arbitrary number of storage accounts based on configurations in the pipeline, so run by run this fails large portion of the time. |
@ybadragon We tried to reproduce this issue by deploying a storage account and created release by adding Azure file copy Task to see if fails. But the release was successful without any error. So, we suppose this to be a replication error due to large number of storage accounts. |
Yes we've already said this previously, after an arbitrary amount of time the task eventually works, however waiting for hours is not an acceptable resolution to this bug. Were you running the task in AzureDevOps? What agent were you using? As I said this is very easily replicate able. In addition looking at the previous comments @mm2709 seems to have found where the issue is, has there been an attempt to revert that change, or implement either of the fixes mentioned? |
I am using Microsoft hosted agent to run the task in AzureDevops. |
Is it feasible to introduce a delay task after you create storage account and then try to run AzureFileCopy task? |
@garun-kumar not for hours, but even if we could it is an arbitrary amount of time so it still would not succeed 100% of the time and is not a fix for the bug. |
FYI even after the merge from 2 weeks ago we are still seeing this error occur. |
Seeing this with AzureFileCopyV6 as well. The request is unable to see the container and tries to create it (even though it already exists), but our service principal do not have create container access (which it doesn't even need as the container is there and working just fine):
Noticing that "sometimes" the operation works, but extremely inconsistent. |
@v-schhabra can we have this issue re-opened or copied to a new issue but targeting AzureFileCopyV6? AzureFileCopyV6 currently has this exact issue and there has been a pending PR for the last 4 months with no activity recently. This bug is currently a blocker for anyone trying to migrate to "Workload Identity Federation" which MS is heavily pushing. |
Hi @aya-bjoseph |
New issue checklist
Task name
AzureFileCopy
Task version
V5
Issue Description
In my pipeline, I'm creating a new storage account. Then in the immediate next step, I'm trying to copy files to this newly created storage account. However, I'm receiving the error "Storage account: not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only."
It seems the highlighted call to "Get-AzResource" cmdlet is returning nothing/null and eventually ends up throwing the exception.
I confirmed the above behavior by running the same cmdlet from my dev machine. Get-AzResource cmdlet returns nothing/null, but Get-AzStorageAccount cmdlet returns the storage account details and confirms its existence.

Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Microsoft Windows Server 2022
Relevant log output
Full task logs with system.debug enabled
Repro steps
The text was updated successfully, but these errors were encountered: