Microsoft.Network frontDoors

Bicep 資源定義

frontDoors 資源類型可以部署到:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Network/frontDoors 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Network/frontDoors@2021-06-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    backendPools: [
      {
        id: 'string'
        name: 'string'
        properties: {
          backends: [
            {
              address: 'string'
              backendHostHeader: 'string'
              enabledState: 'string'
              httpPort: int
              httpsPort: int
              priority: int
              privateLinkAlias: 'string'
              privateLinkApprovalMessage: 'string'
              privateLinkLocation: 'string'
              privateLinkResourceId: 'string'
              weight: int
            }
          ]
          healthProbeSettings: {
            id: 'string'
          }
          loadBalancingSettings: {
            id: 'string'
          }
        }
      }
    ]
    backendPoolsSettings: {
      enforceCertificateNameCheck: 'string'
      sendRecvTimeoutSeconds: int
    }
    enabledState: 'string'
    friendlyName: 'string'
    frontendEndpoints: [
      {
        id: 'string'
        name: 'string'
        properties: {
          hostName: 'string'
          sessionAffinityEnabledState: 'string'
          sessionAffinityTtlSeconds: int
          webApplicationFirewallPolicyLink: {
            id: 'string'
          }
        }
      }
    ]
    healthProbeSettings: [
      {
        id: 'string'
        name: 'string'
        properties: {
          enabledState: 'string'
          healthProbeMethod: 'string'
          intervalInSeconds: int
          path: 'string'
          protocol: 'string'
        }
      }
    ]
    loadBalancingSettings: [
      {
        id: 'string'
        name: 'string'
        properties: {
          additionalLatencyMilliseconds: int
          sampleSize: int
          successfulSamplesRequired: int
        }
      }
    ]
    routingRules: [
      {
        id: 'string'
        name: 'string'
        properties: {
          acceptedProtocols: [
            'string'
          ]
          enabledState: 'string'
          frontendEndpoints: [
            {
              id: 'string'
            }
          ]
          patternsToMatch: [
            'string'
          ]
          routeConfiguration: {
            '@odata.type': 'string'
            // For remaining properties, see RouteConfiguration objects
          }
          rulesEngine: {
            id: 'string'
          }
          webApplicationFirewallPolicyLink: {
            id: 'string'
          }
        }
      }
    ]
  }
}

RouteConfiguration 物件

設定 @odata.type 屬性以指定物件的類型。

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,請使用:

  '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration'
  backendPool: {
    id: 'string'
  }
  cacheConfiguration: {
    cacheDuration: 'string'
    dynamicCompression: 'string'
    queryParameters: 'string'
    queryParameterStripDirective: 'string'
  }
  customForwardingPath: 'string'
  forwardingProtocol: 'string'

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,請使用:

  '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration'
  customFragment: 'string'
  customHost: 'string'
  customPath: 'string'
  customQueryString: 'string'
  redirectProtocol: 'string'
  redirectType: 'string'

屬性值

frontDoors

名稱 描述
NAME 資源名稱 需要字串 ()

字元限制:5-64

合法字元:
英數字元和連字號。

以英數字元開頭及結尾。

資源名稱在整個 Azure 中必須是唯一的。
location 資源位置。 字串
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標籤
properties Front Door Load Balancer 的屬性 FrontDoorProperties

FrontDoorProperties

名稱 描述
backendPools 可用於路由規則的後端集區。 BackendPool[]
backendPoolsSettings 所有 backendPools 的設定 BackendPoolsSettings
enabledState Front Door 負載平衡器的操作狀態。 允許的值為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
friendlyName frontDoor 的易記名稱 字串
frontendEndpoints 路由規則可用的前端端點。 FrontendEndpoint[]
healthProbeSettings 與此 Front Door 執行個體建立關聯的健康狀態探查設定。 HealthProbeSettingsModel[]
loadBalancingSettings 與此 Front Door 執行個體建立關聯的負載平衡設定。 LoadBalancingSettingsModel[]
routingRules 與此 Front Door 相關聯的路由規則。 RoutingRule[]

BackendPool

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 後端集區的屬性 BackendPoolProperties

BackendPoolProperties

名稱 描述
後端 此集區的後端集合 Backend[]
healthProbeSettings 後端集區的 L7 健康情況探查設定 SubResource
loadBalancingSettings 後端集區的負載平衡設定 SubResource

後端

