mquekel / vsts-ip-restrictions

Add or remove IP Restrictions, use custom address or add the IP of the build agent.
1 stars 5 forks source link

Error Using Extension with Hosted Build Agents... #6

Closed juteasl closed 5 years ago

juteasl commented 5 years ago

Receiving this error with Microsoft Hosted Build agents. This just started on roughly 7/11/2019 and nothing has changed to the pipeline.

2019-07-12T16:52:38.9133393Z ##[error]System.TypeLoadException: Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalTrace' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.4.11002, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 2019-07-12T16:52:38.9134219Z ##[debug]Processed: ##vso[task.logissue type=error;]System.TypeLoadException: Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalTrace' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.4.11002, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.2019-07-12T16:52:38.9134637Z at Microsoft.WindowsAzure.Commands.Common.DebugStreamTraceListener.AddAdalTracing(DebugStreamTraceListener listener) 2019-07-12T16:52:38.9135154Z at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.SetupDebuggingTraces() in d:\workspace\powershell-sign\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRMCmdlet.cs:line 287 2019-07-12T16:52:38.9135421Z at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in d:\workspace\powershell-sign\src\Common\Commands.Common\AzurePSCmdlet.cs:line 269 2019-07-12T16:52:38.9135667Z at Microsoft.Azure.Commands.Profile.AddAzureRMAccountCommand.BeginProcessing() in d:\workspace\powershell-sign\src\ResourceManager\Profile\Commands.Profile\Account\AddAzureRmAccount.cs:line 116 2019-07-12T16:52:38.9135885Z at System.Management.Automation.Cmdlet.DoBeginProcessing() 2019-07-12T16:52:38.9136064Z at System.Management.Automation.CommandProcessorBase.DoBegin() 2019-07-12T16:52:38.9416473Z ##[error]System.Management.Automation.RuntimeException: There was an error with the service principal used for deployment.

mquekel commented 5 years ago

Thanks for reaching out and reporting this issue. It looks like something has changed in Azure. Are you using the latest version (v3)? This week I am not in a position where I have my Laptop with Internet. Alternatively you can look at the code and see which line is causing the error.

juteasl commented 5 years ago

I'll see if I can figure out what is causing the error and post an update. :) Thank you!

jmereaux commented 5 years ago

Potentially linked to this: https://developercommunity.visualstudio.com/content/problem/647760/microsoftidentitymodelclientsactivedirectoryadaltr.html

juteasl commented 5 years ago

I also created this issue with Microsoft because it appears that it is a MS hosted agent issue. https://developercommunity.visualstudio.com/content/problem/648196/hosted-agent-causing-extension-error.html

However, it looks like they closed it due to this one here. I tested the powershell code locally using my login information and the service principal login information and it worked fine for both. The only time it fails is when running on a hosted agent.

juteasl commented 5 years ago

I logged a new support issue with details about the two issues provided above. https://developercommunity.visualstudio.com/content/problem/649668/hosted-agent-causing-error-in-extension.html

juteasl commented 5 years ago

The extension is now working correctly again after the update to the MS Hosted agents.

mquekel commented 5 years ago

Hi @juteasl thanks for picking this up and reaching out to MS support. I am glad to see that the issue has been resolves now!