Azure-Player / azure.datafactory.devops

Azure DevOps Deployment Tasks for Azure Data Factory objects
MIT License
39 stars 21 forks source link

##[error]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper] #100

Closed SQL-RedUnited closed 2 years ago

SQL-RedUnited commented 2 years ago

HI Getting the above error intermittently over the past few days. Retrying eventually gets it to go through though. Any ideas?

2022-08-11T08:11:17.4531315Z ##[section]Starting: Publish ADF resources to Integration instance
2022-08-11T08:11:17.4692134Z ==============================================================================
2022-08-11T08:11:17.4692496Z Task         : Publish Azure Data Factory
2022-08-11T08:11:17.4692816Z Description  : Deploys entire ADF (v2) from JSON files to ADF instance (adftools)
2022-08-11T08:11:17.4693088Z Version      : 1.13.1171
2022-08-11T08:11:17.4693321Z Author       : Kamil Nowinski (SQLPlayer)
2022-08-11T08:11:17.4694327Z Help         : [More Information](https://github.com/SQLPlayer/azure.datafactory.devops)
2022-08-11T08:11:17.4694708Z ==============================================================================
2022-08-11T08:11:18.5860083Z PowerShell: 5.1.20348.643 Desktop
2022-08-11T08:11:19.3777144Z ##[warning]Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide
2022-08-11T08:11:23.5798141Z Added TLS 1.2 in session.
2022-08-11T08:11:24.0128217Z ##[command]Import-Module -Name C:\Modules\az_7.5.0\Az.Accounts\2.9.1\Az.Accounts.psd1 -Global
2022-08-11T08:11:24.3408101Z ##[warning]Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide
2022-08-11T08:11:26.7764957Z ##[error]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper].
2022-08-11T08:11:26.8309221Z ##[section]Finishing: Publish ADF resources to Integration instance
ThatBlokeCalledJay commented 2 years ago

Hey guys, we are getting this error too.

[debug]Leaving D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.13.1171\PublishADF.ps1.

[debug]Caught exception from task script.

[debug]Error record:

[debug]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper].

[debug]At C:\Modules\az_7.5.0\Az.Accounts\2.9.1\Az.Accounts.psm1:162 char:1

[debug]+ [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper]::R ...

[debug]+ ~~~~~~~~~~~~~~

[debug] + CategoryInfo : InvalidOperation: (Microsoft.Azure...dNotFoundHelper:TypeName) [], ParentContainsErrorRe cordException

[debug] + FullyQualifiedErrorId : TypeNotFound

[debug]

[debug]Script stack trace:

[debug]at , C:\Modules\az_7.5.0\Az.Accounts\2.9.1\Az.Accounts.psm1: line 162

[debug]at Import-AzModule, D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.13.1171\psmodules\VstsAzureHelpers\InitializeAzModuleFunctions.ps1: line 58

[debug]at Initialize-AzModule, D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.13.1171\psmodules\VstsAzureHelpers\InitializeAzModuleFunctions.ps1: line 14

[debug]at , D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.13.1171\CoreAz.ps1: line 21

[debug]at , D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.13.1171\PublishADF.ps1: line 46

[debug]at , : line 1

[debug]at , : line 22

[debug]at , : line 18

[debug]at , : line 1

[debug]Exception:

[debug]System.Management.Automation.ParentContainsErrorRecordException: Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper].

[error]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper].

[debug]Processed: ##vso[task.logissue type=error]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper%5D.

[debug]Processed: ##vso[task.complete result=Failed]

BeneHa commented 2 years ago

Same here, it started today and is not intermittent so far, the deployment pipeline stopped working for now. Would be great if you can have a look @NowinskiK .

tmdonovan commented 2 years ago

Same here, started experiencing the issue this week. It was intermittent earlier in the week but seems to be stopping everything today so far.

balamurugan678 commented 2 years ago

We are in the same boat as well. The deployments are blocked since today morning. Apparently tried previous versions(e.g: 1.11.1070,1.12.1145 ) but no luck on them as well. Please can someone treat this as a blocker. Thanks!

slaguiar commented 2 years ago

Hi. Exactly the same here..

pedromatostlw7 commented 2 years ago

Hello.

Had the same problem.

What I notice different was the account package.

Before the error, I had: Modules\az_7.5.0\Az.Accounts\2.9.0\Az.Accounts.psd1

Now I have: Modules\az_7.5.0\Az.Accounts\2.9.1\Az.Accounts.psm1

NowinskiK commented 2 years ago

Guys, thanks for raising the issue. I'm looking on this right now.

NowinskiK commented 2 years ago

Problem is fixed in latest version 1.14.1173

ghost commented 2 years ago

I know that this is closed, but since Monday we have been having our DevOps Deployments failing:-

Starting: Deploy Data Factory

Task : Publish Azure Data Factory Description : Deploys entire ADF (v2) from JSON files to ADF instance Version : 0.90.792 Author : Kamil Nowinski (SQLPlayer) Help : More Information

PowerShell: 5.1.17763.2931 Desktop

[warning]Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide

Import-Module -Name C:\Modules\az_7.5.0\Az.Accounts\2.9.1\Az.Accounts.psd1 -Global

[warning]Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide

##[error]Unable to find type [Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper].

Usually it would carry on like this but just stops as above:-

... ... ... Clear-AzContext -Scope Process Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue Connect-AzAccount -ServicePrincipal ... ... ...

can you advise please as we are stuck :-(

NowinskiK commented 2 years ago

The others do not complain, so I believe it's fixed. Please double-check your version.

ghost commented 2 years ago

Thank you for your reply. Yes, it was the version that was causing the issue - we are using a framework provided by a third party and it took some working out to say the least to realise this is the crucial line to change:-

task: SQLPlayer.DataFactoryTools.PublishADF.PublishADFTask@0 to task: SQLPlayer.DataFactoryTools.PublishADF.PublishADFTask@1

Hope it may help others.