名稱 描述
address 後端的位置 (IP 位址或 FQDN) 字串
backendHostHeader 用來作為傳送至後端之主機標頭的值。 如果空白或未指定,這會預設為傳入主機。 字串
enabledState 是否要啟用這個後端。 允許的值為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
httpPort HTTP TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
httpsPort HTTPS TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
priority 用於負載平衡的優先順序。 如果優先順序較低的後端狀況良好,則不會使用較高優先順序的後端進行負載平衡。 int
privateLinkAlias Private Link 資源的別名。 填入此選擇性欄位表示此後端為「私人」 字串
privateLinkApprovalMessage 要包含在核准要求中以連線到 Private Link的自定義訊息 字串
privateLinkLocation Private Link 資源的位置。 只有在填入 『privateLinkResourceId』 時才需要 字串
privateLinkResourceId Private Link 資源的資源標識碼。 填入此選擇性欄位表示此後端為「私人」 字串
重量 這個端點的加權,適用於負載平衡用途。 int

SubResource

名稱 描述
id 資源識別碼。 字串

BackendPoolsSettings

名稱 描述
enforceCertificateNameCheck 是否要在所有後端集區的 HTTPS 要求上強制執行憑證名稱檢查。 不會影響非 HTTPS 要求。 'Disabled'
'Enabled'
sendRecvTimeoutSeconds 傳送和接收將要求轉送至後端的逾時。 達到逾時時,要求會失敗並傳回。 int

FrontendEndpoint

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 前端端點的屬性 FrontendEndpointProperties

FrontendEndpointProperties

