0
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?

Microsoft Foundry モデルデプロイのPause(一時停止)

0
Posted at

Azure AI Foundry(Microsoft.CognitiveServices/accounts/deployments)には、デプロイ済みモデルの推論を一時停止できる Pause APIが用意されています。本記事では実際に gpt-4.1-mini デプロイメントを Pause した際のリクエスト/レスポンスを紹介します。

以下のデプロイ種類だけが対象なので注意ください

この操作はStandard、DataZoneStandard、GlobalStandard SKUのみがサポートしています

前提

項目
API version 2025-10-01-preview
対応 SKU Standard / DataZoneStandard / GlobalStandard のみ
Pause 中の Inference HTTP 423 Locked が返る
冪等性 Pause / Resume ともに idempotent
必要権限 Microsoft.CognitiveServices/accounts/deployments/pause/action を含むロール(例: Cognitive Services Contributor)
公式リファレンス Deployments - Pause (Azure AI Foundry REST API)

Puase

リクエスト

Endpoint

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause?api-version=2026-01-15-preview 

Headers

Authorization: Bearer <AAD access token>
Content-Type: application/json

アクセストークンの取得スコープは https://management.azure.com/.default です。

Body

(空 / なし)

Azure CLI で呼び出す例

az rest --method post \
--url https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause?api-version=2026-01-15-preview 

レスポンス (HTTP 200 OK)

{
  "id": OYMENT_NAME>",
  "name": "<DEPLOYMENT_NAME>",
  "type": "Microsoft.CognitiveServices/accounts/deployments",
  "etag": "\"********-****-****-****-************\"",
  "sku": {
    "name": "GlobalStandard",
    "capacity": 5000
  },
  "properties": {
    "model": {
      "format": "OpenAI",
      "name": "gpt-4.1-mini",
      "version": "2025-04-14"
    },
    "versionUpgradeOption": "OnceNewDefaultVersionAvailable",
    "raiPolicyName": "Microsoft.DefaultV2",
    "provisioningState": "Succeeded",
    "deploymentState": "Paused",
    "currentCapacity": 5000,
    "capabilities": {
      "agentsV2": "true",
      "area": "EUR",
      "assistants": "true",
      "chatCompletion": "true",
      "responses": "true"
    },
    "rateLimits": [
      { "key": "request", "renewalPeriod": 60, "count": 5000 },
      { "key": "token",   "renewalPeriod": 60, "count": 5000000 }
    ]
  },
  "systemData": {
    "createdAt": "2026-03-30T01:25:10.7238588Z",
    "createdBy": "<USER_PRINCIPAL_NAME>",
    "createdByType": "User",
    "lastModifiedAt": "2026-05-23T01:28:59.2057203Z",
    "lastModifiedBy": "<USER_PRINCIPAL_NAME>",
    "lastModifiedByType": "User"
  }
}

注目ポイントは properties.deploymentState"Paused" になっていること。Pause 前は null(= Running 相当)でした。

Foundry Portalでの確認

Foundry Portal(NewとClassic両方)でデプロイメントを確認しましたが、Pauseしたことは判別できませんでした。

Model Playgroundでは以下のエラー。
New UIは原因がよくわからない。
image.png

Classic UIだと423も出してくれる。
image.png

Resume したい場合

URL 末尾の /pause/resume に変えるだけです。

az rest --method post \
  --url OUNT_NAME>/deployments/<DEPLOYMENT_NAME>/resume?api-version=2025-10-01-preview"

Resume 後は deploymentState"Running" に戻ります。

Pause したモデルデプロイメントを再び稼働状態に戻すには Resume API を呼び出します。URL は Pause API と全く同じ形で、末尾を /pause/resumeに変えるだけです。冪等性があるので、既に Running の状態に対して呼んでもエラーにはなりません。

リクエスト

Endpoint

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume?api-version=2026-01-15-preview

Headers

Authorization: Bearer <AAD access token>
Content-Type: application/json

アクセストークンの取得スコープは https://management.azure.com/.default です。

Body

(空 / なし)

Azure CLI で呼び出す例

az rest --method post \
  --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume?api-version=2026-01-15-previewOUNT_NAME>/deployments/<DEPLOYMENT_NAME>/resume?api-version=2025-10-01-preview"

レスポンス (HTTP 200 OK)

{
  "id": OYMENT_NAME>",
  "name": "<DEPLOYMENT_NAME>",
  "type": "Microsoft.CognitiveServices/accounts/deployments",
  "etag": "\"********-****-****-****-************\"",
  "sku": {
    "name": "GlobalStandard",
    "capacity": 5000
  },
  "properties": {
    "model": {
      "format": "OpenAI",
      "name": "gpt-4.1-mini",
      "version": "2025-04-14"
    },
    "versionUpgradeOption": "OnceNewDefaultVersionAvailable",
    "raiPolicyName": "Microsoft.DefaultV2",
    "provisioningState": "Succeeded",
    "deploymentState": "Running",
    "currentCapacity": 5000,
    "capabilities": {
      "agentsV2": "true",
      "area": "EUR",
      "assistants": "true",
      "chatCompletion": "true",
      "responses": "true"
    },
    "rateLimits": [
      { "key": "request", "renewalPeriod": 60, "count": 5000 },
      { "key": "token",   "renewalPeriod": 60, "count": 5000000 }
    ]
  },
  "systemData": {
    "createdAt": "2026-03-30T01:25:10.7238588Z",
    "createdBy": "<USER_PRINCIPAL_NAME>",
    "createdByType": "User",
    "lastModifiedAt": "2026-05-23T01:48:35.6054785Z",
    "lastModifiedBy": "<USER_PRINCIPAL_NAME>",
    "lastModifiedByType": "User"
  }
}

確認ポイント

  • properties.deploymentState"Paused""Running" に変化
  • provisioningState"Succeeded" のまま(リソース構成自体は変わらない)
  • etagsystemData.lastModifiedAt / lastModifiedBy が更新される
  • sku / capacity / rateLimits は Pause/Resume の影響を受けない(= 復帰後すぐ元のスループットで利用可能)

Resume 後は通常通り Inference エンドポイントへのリクエストが 200 で返るようになります。Pause 中に返っていた HTTP 423 Locked は解消されます。

Pause / Resume 早見表

操作 URL 末尾 遷移する deploymentState
Pause /pause RunningPaused
Resume /resume PausedRunning

両方とも冪等なので、運用スクリプトで「とりあえず Pause」「とりあえず Resume」と呼んでも安全です。

まとめ

  • Pause/Resume は 2025-10-01-preview API で提供
  • 対応 SKU は Standard 系 3 種のみ
  • 一時的にコスト/誤用を止めたい場面(夜間・検証完了後など)で有効
  • Portal の「モデル + エンドポイント」一覧でも State 列で状態を確認可能
0
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
0
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?