You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Bicep中定义Azure Front Door的源类型?门户配置项未找到

Azure CDN源类型在Bicep中的配置方法

Azure门户里的「源类型」(Storage (blobs)/Storage (static web site))在Bicep中无需单独设置属性,而是通过指定对应源的hostName和originHostHeader来区分:

1. 配置静态网站源

使用静态网站的专属域名(格式:<存储账户名>.<区域>.web.core.windows.net):

resource cdnProfile 'Microsoft.Cdn/profiles@2023-05-01' = {
  name: 'yourCdnProfileName'
  location: 'global'
  sku: {
    name: 'Standard_Microsoft' // 根据需求选择SKU
  }
}

resource cdnEndpoint 'Microsoft.Cdn/profiles/endpoints@2023-05-01' = {
  parent: cdnProfile
  name: 'yourCdnEndpointName'
  location: 'global'
  properties: {
    origins: [
      {
        name: 'staticWebsiteOrigin'
        properties: {
          hostName: 'yourStorageAccount.z6.web.core.windows.net'
          httpPort: 80
          httpsPort: 443
          originHostHeader: 'yourStorageAccount.z6.web.core.windows.net'
        }
      }
    ]
    isHttpAllowed: false
    isHttpsAllowed: true
  }
}

2. 配置Blob存储源

使用Blob存储的默认域名(格式:<存储账户名>.blob.core.windows.net),若需指向特定容器,可添加originPath:

resource cdnProfile 'Microsoft.Cdn/profiles@2023-05-01' = {
  name: 'yourCdnProfileName'
  location: 'global'
  sku: {
    name: 'Standard_Microsoft'
  }
}

resource cdnEndpoint 'Microsoft.Cdn/profiles/endpoints@2023-05-01' = {
  parent: cdnProfile
  name: 'yourCdnEndpointName'
  location: 'global'
  properties: {
    origins: [
      {
        name: 'blobStorageOrigin'
        properties: {
          hostName: 'yourStorageAccount.blob.core.windows.net'
          httpPort: 80
          httpsPort: 443
          originHostHeader: 'yourStorageAccount.blob.core.windows.net'
          originPath: '/yourContainerName' // 可选:指定Blob容器
        }
      }
    ]
    isHttpAllowed: false
    isHttpsAllowed: true
  }
}

说明

门户中的「源类型」是对不同存储域名的封装,Bicep通过直接指定对应域名来实现相同效果,无需额外的类型属性。

内容的提问来源于stack exchange,提问作者Kyberias

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 04:05:33