名稱 描述
hostName frontendEndpoint 的主機名稱。 必須是網域名稱。 字串
sessionAffinityEnabledState 是否允許此主機上的工作階段親和性。 有效選項為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
sessionAffinityTtlSeconds 閑置。 此欄位將被忽略。 如果適用的話,則為可在幾秒鐘之後用於工作階段親和性的 TTL。 int
webApplicationFirewallPolicyLink 如果適用) ,請定義每個主機 (Web 應用程式防火牆 原則 FrontendEndpointUpdateParametersWebApplicationFirewa...

FrontendEndpointUpdateParametersWebApplicationFirewa...

名稱 描述
id 資源識別碼。 字串

HealthProbeSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 健康情況探查設定的屬性 HealthProbeSettingsProperties

HealthProbeSettingsProperties

名稱 描述
enabledState 是否要針對 backendPools 下定義的後端啟用健康情況探查。 只有在單一已啟用後端集區中有單一啟用後端時,才能停用健康情況探查。 'Disabled'
'Enabled'
healthProbeMethod 設定要用來探查 backendPools 下定義的後端的 HTTP 方法。 'GET'
'HEAD'
intervalInSeconds 健康狀態探查的間隔秒數。 int
path 要用於健康狀態探查的路徑。 預設為 / 字串
protocol 用於此探查的通訊協定配置 'Http'
'Https'

LoadBalancingSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 負載平衡設定的屬性 LoadBalancingSettingsProperties

LoadBalancingSettingsProperties

名稱 描述
additionalLatencyMilliseconds 探查的額外延遲以毫秒為單位,落在最低的延遲值區 int
sampleSize 要考慮進行負載平衡決策的範例數目 int
successfulSamplesRequired 範例期間內必須成功的樣本數目 int

RoutingRule

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 路由規則的屬性 RoutingRuleProperties

RoutingRuleProperties

名稱 描述
acceptedProtocols 要符合此規則的通訊協定配置 包含任何項目的字串數組:
'Http'
'Https'
enabledState 是否要啟用此規則。 允許的值為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
frontendEndpoints 與此規則相關聯的前端端點 SubResource[]
patternsToMatch 規則的路由模式。 string[]
routeConfiguration 路由組態的參考。 RouteConfiguration
rulesEngine 要套用至此路由的特定規則引擎組態參考。 SubResource
webApplicationFirewallPolicyLink 如果適用) ,請定義每個路由規則 (Web 應用程式防火牆 原則 RoutingRuleUpdateParametersWebApplicationFirewallPol...

RouteConfiguration

名稱 描述
@odata.type 設定物件類型 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration
#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration ()

ForwardingConfiguration

名稱 描述
@odata.type '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' (必要)
backendPool 此規則路由至的 BackendPool 參考。 SubResource
cacheConfiguration 與此規則相關聯的快取組態。 CacheConfiguration
customForwardingPath 用來重寫此規則所比對之資源路徑的自定義路徑。 保留空白將使用傳入路徑。 字串
forwardingProtocol 將流量轉送至後端時,將會使用此規則的通訊協定。 'HttpOnly'
'HttpsOnly'
'MatchRequest'

CacheConfiguration

名稱 描述
cacheDuration 需要快取內容的持續時間。 允許的格式為 ISO 8601 格式, (http://en.wikipedia.org/wiki/ISO_8601#Durations) 。 HTTP 要求值不超過一年 字串
dynamicCompression 是否要針對快取的內容使用動態壓縮 'Disabled'
'Enabled'
queryParameters 要包含或排除 (逗號分隔) 的查詢參數。 字串
queryParameterStripDirective 形成快取索引鍵時,URL 查詢詞彙的處理方式。 'StripAll'
'StripAllExcept'
'StripNone'
'StripOnly'

RedirectConfiguration

名稱 描述
@odata.type '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration' ()
customFragment 要新增至重新導向 URL 的片段。 片段是 #之后 URL 的一部分。 請勿包含 #。 字串
customHost 要重新導向的主機。 保留空白,以使用傳入主機作為目的地主機。 字串
customPath 要重新導向的完整路徑。 路徑不能是空的,而且必須以 /開頭。 保留空白,以使用傳入路徑作為目的地路徑。 字串
customQueryString 要放在重新導向 URL 中的查詢字串集合。 設定此值會取代任何現有的查詢字串;保留空白以保留傳入查詢字串。 查詢字串必須是 {key}={value} 格式。 第一個 ? 和 & 會自動新增,因此請勿將它們包含在前端中,但會使用 & 分隔多個查詢字串。 字串
redirectProtocol 將流量重新導向目的地的通訊協定 'HttpOnly'
'HttpsOnly'
'MatchRequest'
redirectType 重新導向流量時,規則將使用的重新導向類型。 'Found'
'Moved'
'PermanentRedirect'
'TemporaryRedirect'

RoutingRuleUpdateParametersWebApplicationFirewallPol...

名稱 描述
id 資源識別碼。 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
在 Azure API 管理 前面建立 Azure Front Door

部署至 Azure
此範例示範如何使用 Azure Front Door 作為 Azure API 管理 前面的全域負載平衡器。
建立基本 Front Door

部署至 Azure
此範本會建立具有單一後端的基本 Front Door 設定。
建立已針對特定路由啟用快取功能的 Front Door

部署至 Azure
此範本會針對定義的路由組態建立已啟用快取功能的 Front Door,因此會快取工作負載的任何靜態資產。
建立具有多個後端和後端集區的 Front Door

部署至 Azure
此範本會建立 Front Door,並針對後端集區中的多個後端設定負載平衡,以及根據 URL 路徑跨後端集區。
建立具有 HTTP 至 HTTPS 重新導向的 Front Door

部署至 Azure
此範本會建立 HTTP 至 HTTPS 重新導向的 Front Door 設定。
使用 Front Door 新增自定義網域和受控憑證

部署至 Azure
此範本會使用 Front Door 上線並保護自訂網域
使用 Front Door 新增自定義網域和自定義憑證

部署至 Azure
此範本會使用客戶管理的憑證將 Front Door 上線並保護自定義網域
在 Front Door 上控制後端的健康狀態探查

部署至 Azure
此範本會藉由設定探查路徑以及將傳送探查的間隔,來更新 Front Door 以變更健康情況探查設定。
使用 Active-Standby 設定建立 Front Door

部署至 Azure
此範本會建立 Front Door,示範 Active-Standby 應用程式拓撲的優先順序型路由。
為 Front Door 主機名稱設定工作階段親和性

部署至 Azure
此範本會更新 Front Door,以啟用前端主機的會話親和性,藉此將來自相同用戶會話的後續流量傳送至相同的後端。

ARM 範本資源定義

frontDoors 資源類型可以部署到:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.Network/frontDoors 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.Network/frontDoors",
  "apiVersion": "2021-06-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "backendPools": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "backends": [
            {
              "address": "string",
              "backendHostHeader": "string",
              "enabledState": "string",
              "httpPort": "int",
              "httpsPort": "int",
              "priority": "int",
              "privateLinkAlias": "string",
              "privateLinkApprovalMessage": "string",
              "privateLinkLocation": "string",
              "privateLinkResourceId": "string",
              "weight": "int"
            }
          ],
          "healthProbeSettings": {
            "id": "string"
          },
          "loadBalancingSettings": {
            "id": "string"
          }
        }
      }
    ],
    "backendPoolsSettings": {
      "enforceCertificateNameCheck": "string",
      "sendRecvTimeoutSeconds": "int"
    },
    "enabledState": "string",
    "friendlyName": "string",
    "frontendEndpoints": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "hostName": "string",
          "sessionAffinityEnabledState": "string",
          "sessionAffinityTtlSeconds": "int",
          "webApplicationFirewallPolicyLink": {
            "id": "string"
          }
        }
      }
    ],
    "healthProbeSettings": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "enabledState": "string",
          "healthProbeMethod": "string",
          "intervalInSeconds": "int",
          "path": "string",
          "protocol": "string"
        }
      }
    ],
    "loadBalancingSettings": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "additionalLatencyMilliseconds": "int",
          "sampleSize": "int",
          "successfulSamplesRequired": "int"
        }
      }
    ],
    "routingRules": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "acceptedProtocols": [ "string" ],
          "enabledState": "string",
          "frontendEndpoints": [
            {
              "id": "string"
            }
          ],
          "patternsToMatch": [ "string" ],
          "routeConfiguration": {
            "@odata.type": "string"
            // For remaining properties, see RouteConfiguration objects
          },
          "rulesEngine": {
            "id": "string"
          },
          "webApplicationFirewallPolicyLink": {
            "id": "string"
          }
        }
      }
    ]
  }
}

