1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ClineでAzure AI FoundryやAzure OpenAIを利用する設定でハマった

Last updated at Posted at 2025-07-19

立ち位置整理記事を書いたAzure AI Foundry周りです。

Clineから使うときに設定手こずったのでメモです。

API Providerの設定は今のところ共通

Azure OpenAIやAI FoundryのAPIはOpenAIの基本的にAPI互換になっているので、OpenAI Compatibleを指定します。

CleanShot 2025-07-19 at 18.42.34.png

Clineの設定とAzure AI Foundryの相性が悪い? ハマったところ

Azure OpenAIだと管理画面のターゲットURLは

https://hogehoge-japan-east.openai.azure.com/openai/deployments/gpt-4.1/chat/completions?api-version=2025-01-01-preview

のようなURLです。

CleanShot 2025-07-19 at 18.48.31.png

罠っぽいところですが、ClineでBaseURLを入れるところがありますが

https://hogehoge-japan-east.openai.azure.com/https://hogehoge-japan-east.openai.azure.com/openai/deployments

だとAPIエラーになります。

CleanShot 2025-07-19 at 18.50.25.png

結論: /openai/deployments/モデル名 まで入れる

GPT-4.1ならhttps://hogehoge-japan-east.openai.azure.com/openai/deployments/gpt-4.1などモデル名まで入れ、 逆にModel IDのフォームは空でOKです。

CleanShot 2025-07-19 at 18.54.17.png

Azure OpenAI版

ということでGPT-4.1の場合

  • API Provider: OpenAI Compatible
  • BASE URL: https://hogehoge-japan-east.openai.azure.com/openai/deployments/gpt-4.1
  • APIキー: そのままAPIキーをコピペ
  • Model ID: 空欄
  • Set Azure API Version: 2024-12-01-preview など

Azure AI Foundry版

Azure AI FoundryでGPT-4.1-miniを利用する場合も基本は一緒です。

/モデル名までを入れてModel IDは空欄です。

  • API Provider: OpenAI Compatible
  • BASE URL: https://hogehoge-resource.cognitiveservices.azure.com/openai/deployments/gpt-4.1-mini
  • APIキー: そのままAPIキーをコピペ
  • Model ID: 空欄
  • Set Azure API Version: 2024-12-01-preview など

まとめ

ベースURLが/モデル名までを入れることでModel指定をするという特殊なやり方なので注意しましょう。
これどこにも書いてない気がする...... でも一回分かれば問題ないですね。

CleanShot 2025-07-19 at 19.06.16.png

Let's バイブコーディング

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?