Skip to content

AzureFileCopyV6 task failing with "##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet..." #20965

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

Closed
4 of 7 tasks
Apurva-tech opened this issue Apr 3, 2025 · 2 comments

Comments

@Apurva-tech
Copy link
Member

Apurva-tech commented Apr 3, 2025

New issue checklist

Task name

AzureFileCopyV6

Breaking task version

V6

Last working task version

No response

Regression Description

A regression happened!

The following pipeline: https://microsoft.visualstudio.com/Universal%20Store/_build/results?buildId=119681486&view=logs&j=15dfcb1a-0989-5cf6-3160-3e181e44de87&t=7f38a826-dcdc-5dce-32e2-bd5be705b052 fails with this error message:

##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 11

Relevant log output

Environments : {[AzureChinaCloud, AzureChinaCloud], [AzureCloud, AzureCloud], 
               [AzureUSGovernment, AzureUSGovernment]}
Context      : Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext

Set-AzContext 
Name                           Value                                           
----                           -----                                           
SubscriptionId                 48bf4472-5414-439f-aa23-70f9662bb415            




Name               : DPSRPE_SCID6740877_PartnerCompetency_PPE  
                     ***
Subscription       :  
Account            : ***
Environment        : AzureCloud
Tenant             :
TokenCache         : 
VersionProfile     : 
ExtendedProperties : {}

##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Finishing: AzureBlob File Copy - dist (windows_build_container)

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 https://microsoft.visualstudio.com/Universal%20Store/_build/results?buildId=119681486&view=logs&j=15dfcb1a-0989-5cf6-3160-3e181e44de87&t=7f38a826-dcdc-5dce-32e2-bd5be705b052 
SUCCESSFUL RUN
 https://microsoft.visualstudio.com/Universal%20Store/_build/results?buildId=119520287&view=results 

Repro steps

# Trigger: https://microsoft.visualstudio.com/Universal%20Store/_build?definitionId=114697&_a=summary from ExpertMspUI_AppService_master branch
# The Azure File Copy V6 task fails with above mentioned error
@Apurva-tech Apurva-tech added bug regression This used to work, but a change in the service/tasks broke it. labels Apr 3, 2025
@v-schhabra
Copy link
Contributor

Hi @Apurva-tech
Could you pls add the variable "system.debug" to "true" and trigger the pipeline again?

@v-schhabra v-schhabra changed the title [REGRESSION]: AzureFileCopyV6 task failing with "##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet..." AzureFileCopyV6 task failing with "##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet..." Apr 4, 2025
@v-schhabra v-schhabra removed the regression This used to work, but a change in the service/tasks broke it. label Apr 4, 2025
@Apurva-tech
Copy link
Member Author

adding install/importort statements to task fixed the error
Install-Module -Name Az -Force -AllowClobber -Scope CurrentUser -Repository PSGalleryUpstream -Credential $myCredentialsObject
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Repository PSGalleryUpstream -Credential $myCredentialsObject
Import-Module Az
Import-Module Az.Accounts
Import-Module Az.Storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@Apurva-tech @v-schhabra and others