RouteConfiguration 物件

設定 @odata.type 屬性以指定 物件的類型。

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,請使用:

  "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration",
  "backendPool": {
    "id": "string"
  },
  "cacheConfiguration": {
    "cacheDuration": "string",
    "dynamicCompression": "string",
    "queryParameters": "string",
    "queryParameterStripDirective": "string"
  },
  "customForwardingPath": "string",
  "forwardingProtocol": "string"

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,請使用:

  "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration",
  "customFragment": "string",
  "customHost": "string",
  "customPath": "string",
  "customQueryString": "string",
  "redirectProtocol": "string",
  "redirectType": "string"

屬性值

frontDoors

名稱 描述
類型 資源類型 'Microsoft.Network/frontDoors'
apiVersion 資源 API 版本 '2021-06-01'
NAME 資源名稱 字串 (必要)

字元限制:5-64

合法字元:
英數字元和連字號。

以英數字元開頭及結尾。

資源名稱在 Azure 中必須是唯一的。
location 資源位置。 字串
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標記
properties Front Door Load Balancer 的屬性 FrontDoorProperties

FrontDoorProperties

名稱 描述
backendPools 可用於路由規則的後端集區。 BackendPool[]
backendPoolsSettings 所有 backendPools 的設定 BackendPoolsSettings
enabledState Front Door 負載平衡器的操作狀態。 允許的值是 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
friendlyName frontDoor 的易記名稱 字串
frontendEndpoints 可用於路由規則的前端端點。 FrontendEndpoint[]
healthProbeSettings 與此 Front Door 執行個體建立關聯的健康狀態探查設定。 HealthProbeSettingsModel[]
loadBalancingSettings 與此 Front Door 執行個體建立關聯的負載平衡設定。 LoadBalancingSettingsModel[]
routingRules 與此 Front Door 相關聯的路由規則。 RoutingRule[]

BackendPool

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 後端集區的屬性 BackendPoolProperties

BackendPoolProperties

名稱 描述
後端 此集區的後端集合 Backend[]
healthProbeSettings 後端集區的 L7 健康情況探查設定 SubResource
loadBalancingSettings 後端集區的負載平衡設定 SubResource

後端

名稱 描述
address 後端的位置 (IP 位址或 FQDN) 字串
backendHostHeader 用來作為傳送至後端之主機標頭的值。 如果空白或未指定,這會預設為傳入主機。 字串
enabledState 是否要啟用這個後端。 允許的值為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
httpPort HTTP TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
httpsPort HTTPS TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
priority 用於負載平衡的優先順序。 如果優先順序較低的後端狀況良好,則不會使用較高優先順序的後端進行負載平衡。 int
privateLinkAlias Private Link 資源的別名。 填入此選擇性欄位表示此後端為「私人」 字串
privateLinkApprovalMessage 要包含在核准要求中的自定義訊息,以連線至 Private Link 字串
privateLinkLocation Private Link 資源的位置。 只有在填入 『privateLinkResourceId』 時才需要 字串
privateLinkResourceId Private Link 資源的資源標識碼。 填入此選擇性欄位表示此後端為「私人」 字串
重量 這個端點的加權,適用於負載平衡用途。 int

SubResource

名稱 描述
id 資源識別碼。 字串

BackendPoolsSettings

名稱 描述
enforceCertificateNameCheck 是否要在所有後端集區的 HTTPS 要求上強制執行憑證名稱檢查。 不會影響非 HTTPS 要求。 'Disabled'
'Enabled'
sendRecvTimeoutSeconds 傳送和接收將要求轉送至後端的逾時。 達到逾時時,要求會失敗並傳回。 int

