azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

PersonalAccessToken not set on GitHub Service Endpoint

Open mgnsm opened this issue 5 years ago • 1 comments

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:

  1. Create a GitHub PAT

  2. Set the environment variable according to the docs:

     export AZURE_DEVOPS_EXT_GITHUB_PAT=<PAT>
    
  3. 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?

mgnsm avatar Oct 06 '20 20:10 mgnsm

Did you ever solve this? I am having the same issue.

mluker avatar Aug 04 '23 14:08 mluker