日本語版
最新ニュース
世界

Azure API Management を利用して API トラフィックを複数のバックエンド サービスに分散します

本書は、以下の日本語で出版されたオリジナル記事の要約版です。 現時点でのメモです 2024 年 1 月 27 日。 Azure API Managementのバックエンドプール – Logico Inside (logico-jp.io) Azure API Managementのバックエンドでサーキットブレーカーを構成する – Logico Inside (logico-jp.io) 最近、サーキット ブレーカーと負荷分散プール機能が API Management バックエンドに追加されました。 どちらも 2024 年 1 月 27 日の時点でパブリック プレビュー段階にあります。 Azure API Management…

Azure API Management を利用して API トラフィックを複数のバックエンド サービスに分散します

1707551059
2024-01-29 03:55:31

負荷分散されたプール

制限

サーキットブレーカー

制限

詳細については、ドキュメント内の「注意」を参照してください。

Azure API Management バックエンド | Microsoft Learn

構成

準備

サーキットブレーカー

{
  "type": "Microsoft.ApiManagement/service/backends",
  "apiVersion": "2023-05-01-preview",
  "name": "test1",
  "properties": {
    "description": "backend (test1)",
    "type": "Single",
    "protocol": "http",
    "url": "/api/test",
    "circuitBreaker": {
      "rules": [
        {
          "failureCondition": {
            "count": "3",
            "errorReasons": [
              "Server errors"
            ],
            "interval": "PT5M",
            "statusCodeRanges": [
              {
                "min": "500",
                "max": "599"
              }
            ]
          },
          "name": "myBreakerRule",
          "tripDuration": "PT10M"
        }
      ]
    }
  }
}

負荷分散されたプール

{
    "type": "Microsoft.ApiManagement/service/backends",
    "apiVersion": "2023-05-01-preview",
    "name": "backendPool",
    "properties": {
        "description": "Load balanced backends",
        "type": "Pool",
        "protocol": "http",
        "url": "http://localhost",
        "pool": {
            "services": [
                {
                    "id": "/backends/test1"
                },
                {
                    "id": "/backends/test2"
                }
            ]
        }
    }
}

試してみよう。

Logico_jp_0-1706500394476.png

これらの機能を活用してみてはいかがでしょうか retry ポリシー?




    
        
        
        
        
        
        
            @("Bearer " + (string)context.Variables["msi-access-token"])
        
    
    
        
            
            
        
    
    
        
    
    
        
    

Logico_jp_0-1706498833372.png

結論

#Azure #API #Management #を利用して #API #トラフィックを複数のバックエンド #サービスに分散します

執筆者について: nipponese

Nipponese News編集部は、国内外のニュースを日本語で分かりやすくお届けします。