FrontendEndpoint

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 前端端點的屬性 FrontendEndpointProperties

FrontendEndpointProperties

名稱 描述
hostName frontendEndpoint 的主機名稱。 必須是網域名稱。 字串
sessionAffinityEnabledState 是否允許此主機上的工作階段親和性。 有效選項為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
sessionAffinityTtlSeconds 閑置。 此欄位將被忽略。 如果適用的話,則為可在幾秒鐘之後用於工作階段親和性的 TTL。 int
webApplicationFirewallPolicyLink 如果適用) ,請定義每個主機 (Web 應用程式防火牆 原則 FrontendEndpointUpdateParametersWebApplicationFirewa...

FrontendEndpointUpdateParametersWebApplicationFirewa...

名稱 描述
id 資源識別碼。 字串

HealthProbeSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 健康情況探查設定的屬性 HealthProbeSettingsProperties

HealthProbeSettingsProperties

名稱 描述
enabledState 是否要針對 backendPools 下定義的後端啟用健康情況探查。 只有在單一已啟用後端集區中有單一啟用後端時,才能停用健康情況探查。 'Disabled'
'Enabled'
healthProbeMethod 設定要用來探查 backendPools 下定義的後端的 HTTP 方法。 'GET'
'HEAD'
intervalInSeconds 健康狀態探查的間隔秒數。 int
path 要用於健康狀態探查的路徑。 預設為 / 字串
protocol 用於此探查的通訊協定配置 'Http'
'Https'

LoadBalancingSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 負載平衡設定的屬性 LoadBalancingSettingsProperties

LoadBalancingSettingsProperties

名稱 描述
additionalLatencyMilliseconds 探查的額外延遲以毫秒為單位,落在最低的延遲值區 int
sampleSize 要考慮進行負載平衡決策的範例數目 int
successfulSamplesRequired 範例期間內必須成功的樣本數目 int

RoutingRule

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 路由規則的屬性 RoutingRuleProperties

RoutingRuleProperties

名稱 描述
acceptedProtocols 要符合此規則的通訊協定配置 包含任何項目的字串數組:
'Http'
'Https'
enabledState 是否要啟用此規則。 允許的值為 'Enabled' 或 'Disabled' 'Disabled'
'Enabled'
frontendEndpoints 與此規則相關聯的前端端點 SubResource[]
patternsToMatch 規則的路由模式。 string[]
routeConfiguration 路由組態的參考。 RouteConfiguration
rulesEngine 要套用至此路由的特定規則引擎組態參考。 SubResource
webApplicationFirewallPolicyLink 如果適用) ,請定義每個路由規則 (Web 應用程式防火牆 原則 RoutingRuleUpdateParametersWebApplicationFirewallPol...

RouteConfiguration

名稱 描述
@odata.type 設定物件類型 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration
#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration ()

ForwardingConfiguration

名稱 描述
@odata.type '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' (必要)
backendPool 此規則路由至的 BackendPool 參考。 SubResource
cacheConfiguration 與此規則相關聯的快取組態。 CacheConfiguration
customForwardingPath 用來重寫此規則所比對之資源路徑的自定義路徑。 保留空白將使用傳入路徑。 字串
forwardingProtocol 將流量轉送至後端時,將會使用此規則的通訊協定。 'HttpOnly'
'HttpsOnly'
'MatchRequest'

CacheConfiguration

名稱 描述
cacheDuration 需要快取內容的持續時間。 允許的格式為 ISO 8601 格式, (http://en.wikipedia.org/wiki/ISO_8601#Durations) 。 HTTP 要求值不超過一年 字串
dynamicCompression 是否要針對快取的內容使用動態壓縮 'Disabled'
'Enabled'
queryParameters 要包含或排除 (逗號分隔) 的查詢參數。 字串
queryParameterStripDirective 形成快取索引鍵時,URL 查詢詞彙的處理方式。 'StripAll'
'StripAllExcept'
'StripNone'
'StripOnly'

RedirectConfiguration

名稱 描述
@odata.type '#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration' ()
customFragment 要新增至重新導向 URL 的片段。 片段是 #之后 URL 的一部分。 請勿包含 #。 字串
customHost 要重新導向的主機。 保留空白,以使用傳入主機作為目的地主機。 字串
customPath 要重新導向的完整路徑。 路徑不能是空的,而且必須以 /開頭。 保留空白,以使用傳入路徑作為目的地路徑。 字串
customQueryString 要放在重新導向 URL 中的查詢字串集合。 設定此值會取代任何現有的查詢字串;保留空白以保留傳入查詢字串。 查詢字串必須是 {key}={value} 格式。 第一個 ? 和 & 會自動新增,因此請勿將它們包含在前端中,但會使用 & 分隔多個查詢字串。 字串
redirectProtocol 將流量重新導向目的地的通訊協定 'HttpOnly'
'HttpsOnly'
'MatchRequest'
redirectType 重新導向流量時,規則將使用的重新導向類型。 'Found'
'Moved'
'PermanentRedirect'
'TemporaryRedirect'

RoutingRuleUpdateParametersWebApplicationFirewallPol...

名稱 描述
id 資源識別碼。 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
在 Azure API 管理 前面建立 Azure Front Door

部署至 Azure
此範例示範如何使用 Azure Front Door 作為 Azure API 管理 前面的全域負載平衡器。
建立基本 Front Door

部署至 Azure
此範本會建立具有單一後端的基本 Front Door 設定。
建立已針對特定路由啟用快取功能的 Front Door

部署至 Azure
此範本會針對已定義的路由設定建立已啟用快取功能的 Front Door,因此會快取工作負載的任何靜態資產。
建立具有多個後端和後端集區的 Front Door

部署至 Azure
此範本會建立 Front Door,並針對後端集區中的多個後端設定負載平衡,以及根據 URL 路徑跨後端集區。
建立具有 HTTP 至 HTTPS 重新導向的 Front Door

部署至 Azure
此範本會建立適用於 HTTP 至 HTTPS 重新導向的 Front Door 設定。
使用 Front Door 新增自定義網域和受控憑證

部署至 Azure
此範本會使用 Front Door 將自訂網域上線並保護
使用 Front Door 新增自定義網域和自定義憑證

部署至 Azure
此範本會使用客戶管理的憑證將 Front Door 上線並保護自定義網域
在 Front Door 上控制後端的健康狀態探查

部署至 Azure
此範本會藉由設定探查路徑以及將傳送探查的間隔,來更新 Front Door 以變更健康情況探查設定。
使用 Active-Standby 組態建立 Front Door

部署至 Azure
此範本會建立 Front Door,示範 Active-Standby 應用程式拓撲的優先順序型路由。
為 Front Door 主機名稱設定工作階段親和性

部署至 Azure
此範本會更新 Front Door,以啟用前端主機的會話親和性,藉此將來自相同用戶會話的後續流量傳送至相同的後端。

Terraform (AzAPI 提供者) 資源定義

frontDoors 資源類型可以部署到:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Network/frontDoors 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/frontDoors@2021-06-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      backendPools = [
        {
          id = "string"
          name = "string"
          properties = {
            backends = [
              {
                address = "string"
                backendHostHeader = "string"
                enabledState = "string"
                httpPort = int
                httpsPort = int
                priority = int
                privateLinkAlias = "string"
                privateLinkApprovalMessage = "string"
                privateLinkLocation = "string"
                privateLinkResourceId = "string"
                weight = int
              }
            ]
            healthProbeSettings = {
              id = "string"
            }
            loadBalancingSettings = {
              id = "string"
            }
          }
        }
      ]
      backendPoolsSettings = {
        enforceCertificateNameCheck = "string"
        sendRecvTimeoutSeconds = int
      }
      enabledState = "string"
      friendlyName = "string"
      frontendEndpoints = [
        {
          id = "string"
          name = "string"
          properties = {
            hostName = "string"
            sessionAffinityEnabledState = "string"
            sessionAffinityTtlSeconds = int
            webApplicationFirewallPolicyLink = {
              id = "string"
            }
          }
        }
      ]
      healthProbeSettings = [
        {
          id = "string"
          name = "string"
          properties = {
            enabledState = "string"
            healthProbeMethod = "string"
            intervalInSeconds = int
            path = "string"
            protocol = "string"
          }
        }
      ]
      loadBalancingSettings = [
        {
          id = "string"
          name = "string"
          properties = {
            additionalLatencyMilliseconds = int
            sampleSize = int
            successfulSamplesRequired = int
          }
        }
      ]
      routingRules = [
        {
          id = "string"
          name = "string"
          properties = {
            acceptedProtocols = [
              "string"
            ]
            enabledState = "string"
            frontendEndpoints = [
              {
                id = "string"
              }
            ]
            patternsToMatch = [
              "string"
            ]
            routeConfiguration = {
              @odata.type = "string"
              // For remaining properties, see RouteConfiguration objects
            }
            rulesEngine = {
              id = "string"
            }
            webApplicationFirewallPolicyLink = {
              id = "string"
            }
          }
        }
      ]
    }
  })
}

