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

Storage account not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only. #19209

Closed
diegum opened this issue Aug 11, 2022 · 15 comments · Fixed by microsoft/azure-pipelines-tasks#16785
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. Storage

Comments

@diegum
Copy link

diegum commented Aug 11, 2022

Description

I'm getting the same issue described in this Azure Pipeline Tasks repo thread.

In that occasion, it stopped happening on its own. The contributor closing the issue asked to file a ticket here if it happened again, alleging that "Az commands are not able to retrieve storage accounts immediately."

Issue script & Debug output

# Azure file copy task on my ADO pipeline
- task: AzureFileCopy@4
  displayName: 'Checking AzureFileCopy'
  inputs:
    sourcePath: <path/to/the/file/to/copy>
    connectedServiceNameARM: <my service connection>
    destination: AzureVMs
    storage: <my storage account>
    resourceGroup: <my resource group>
    machineNames: <my VM>
    vmsAdminUserName: <VM admin>
    vmsAdminPassword: <VM admin password>
    targetPath: <internal\vm\path\to\the\copy\destination\folder>
    cleanTargetBeforeCopy: true

Environment data

I don't have that info available as this runs inside the Azure DevOps sandbox. I believe that it's Windows PowerShell (as opposed to PowerShell Core.)

Module versions

Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\2.2.8\Az.Accounts.psd1 -Global
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Resources\3.5.0\Az.Resources.psd1 -Global
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Storage\3.6.0\Az.Storage.psd1 -Global
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Compute\4.12.0\Az.Compute.psd1 -Global
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Network\4.7.0\Az.Network.psd1 -Global

Error output

##[error]Storage account: <my existing and accessible storage account> not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only.
@diegum diegum added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Aug 11, 2022
@ghost ghost added customer-reported CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Aug 11, 2022
@ghost
Copy link

ghost commented Aug 11, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@dingmeng-xue
Copy link
Member

@diegum , could you see the same issue when you use the same cmdlet in PowerShell console local rather than Azure pipeline. We need you provide debug information. You can see debug information after setting $DebugPreference = "Continue".

@mitsha-microsoft
Copy link
Member

We are facing the same issue, in an Azure Pipeline's Release Pipeline Azure file copy task with an existing storage account. It fails and passes intermittently.
In both the failing and passing pipelines with the same storage account and service connection, I think v2.9.0 is used:

##[debug]Loading module from path 'C:\Modules\az_7.5.0\Az.Accounts\2.9.0\Az.Accounts.psm1'.

@blueww
Copy link
Member

blueww commented Aug 18, 2022

@diegum , @mitsha-microsoft

From the comment microsoft/azure-pipelines-tasks#14647 (comment), I see:
The failure is on Get-AzureRmStorageAccount, which is very old cmdlet, it has changed to Get-AzStorageAccount in the end of 2018.

And per microsoft/azure-pipelines-tasks#14647 (comment), it looks Get-AzStorageAccount doesn't have the issue and works well.

Would you please upgrade to Get-AzStorageAccount cmdlet in Az.Storage module?

And it looks the error is from server.
If you can share the debug log by setting $DebugPreference = "Continue", we can see more details for the error, and then can continue the investigation.

@mitsha-microsoft
Copy link
Member

@blueww I will need to verify what cmdlet and version is being used by the respective Azure Pipelines Task and will get back to you on it after I get some details.
I can try generating and sharing the Debug logs, but the issue occurs randomly in a release pipeline so reproducing it might get tricky. Let me check what I can do here

@navba-MSFT navba-MSFT self-assigned this Aug 19, 2022
@navba-MSFT
Copy link
Contributor

navba-MSFT commented Aug 19, 2022

@diegum Thanks for reaching out to us and reporting this issue. Did you get a chance to look at the above comment and check your pipeline tasks and use Get-AzStorageAccount PS cmdlet instead?

Also Could you please confirm if you are facing the same issue while running the command from Powershell console ? If yes, please share the $DebugPreference = "Continue" output while running the same command in the Powershell. Awaiting your reply.

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Aug 19, 2022
@mitsha-microsoft
Copy link
Member

@navba-MSFT I have asked for clarification in this issue since I did see references of Get-AzureRmStorageAccount which I believe might be causing this bug. Will update when there's any response to it.

@diegum
Copy link
Author

diegum commented Aug 20, 2022

@diegum , could you see the same issue when you use the same cmdlet in PowerShell console local rather than Azure pipeline. We need you provide debug information. You can see debug information after setting $DebugPreference = "Continue".

Thanks, @dingmeng-xue but, how could I try? I'm not the maker of that cmdlet. I'm an end user, actually. I have a declared pipeline and applied that AzureFileCopy task based on its documentation. Are you suggesting that I clone the Azure pipeline tasks repo and try to run the file copy task manually??

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Aug 20, 2022
@diegum
Copy link
Author

diegum commented Aug 20, 2022

@diegum , @mitsha-microsoft

From the comment microsoft/azure-pipelines-tasks#14647 (comment), I see: The failure is on Get-AzureRmStorageAccount, which is very old cmdlet, it has changed to Get-AzStorageAccount in the end of 2018.

And per microsoft/azure-pipelines-tasks#14647 (comment), it looks Get-AzStorageAccount doesn't have the issue and works well.

