Skip to content

Improve Azure OpenAI BYOK provider configuration - #45610

Open
Aditi16-ctrl wants to merge 5 commits into
github:mainfrom
Aditi16-ctrl:main
Open

Improve Azure OpenAI BYOK provider configuration #45610
Aditi16-ctrl wants to merge 5 commits into
github:mainfrom
Aditi16-ctrl:main

Conversation

@Aditi16-ctrl

@Aditi16-ctrl Aditi16-ctrl commented Aug 25, 2026

Copy link
Copy Markdown

Why:

The BYOK documentation for GitHub Copilot CLI was missing several supported environment variables and contained an incorrect Azure provider base URL format. These updates improve the completeness and accuracy of the documentation and simplify the Azure configuration by removing the deployment-name dependency from the base URL.

Closes:

Closes #44864

What's being changed (if available, include any code snippets, screenshots, or gifs):

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

Additional context:

This PR directly addresses the documentation updates requested in #44864.

I made the requested changes to the affected BYOK documentation and raised this PR for review. If additional context is needed to process the PR, please feel free to comment here and I will provide it.

Added new environment variables for model provider configuration, including bearer token, wire API, and Azure-specific settings.
Updated environment variable documentation for using custom models in GitHub Copilot CLI. Added Azure-specific variables and corrected formatting issues.
@welcome

welcome Bot commented Aug 25, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@subatoi

subatoi commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hello, without any context I'm unable to process this PR for review—please feel free to comment here if this has been closed in error, and provide more context. Thank you

@subatoi subatoi closed this Aug 25, 2026
@Aditi16-ctrl

Copy link
Copy Markdown
Author

Hey I have updated the above comment about the changes made in the doc and focusing on which issue.
Please review it again.

@subatoi subatoi reopened this Aug 25, 2026

@subatoi subatoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Aditi16-ctrl—the issue in question hasn't been approved for a community contribution, but if/when it is, I'll try to include this contribution if possible

Comment thread content/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models.md Outdated
Unnecessary note

@hubwriter hubwriter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together! I checked the changes against the Copilot CLI source. A few things look great, and there's one correctness issue worth fixing before merge.

Verified correct against the code:

  • Shortening the Azure COPILOT_PROVIDER_BASE_URL to the resource origin (https://YOUR-RESOURCE-NAME.openai.azure.com) is right — the runtime derives the /openai/... path itself from the origin.
  • COPILOT_PROVIDER_AZURE_API_VERSION, COPILOT_PROVIDER_MAX_PROMPT_TOKENS, and COPILOT_PROVIDER_MAX_OUTPUT_TOKENS descriptions match the runtime behavior. Adding COPILOT_PROVIDER_BEARER_TOKEN and COPILOT_PROVIDER_WIRE_API is a good addition.

Needs a fix:

  • COPILOT_PROVIDER_MODEL_ID and COPILOT_PROVIDER_WIRE_MODEL are described the wrong way round (in the table, the Azure shell example, and the new subsection). In the code, WIRE_MODEL is what routes the Azure request (the deployment name) and MODEL_ID is the well-known model used for capabilities/token limits. See the inline comments for the exact swap.

Minor / formatting:

  • A blank line was removed before the config table, and there's a missing blank line before the new ### Azure-specific environment variables heading — both affect rendering. Details inline.

Left the specifics as inline comments. Happy to help verify once updated.

Comment on lines +54 to +55
| `COPILOT_PROVIDER_MODEL_ID` | Azure only | The Azure OpenAI deployment name used to route requests. |
| `COPILOT_PROVIDER_WIRE_MODEL` | Azure only | The underlying model name associated with the deployment. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The descriptions for these two variables appear to be swapped relative to how the CLI actually uses them.

In the runtime, COPILOT_PROVIDER_WIRE_MODEL is the model name sent on the wire to the provider — for Azure this becomes the value in the /deployments/{model} path, i.e. the deployment name that routes the request. COPILOT_PROVIDER_MODEL_ID is the well-known model ID used to select model capabilities and token limits (both default to COPILOT_MODEL).

The CLI's own --help text describes them as:

  • COPILOT_PROVIDER_MODEL_ID: "well-known model ID used for agent configuration and token limits. Defaults to COPILOT_MODEL."
  • COPILOT_PROVIDER_WIRE_MODEL: "model name sent to the provider API for inference. Defaults to COPILOT_MODEL."

So the descriptions should be flipped:

  • COPILOT_PROVIDER_MODEL_ID → the well-known model name used to identify capabilities/token limits (e.g. gpt-4o).
  • COPILOT_PROVIDER_WIRE_MODEL → the Azure deployment name that requests are routed through.

Minor: these two variables aren't strictly "Azure only" — they apply to any BYOK provider (they default to COPILOT_MODEL), though they're most relevant for Azure where the deployment name differs from the model name. Consider "No" with an Azure note, or keeping "Azure only" if that's the intended scope for the article.


You configure your model provider by setting environment variables before starting {% data variables.copilot.copilot_cli_short %}.

| Environment variable | Required | Description |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removed the blank line between the intro sentence and the table. Markdown tables need a blank line before them to render as a table — without it the table row may be absorbed into the preceding paragraph. Please restore the blank line here:

You configure your model provider by setting environment variables before starting {% data variables.copilot.copilot_cli_short %}.

| Environment variable | Required | Description |

Comment on lines +94 to +95
export COPILOT_PROVIDER_MODEL_ID=YOUR-DEPLOYMENT-NAME
export COPILOT_PROVIDER_WIRE_MODEL=YOUR-MODEL-NAME

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same swap as in the table above — these two values are reversed. Based on the runtime behavior, COPILOT_PROVIDER_WIRE_MODEL is what routes the Azure request (the deployment name), and COPILOT_PROVIDER_MODEL_ID is the well-known model identity used for capabilities/token limits. So this example should be:

export COPILOT_PROVIDER_MODEL_ID=YOUR-MODEL-NAME
export COPILOT_PROVIDER_WIRE_MODEL=YOUR-DEPLOYMENT-NAME

And correspondingly COPILOT_MODEL=YOUR-DEPLOYMENT-NAME — please double-check the intended value here too, since COPILOT_MODEL is the model identifier the CLI resolves against and both MODEL_ID/WIRE_MODEL fall back to it. The placeholder descriptions below (YOUR-DEPLOYMENT-NAME / YOUR-MODEL-NAME) will need to line up with whichever assignment they belong to once the swap is fixed.

* `YOUR-MODEL-NAME`: the underlying model associated with the deployment (for example, `gpt-4o`)
* `YOUR-AZURE-API-VERSION`: the Azure OpenAI API version
* `YOUR-AZURE-API-KEY`: your Azure OpenAI API key
### Azure-specific environment variables

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no blank line between the placeholder bullet list above and this ### heading, so it will not render as a heading (it will be treated as part of the preceding list/paragraph). Please add a blank line before it:

    * `YOUR-AZURE-API-KEY`: your Azure OpenAI API key

### Azure-specific environment variables

Also, once the MODEL_ID / WIRE_MODEL descriptions are corrected, note that this subsection largely repeats the two rows now added to the main table above — consider whether both are needed, or keep just one to avoid the descriptions drifting out of sync.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
copilot/how-tos/copilot-cli/customize-copilot/use-byok-models.md fpt
ghec
fpt
ghec

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@hubwriter

Copy link
Copy Markdown
Contributor

Thanks very much for opening this, @Aditi16-ctrl — this is a helpful improvement to the BYOK docs, and it closes out most of what was raised in #44864. 🙏

I verified the changes against the Copilot CLI source. The good news: shortening the Azure COPILOT_PROVIDER_BASE_URL to the resource origin is correct, and the new COPILOT_PROVIDER_AZURE_API_VERSION, COPILOT_PROVIDER_MAX_PROMPT_TOKENS, and COPILOT_PROVIDER_MAX_OUTPUT_TOKENS entries match how the runtime behaves.

One correctness item to fix before merge: the descriptions of COPILOT_PROVIDER_MODEL_ID and COPILOT_PROVIDER_WIRE_MODEL are swapped. In the code, COPILOT_PROVIDER_WIRE_MODEL is the value sent on the wire that routes the Azure request (the deployment name), while COPILOT_PROVIDER_MODEL_ID is the well-known model used for capabilities and token limits. There are also two small markdown formatting fixes (a blank line before the config table and before the new ### heading) so everything renders correctly.

I've left the specifics as inline review comments. Once those are addressed I think this is good to go — thanks again for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing env variables and fix BYOK docs

3 participants