This document explains how a repository gains access to the default GitHub App authentication path for the OneLocBuild localization check-in PR. It supplements the main OneLocBuild in Arcade documentation.
When OneLocBuild is configured for a GitHub-based repo (RepoType: gitHub), the task opens or
updates a pull request to check in localized files. The GitHub App authentication path mints a
short-lived installation token (ghs_…) at build time, avoiding a stored GitHub credential. The
repositories accessible to the token are determined by the GitHub App installation configuration
(all repositories or the selected repositories).
GitHub installation tokens expire after one hour.
The GitHub App used for this is dotnet OneLoc Localization (owned by @dotnet-bot). Its only
job is to open/update the localization check-in PR on your repository.
The App path is enabled by default. In
onelocbuild.yml, the App token is minted only
when all of the following are true:
UseGitHubAppAuthenticationistrue(the default), andRepoTypeisgitHub, and- the build is running in the
internalAzure DevOps project (the App service connection and Key Vault key are scoped todnceng/internal).
When those hold, the job runs get-github-app-token.yml,
which signs a JWT with the App's RSA key in Key Vault, exchanges it for an installation token, and
passes that token to the OneLocBuild task via gitHubPatVariable.
If UseGitHubAppAuthentication is explicitly set to false — or the build runs in any project
other than internal (e.g. DevDiv, public) — the job uses the existing GithubPat parameter.
This is a template-selection fallback only: if App token minting or authentication fails after the
App path is selected, the job fails and does not retry with the PAT.
"Access" means two separate things, and both are required:
- The App must be installed on the GitHub org/account that owns your target repo, and your specific repository must be selected in that installation. The App can only open a PR against a repository it is installed on. This is what actually grants the App permission to your repo.
- Your pipeline must use the default App path by leaving
UseGitHubAppAuthenticationset totruein theonelocbuild.ymltemplate call.
The App installation and the backing dnceng/internal service connection / Key Vault key are
managed by the .NET Engineering Services (dnceng) team. To have your repo added:
- Identify the GitHub org and repository your OneLoc check-in PR targets. For most repos
this is the value of the
GitHubOrgparameter (defaultdotnet) and your repo name. If you use a mirrored repository, it's theGitHubOrg/MirrorRepothe PR is opened against — not the Azure DevOps mirror. - Reach out to the First Responders
channel
and ask them to add your repository to the
dotnet OneLoc LocalizationGitHub App installation for the appropriate org. - The App must have permission to open pull requests (Contents + Pull requests: read & write) on the selected repository. dnceng configures this as part of the installation.
Note: The App is installed per GitHub organization. If your repo lives in an org where the App is not yet installed, dnceng will need to install and approve it in that org first, which may require an org owner's approval.
Once your repo is part of the App installation, no authentication parameter is required in the OneLocBuild template call. For example:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-YOURREPO'The dnceng service connection, App client ID, Key Vault, and key name are centralized as defaults in
the Arcade template. They can be overridden for separately provisioned infrastructure. A pipeline
can temporarily set UseGitHubAppAuthentication: false to select the PAT path instead.
| Parameter | Default | Notes |
|---|---|---|
UseGitHubAppAuthentication |
true |
Activates the App path for GitHub repos in dnceng/internal. Set to false to select the PAT path. |
GitHubAppServiceConnection |
'dnceng-oneloc-githubapp' |
The Azure DevOps WIF service connection whose identity has Sign permission on the App's Key Vault key. |
GitHubAppClientId |
'Iv23lijBU8x3gc9lDOc9' |
The GitHub App's Client ID (used as the JWT iss claim). |
GitHubAppKeyVaultName |
'EngKeyVault' |
The Key Vault holding the App's RSA signing key. |
GitHubAppKeyName |
'oneloc-localization-app-key' |
The name of the RSA key inside that Key Vault (the App's private key). |
The token is minted for the installation on the GitHubOrg account (default dotnet), so make sure
GitHubOrg (and MirrorRepo, if mirroring) point at the org/repo where the App is installed.
- Run your pipeline (on the
internalproject) from a branch where the OneLocBuild job runs. - In the build, confirm the
Get GitHub App installation tokenstep runs and succeeds before theOneLocBuildtask. - Confirm the check-in PR is opened by the
dotnet OneLoc LocalizationApp (the PR author will be the App / its bot identity).
- The App-token step is skipped. The App path only activates when
UseGitHubAppAuthenticationistrue,RepoTypeisgitHub, and the build runs in theinternalproject. Verify all three. - Token minting fails with a Key Vault authorization error. The service connection identity
needs the
Key Vault Crypto Userrole (or at least theSignaction) on the App's key. Contact First Responders. 404/Not Foundwhen requesting the installation token. The App is not installed on theGitHubOrgaccount, or your repository was not selected in the installation. Complete Step 1.- PR fails to open on your repo. Ensure the App has
ContentsandPull requests(read & write) permission on the selected repository, and that your repo is included in the installation.
- The App path is only available in the
dnceng/internalAzure DevOps project. Pipelines in other projects useGithubPatand are not covered by thednceng-oneloc-githubappservice connection. DevDiv can use the same template path after a DevDiv-scoped service connection and signing-key access are provisioned.