Would you please upgrade to Get-AzStorageAccount cmdlet in Az.Storage module?

And it looks the error is from server. If you can share the debug log by setting $DebugPreference = "Continue", we can see more details for the error, and then can continue the investigation.

Thanks, @blueww but, how can I upgrade the cmdlet?? I'm using an Azure pipeline task (AzureFileCopy). Whatever the task uses under the hood is outside my reach. Am I missing something?

@diegum
Copy link
Author

diegum commented Aug 20, 2022

@diegum Thanks for reaching out to us and reporting this issue. Did you get a chance to look at the above comment and check your pipeline tasks and use Get-AzStorageAccount PS cmdlet instead?

Also Could you please confirm if you are facing the same issue while running the command from Powershell console ? If yes, please share the $DebugPreference = "Continue" output while running the same command in the Powershell. Awaiting your reply.

Hi, @navba-MSFT . I replied to these comments (check whether the azure pipeline task uses an obsolete command, and the suggestion to run from terminal. I'll summarize my answers here: I'm an end-user. I'm just using AzureFileCopy as a black box from a pipeline. I don't have access to that task source code (although I know that its source code is in the Azure pipeline tasks repo.) I want to confirm that you guys are asking me to clone the Azure Pipeline tasks repo, try running the AzureFileCopy task from its command let.

What I certainly can't do is to modify the AzureFileCopy implementation, I'm afraid. I guess that if we confirm that the implementation is obsolete, I'll depend on the Azure pipeline tasks guys to fix it. Ironically, as I said when opening the thread, they asked the community to reopen this ticket to you guys.

@mitsha-microsoft
Copy link
Member

Hi @diegum,
I dont think you need to either clone the task and run it from terminal, or try to modify the implementation of the AzureFileCopy task. I have raised the appropriate concerns raised by @navba-MSFT / @blueww with a new issue on the Azure Pipelines Task (linked here) and you are correct, that we need to depend on the Azure pipeline task guys to fix it. Lets wait for their response.

@navba-MSFT
Copy link
Contributor

Thanks @mitsha-microsoft .

@diegum I am following up offline with the assignee of microsoft/azure-pipelines-tasks#16757 to look into it on priority.

navba-MSFT added a commit to navba-MSFT/azure-pipelines-tasks that referenced this issue Aug 23, 2022
fixes Azure/azure-powershell#19209

Customers have reported an issue with the Pipeline tasks for while it tries to fetch the storage account details it fails with below error:

##[error]Storage account: <my existing and accessible storage account> not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only.

Cause of the issue:
Get-AzureRmStorageAccount is outdated and needs to be replaced with Get-AzStorageAccount.
@navba-MSFT
Copy link
Contributor

@diegum @mitsha-microsoft see this PR microsoft/azure-pipelines-tasks#16785 and the below comments from it:

I have completed this PR - https://dev.azure.com/mseng/AzureDevOps/_git/AzureDevOps/pullrequest/663407
for creating AzureFileCopyV5 task.

@navba-MSFT navba-MSFT removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Sep 1, 2022
@mitsha-microsoft
Copy link
Member

@navba-MSFT Thanks for taking it up and fixing the issue in the Az Pipelines Repo. When will you make the requested changes (bumping up the task versions) so that we can get an idea of when we can consume the new tasks in our pipelines?

mmrazik added a commit to microsoft/azure-pipelines-tasks that referenced this issue Sep 2, 2022
* {AzurePipelineTasks} fixes Azure/azure-powershell#19209

fixes Azure/azure-powershell#19209

Customers have reported an issue with the Pipeline tasks for while it tries to fetch the storage account details it fails with below error:

##[error]Storage account: <my existing and accessible storage account> not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only.

Cause of the issue:
Get-AzureRmStorageAccount is outdated and needs to be replaced with Get-AzStorageAccount.

* Update AzureUtilityARM.ps1

Customers have reported an issue with the Pipeline tasks for while it tries to fetch the storage account details it fails with below error:

##[error]Storage account: <my existing and accessible storage account> not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only.

Cause of the issue:
Get-AzureRmStorageAccount is outdated and needs to be replaced with Get-AzStorageAccount.

* Update task.json

* Update task.loc.json

* Bumping up task versions

Co-authored-by: Martin Mrazik <mmrazik@users.noreply.github.com>
Co-authored-by: Philipson Joseph V <77002750+PhilipsonJoseph@users.noreply.github.com>
Co-authored-by: Philipson Joseph V <v-phiv@microsoft.com>
@navba-MSFT
Copy link
Contributor

@diegum @mitsha-microsoft The suggested changes have been made in the OR and the PR is now merged. It will get released as a part of current sprint (210). Check current Azure DevOps sprint - https://whatsprintis.it/

mpodriezov added a commit to microsoft/azure-pipelines-tasks that referenced this issue Sep 29, 2022
mpodriezov added a commit to microsoft/azure-pipelines-tasks that referenced this issue Sep 29, 2022
)

* Revert "{AzurePipelineTasks} fixes Azure/azure-powershell#19209 (#16785)"

This reverts commit 54890ae.

* Update task.json

Reverted the 209, bumped to 210.1

* Update task.loc.json

Reverted 209

* Update task.json

Reverted to prev version 209

* Update task.loc.json

Reverted to prev version 209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. Storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants