Using Azure OpenAI? #768

Closed
opened 2026-02-16 17:28:13 -05:00 by yindo · 1 comment
Owner

Originally created by @jckytf on GitHub (Jul 16, 2025).

The opencode auth login setup only asked for the API key.

I think it would require the base url also but i dont know how to add it.

I selected a model i deployed but I'm getting the following error:

AI_ LoadSetting - Error: Azure OpenAI resource name setting is missing. Pass it using the 'resourceName' parameter or the AZURE_RESOURCE_NAME environment variable.

Anyone know how to set this up? I'm trying to use GPT 4.1 and see how good this is compared to claude code.

Originally created by @jckytf on GitHub (Jul 16, 2025). The `opencode auth login` setup only asked for the API key. I think it would require the base url also but i dont know how to add it. I selected a model i deployed but I'm getting the following error: AI_ LoadSetting - Error: Azure OpenAI resource name setting is missing. Pass it using the 'resourceName' parameter or the AZURE_RESOURCE_NAME environment variable. Anyone know how to set this up? I'm trying to use GPT 4.1 and see how good this is compared to claude code.
yindo closed this issue 2026-02-16 17:28:13 -05:00
Author
Owner

@jckytf commented on GitHub (Jul 16, 2025):

I figured it out with the another closed issue. I set these 2 env variables in terminal with:
export AZURE_API_KEY="XXX"
export AZURE_RESOURCE_NAME="firstPartOfAzureBaseURL"

@jckytf commented on GitHub (Jul 16, 2025): I figured it out with the another closed issue. I set these 2 env variables in terminal with: export AZURE_API_KEY="XXX" export AZURE_RESOURCE_NAME="firstPartOfAzureBaseURL"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#768