azure-devops-cli-extension
azure-devops-cli-extension copied to clipboard
PersonalAccessToken not set on GitHub Service Endpoint
Azure Cli Version: 2.12.1 Azure-Devops extension version: 0.18.0
I am trying to create a GitHub service connection using the az devops service-endpoint github create command but I can't seem to set the personal access token (PAT).
Steps to reproduce:
-
Create a GitHub PAT
-
Set the environment variable according to the docs:
export AZURE_DEVOPS_EXT_GITHUB_PAT=<PAT> -
Run the command:
az devops service-endpoint github create \ --github-url https://github.com \ --name MyServiceConnection \ --org <MyOrganization> --project <MyProject>
The accessToken is always set to null in the output and if I browse to the portal (dev.azure.com/MyOrganization) to verify the connection, it's not there either:
{
"administratorsGroup": null,
"authorization": {
"parameters": {
"accessToken": null
},
"scheme": "PersonalAccessToken"
},
"createdBy": {
...
},
"data": {},
"description": null,
"groupScopeId": null,
"id": "08611b67-f551-406c-b2bd-df30f369f7d4",
"isReady": true,
"isShared": false,
"name": "MyServiceConnection",
"operationStatus": null,
"owner": "library",
"readersGroup": null,
"serviceEndpointProjectReferences": [
{
"name": "MyServiceConnection ",
"projectReference": {
"id": "...",
"name": null
}
}
],
"type": "github",
"url": "https://github.com"
}
I get the same result if I don't set the AZURE_DEVOPS_EXT_GITHUB_PAT environment variable but enter the PAT manually in the prompt.
What am I doing wrong?
Did you ever solve this? I am having the same issue.