Forum Discussion

srinivasmummareddy's avatar
srinivasmummareddy
Copper Contributor
Jan 22, 2024

Githubservice connection issue

I have created a github service connection. Github service connection should be visible while creating ci yaml pipeline using UI but its asking me to login everytime.I don't want to use credentials to login(I intentionally signed out). I can only rely on service connection

1 Reply

  • Referring this:

     

    1. Grant Access to Pipelines

    • When creating the service connection, ensure that the "Grant access permission to all pipelines" option is selected. This allows the service connection to be used without requiring additional authentication.

    2. Check Service Connection Authorization

    • Go to Project Settings > Service Connections in Azure DevOps.
    • Select your GitHub service connection and ensure it is authorized for use in pipelines. If not, click Authorize.

    3. Use a Personal Access Token (PAT)

    • If the service connection still prompts for login, ensure that it is using a valid GitHub Personal Access Token (PAT) for authentication. You can generate a PAT in GitHub with the necessary scopes (e.g., repo, workflow) and update the service connection.

    4. Verify YAML Pipeline Configuration

    • In your YAML pipeline, ensure that the service connection is referenced correctly:
    resources:
      repositories:
        - repository: myrepo
          type: github
          name: org/repo
          endpoint: my-github-service-connection
    

    5. Clear Cached Credentials

    • If you previously logged in with credentials, Azure DevOps might be caching them. Clear the cached credentials and try again:
      • In Windows, go to Credential Manager and remove any stored GitHub credentials.
      • In macOS or Linux, clear the credentials stored in your keychain or credential store.

    6. Use OAuth for Authentication

    • If you prefer not to use a PAT, ensure that the service connection is configured to use OAuth for authentication. This allows Azure DevOps to authenticate with GitHub without requiring you to log in manually.