microsoft / azure-artifacts-migration

Migration scripts to help move your packages to Azure Artifacts from other package repositories.
MIT License
13 stars 18 forks source link

The user '' is not authorized to access this resource #13

Closed woeterman94 closed 2 years ago

woeterman94 commented 2 years ago

Username somehow becomes empty.

The user '' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundatio
n.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}
At C:\Users\WouterVanDerAuwera\Documents\WindowsPowerShell\Modules\AzureArtifactsPackageMigration\1.0.1\Module\MyGetPackageMigration.psm1:291 char:13
+     return (Invoke-RestMethod -Uri $IndexUrl -Credential $Credential) ...

Command I use

Move-MyGetNuGetPackages -SourceIndexUrl 'https://pkgs.dev.azure.com/serverA/nuget/v3/index.json' -DestinationIndexUrl 'https://pkgs.dev.azure.com/serverB/_packaging/Project/nuget/v3/index.json' -Verbose

Both destinations are configured with credentials in my nuget.config

woeterman94 commented 2 years ago

destination credentials work (it is prompted in the script), but source doesn't

Found 0 package versions in source, 10657 package versions in destination, and 0 packages versions need to be copied

woeterman94 commented 2 years ago

Okay, I'm no longer counting on the credentials provided in my nuget.config. I'm just passing my credentials allong with the script using the SourceUsername and SourcePassword parameters.