RouteConfiguration 物件

設定 @odata.type 屬性以指定物件的類型。

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration,請使用:

  @odata.type = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration"
  backendPool = {
    id = "string"
  }
  cacheConfiguration = {
    cacheDuration = "string"
    dynamicCompression = "string"
    queryParameters = "string"
    queryParameterStripDirective = "string"
  }
  customForwardingPath = "string"
  forwardingProtocol = "string"

針對 #Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration,請使用:

  @odata.type = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration"
  customFragment = "string"
  customHost = "string"
  customPath = "string"
  customQueryString = "string"
  redirectProtocol = "string"
  redirectType = "string"

屬性值

frontDoors

名稱 描述
類型 資源類型 “Microsoft.Network/frontDoors@2021-06-01”
NAME 資源名稱 需要字串 ()

字元限制:5-64

合法字元:
英數字元和連字號。

以英數字元開頭及結尾。

資源名稱在整個 Azure 中必須是唯一的。
location 資源位置。 字串
parent_id 若要部署至資源群組,請使用該資源群組的標識碼。 需要字串 ()
tags 資源標籤。 標記名稱和值的字典。
properties Front Door Load Balancer 的屬性 FrontDoorProperties

FrontDoorProperties

名稱 描述
backendPools 可用於路由規則的後端集區。 BackendPool[]
backendPoolsSettings 所有 backendPools 的設定 BackendPoolsSettings
enabledState Front Door 負載平衡器的操作狀態。 允許的值為 'Enabled' 或 'Disabled' “Disabled”
“Enabled”
friendlyName frontDoor 的易記名稱 字串
frontendEndpoints 路由規則可用的前端端點。 FrontendEndpoint[]
healthProbeSettings 與此 Front Door 執行個體建立關聯的健康狀態探查設定。 HealthProbeSettingsModel[]
loadBalancingSettings 與此 Front Door 執行個體建立關聯的負載平衡設定。 LoadBalancingSettingsModel[]
routingRules 與此 Front Door 相關聯的路由規則。 RoutingRule[]

