-
While running 15.2, I was able to run migrations from many sources to many destinations. After upgrading to 16.0.1, all migration attempts end after a few seconds, with the error stating that the PersonalAccessToken is missing from my Target configuration. However, my configuration does include a PAT. I have attempted this with several 15.2 versioned config files, as well as the above, which was taken from a newly initialized config file (with relevant configs added, including of course my PAT). I have also attempted to change to Prompt authentication, and tried adding / removing the NetworkCredentials block. "Target": {
"EndpointType": "TfsTeamProjectEndpoint",
"Collection": "https://dev.azure.com/ContosoInc/",
"Project": "Company Project",
"Authentication": {
"AuthenticationMode": "AccessToken",
"AccessToken": "thisiswhereatokengoesanditalmostkindalookslikethis"
},
"ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}, [08:26:13 INF] [16.0.1] Migration Context Start: TfsWorkItemMigrationProcessor
[08:26:13 ERR] [16.0.1] When you are migrating to Azure DevOps you MUST provide an PAT so that we can call the REST API for certain actions. For example we would be unable to deal with a Work item Type change.
System.InvalidOperationException: Missing PersonalAccessToken from Target |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 18 replies
-
Hi there, ACTION REQUIRED In order for us to help you will need to provide both the log, and the configration file that you are using. Generate and Attach Log Steps:
Your assistance is greatly appreciated! Thanks, Azure DevOps Migration Tools team |
Beta Was this translation helpful? Give feedback.
-
Can you provide the full configuration? Things to check:
Note on the new format: The new configuration format supports multiple endpoints. We transitioned from a grouped set of lists to a single set of named entries. This change allows overrides via the command line and environment variables. The validation error you're encountering adds an extra layer to ensure a Personal Access Token (PAT) is used when connecting to Azure DevOps (ADO). PAT Token Validation Logic:private void ValidatePatTokenRequirement()
{
string collUrl = Target.Options.Collection.ToString();
if (collUrl.Contains("dev.azure.com") || collUrl.Contains(".visualstudio.com"))
{
var token = Target.Options.Authentication.AccessToken;
// Check if the token is missing
if (token.IsNullOrEmpty())
{
var ex = new InvalidOperationException("Missing PersonalAccessToken from Target");
Log.LogError(ex, "When migrating to Azure DevOps, you MUST provide a PAT to access the REST API for certain actions. For example, handling Work Item Type changes would be impossible without it.");
Environment.Exit(-1);
}
}
} Endpoint Configuration Example:Your endpoint should be structured like this: {
"MigrationTools": {
"Endpoints": {
"Target": {
"EndpointType": "TfsTeamProjectEndpoint",
"Collection": "https://dev.azure.com/ContosoInc/",
"Project": "Company Project",
"Authentication": {
"AuthenticationMode": "AccessToken",
"AccessToken": "thisiswhereatokengoesanditalmostkindalookslikethis"
},
"ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
}
}
}
} Supporting Multiple Endpoints:To support multiple endpoints, you can use named entries: {
"MigrationTools": {
"Endpoints": {
"Target": {
"EndpointType": "TfsTeamProjectEndpoint",
"Collection": "https://dev.azure.com/ContosoInc/",
"Project": "Company Project",
"Authentication": {
"AuthenticationMode": "AccessToken",
"AccessToken": "thisiswhereatokengoesanditalmostkindalookslikethis"
},
"ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Alpha": {
"EndpointType": "TfsTeamProjectEndpoint",
"Collection": "https://dev.azure.com/ContosoInc/",
"Project": "Company Project",
"Authentication": {
"AuthenticationMode": "AccessToken",
"AccessToken": "thisiswhereatokengoesanditalmostkindalookslikethis"
},
"ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Beta": {
"EndpointType": "TfsTeamProjectEndpoint",
"Collection": "https://dev.azure.com/ContosoInc/",
"Project": "Company Project",
"Authentication": {
"AuthenticationMode": "AccessToken",
"AccessToken": "thisiswhereatokengoesanditalmostkindalookslikethis"
},
"ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
}
}
}
} This structure allows you to define multiple endpoints with the flexibility to customize their configurations as needed. |
Beta Was this translation helpful? Give feedback.
-
Hi there, ACTION REQUIRED In order for us to help you will need to provide both the log, and the configration file that you are using. Generate and Attach Log Steps:
Your assistance is greatly appreciated! Thanks, Azure DevOps Migration Tools team |
Beta Was this translation helpful? Give feedback.
-
Hi similar isse was turned up here.
|
Beta Was this translation helpful? Give feedback.
-
If I run your config it passes validation! |
Beta Was this translation helpful? Give feedback.
-
Any advice? |
Beta Was this translation helpful? Give feedback.
@denniselit the config you are providing here is not the config tha the tool is using! In the log you have 2 fieldmapps, and in the config that you are providing you have only 1.
Can you provide
C:\Users\U\AppData\Local\Microsoft\WinGet\Packages\nkdAgility.AzureDevOpsMigrationTools.Preview_Microsoft.Winget.Source_8wekyb3d8bbwe\configuration.json
as this is the one that is running!devopsmigration
is runs relative to the install location and not the location that you are running the tool. This is due to bugs in portable support inwinget
that are fixed in the next version.