BackendPool

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 後端集區的屬性 BackendPoolProperties

BackendPoolProperties

名稱 描述
後端 此集區的後端集合 Backend[]
healthProbeSettings 後端集區的 L7 健康情況探查設定 SubResource
loadBalancingSettings 後端集區的負載平衡設定 SubResource

後端

名稱 描述
address 後端的位置 (IP 位址或 FQDN) 字串
backendHostHeader 用來作為傳送至後端之主機標頭的值。 如果空白或未指定,這會預設為傳入主機。 字串
enabledState 是否要啟用這個後端。 允許的值為 'Enabled' 或 'Disabled' “Disabled”
“Enabled”
httpPort HTTP TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
httpsPort HTTPS TCP 連接埠號碼。 必須介於 1 到 65535 之間。 int
priority 用於負載平衡的優先順序。 如果優先順序較低的後端狀況良好,則不會使用較高優先順序的後端進行負載平衡。 int
privateLinkAlias Private Link 資源的別名。 填入此選擇性欄位表示此後端為「私人」 字串
privateLinkApprovalMessage 要包含在核准要求中的自定義訊息,以連線至 Private Link 字串
privateLinkLocation Private Link 資源的位置。 只有在填入 『privateLinkResourceId』 時才需要 字串
privateLinkResourceId Private Link 資源的資源標識碼。 填入此選擇性欄位表示此後端為「私人」 字串
重量 這個端點的加權,適用於負載平衡用途。 int

SubResource

名稱 描述
id 資源識別碼。 字串

BackendPoolsSettings

名稱 描述
enforceCertificateNameCheck 是否要在所有後端集區的 HTTPS 要求上強制執行憑證名稱檢查。 不會影響非 HTTPS 要求。 “Disabled”
“Enabled”
sendRecvTimeoutSeconds 傳送和接收將要求轉送至後端的逾時。 達到逾時時,要求會失敗並傳回。 int

FrontendEndpoint

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 前端端點的屬性 FrontendEndpointProperties

FrontendEndpointProperties

名稱 描述
hostName frontendEndpoint 的主機名稱。 必須是網域名稱。 字串
sessionAffinityEnabledState 是否允許此主機上的工作階段親和性。 有效選項為 'Enabled' 或 'Disabled' “Disabled”
“Enabled”
sessionAffinityTtlSeconds 閑置。 此欄位將被忽略。 如果適用的話,則為可在幾秒鐘之後用於工作階段親和性的 TTL。 int
webApplicationFirewallPolicyLink 如果適用) ,請定義每個主機 (Web 應用程式防火牆 原則 FrontendEndpointUpdateParametersWebApplicationFirewa...

FrontendEndpointUpdateParametersWebApplicationFirewa...

名稱 描述
id 資源識別碼。 字串

HealthProbeSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 健康情況探查設定的屬性 HealthProbeSettingsProperties

HealthProbeSettingsProperties

名稱 描述
enabledState 是否要針對 backendPools 下定義的後端啟用健康情況探查。 只有在單一已啟用後端集區中有單一啟用後端時,才能停用健康情況探查。 “Disabled”
“Enabled”
healthProbeMethod 設定要用來探查 backendPools 下定義的後端的 HTTP 方法。 “GET”
“HEAD”
intervalInSeconds 健康狀態探查的間隔秒數。 int
path 要用於健康狀態探查的路徑。 預設為 / 字串
protocol 用於此探查的通訊協定配置 “Http”
“Https”

LoadBalancingSettingsModel

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties 負載平衡設定的屬性 LoadBalancingSettingsProperties

LoadBalancingSettingsProperties

名稱 描述
additionalLatencyMilliseconds 探查的額外延遲以毫秒為單位,落在最低的延遲值區 int
sampleSize 要考慮進行負載平衡決策的範例數目 int
successfulSamplesRequired 範例期間內必須成功的樣本數目 int

RoutingRule

名稱 描述
id 資源識別碼。 字串
NAME 資源名稱。 字串
properties Front Door 路由規則的屬性 RoutingRuleProperties

RoutingRuleProperties

名稱 描述
acceptedProtocols 要符合此規則的通訊協定配置 包含任何項目的字串數組:
“Http”
“Https”
enabledState 是否要啟用此規則。 允許的值為 'Enabled' 或 'Disabled' “Disabled”
“Enabled”
frontendEndpoints 與此規則相關聯的前端端點 SubResource[]
patternsToMatch 規則的路由模式。 string[]
routeConfiguration 路由組態的參考。 RouteConfiguration
rulesEngine 要套用至此路由的特定規則引擎組態參考。 SubResource
webApplicationFirewallPolicyLink 如果適用) ,請定義每個路由規則 (Web 應用程式防火牆 原則 RoutingRuleUpdateParametersWebApplicationFirewallPol...

RouteConfiguration

名稱 描述
@odata.type 設定物件類型 #Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration
#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration ()

ForwardingConfiguration

名稱 描述
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration” (必要)
backendPool 此規則路由至的 BackendPool 參考。 SubResource
cacheConfiguration 與此規則相關聯的快取組態。 CacheConfiguration
customForwardingPath 用來重寫此規則所比對之資源路徑的自定義路徑。 保留空白將使用傳入路徑。 字串
forwardingProtocol 將流量轉送至後端時,此規則將使用的通訊協定。 “HttpOnly”
“HttpsOnly”
“MatchRequest”

CacheConfiguration

名稱 描述
cacheDuration 需要快取內容的持續時間。 允許的格式為 ISO 8601 格式, () http://en.wikipedia.org/wiki/ISO_8601#Durations 。 HTTP 要求值不超過一年 字串
dynamicCompression 是否對快取的內容使用動態壓縮 “Disabled”
“Enabled”
queryParameters 要包含或排除 (逗號分隔) 的查詢參數。 字串
queryParameterStripDirective 形成快取索引鍵時,URL 查詢字詞的處理方式。 “StripAll”
“StripAllExcept”
“StripNone”
“StripOnly”

RedirectConfiguration

名稱 描述
@odata.type “#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration” (必要)
customFragment 要新增至重新導向 URL 的片段。 片段是之後 URL 的一部分。 請勿包含 #。 字串
customHost 要重新導向的主機。 保留空白,以使用傳入主機作為目的地主機。 字串
customPath 要重新導向的完整路徑。 路徑不能是空的,而且必須以 /開頭。 保留空白,以使用傳入路徑作為目的地路徑。 字串
customQueryString 要放在重新導向 URL 中的查詢字串集。 設定此值會取代任何現有的查詢字串;保留空白以保留傳入查詢字串。 查詢字串必須是 {key}={value} 格式。 第一個 ? 和 & 會自動新增,因此請勿將它們包含在前端,但會使用 & 分隔多個查詢字串。 字串
redirectProtocol 將流量重新導向目的地的通訊協定 “HttpOnly”
“HttpsOnly”
“MatchRequest”
redirectType 重新導向流量時,規則將使用的重新導向類型。 “Found”
“已移動”
“PermanentRedirect”
“TemporaryRedirect”

RoutingRuleUpdateParametersWebApplicationFirewallPol...

名稱 描述
id 資源識別碼。 字串