bicep azure前门部署假设分析不显示自定义域更改

rt4zxlrg  于 2023-02-05  发布在  其他
关注(0)|答案(1)|浏览(109)

如果我添加一个新的自定义域到azure cdn配置文件(azure front door premium),然后运行--what-if我没有看到front door有任何变化。
如何获取假设分析,以给予部署将进行的所有更改?我添加了此新的自定义域

resource customDomainNew 'Microsoft.Cdn/profiles/customdomains@2022-05-01-preview' = if (customDomainDeploy) {
  parent: frontdoorProfile
  name: 'new-${baseDomainName}'
  properties: {
    hostName: 'new.${baseDomain}'
    tlsSettings: {
      certificateType: 'ManagedCertificate'
      minimumTlsVersion: 'TLS12'
    }
  }
}

然后将customDomainNew添加到路由

resource frontdoorendpointFrontEnd 'Microsoft.Cdn/profiles/afdendpoints/routes@2022-11-01-preview' = {
  parent: frontdoorEndpointDefault
  name: 'frontend-v2'
  properties: {
    customDomains: [
      { id: customDomainApp.id }
      { id: customDomainNew.id } 
    ]
    ...

然后我运行...如果...
az deployment sub create -l eastus -f ./main.bicep -p ./Parameters/ci.json -w
并且我没有看到任何有关添加到路由的新自定义域的信息,我只看到正在更改的标记。我还想知道为什么rontdoor-shared-ci-global等资源被忽略

PS /Users/user/Projects/Code/Cloud/Infrastructure>  az deployment sub create -l eastus -f ./main.bicep -p ./Parameters/ci.json -w
Note: The result may contain false positive predictions (noise).
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues

Resource and property changes are indicated with these symbols:
  + Create
  ~ Modify
  = Nochange
  * Ignore

The deployment will update the following scopes

Scope: /subscriptions/xxx

  ~ resourceGroups/rg-appservice-hats-ci-eastus [2022-09-01]
    ~ tags.deploymentTime: "14:36" => "14:42"

  ~ resourceGroups/rg-frontdoor-shared-ci-global [2022-09-01]
    ~ tags.deploymentTime: "14:36" => "14:42"

  ~ resourceGroups/rg-network-shared-ci-eastus [2022-09-01]
    ~ tags.deploymentTime: "14:36" => "14:42"

Scope: /subscriptions/xxx/resourceGroups/rg-appservice-hats-ci-eastus

  ~ Microsoft.Web/serverfarms/serverfarm-hats-ci-eastus [2022-03-01]
    ~ tags.deploymentTime: "14:36" => "14:42"

  ~ Microsoft.Web/sites/site-hats-ci-eastus [2022-03-01]
    + properties.siteConfig.localMySqlEnabled:   false
    + properties.siteConfig.netFrameworkVersion: "v4.6"
    ~ tags.deploymentTime:                       "14:36" => "14:42"

  = Microsoft.Network/privateEndpoints/private-endpoint-web [2021-02-01]
  * Microsoft.Network/networkInterfaces/private-endpoint-web.nic.xxxx

Scope: /subscriptions/xxxx/resourceGroups/rg-frontdoor-shared-ci-global

  * Microsoft.Cdn/profiles/frontdoor-shared-ci-global
  * Microsoft.Cdn/profiles/frontdoor-shared-ci-global/afdendpoints/frontdoor-shared-ci-global
  * Microsoft.Network/frontdoorWebApplicationFirewallPolicies/wafsharedciglobal

Scope: /subscriptions/xxxxxx/resourceGroups/rg-network-shared-ci-eastus

  ~ Microsoft.Network/virtualNetworks/vnet-shared-ci-eastus [2022-05-01]
    ~ tags.deploymentTime: "14:36" => "14:42"

Resource changes: 6 to modify, 1 no change, 4 to ignore.

你会发现假设分析并没有提供太多的细节。

cwdobuhd

cwdobuhd1#

在我看来,将有一个模板的问题,参考官方tutorial

resource <resource Name>
'Microsoft.Cdn/profiles/customDomains@2022-05-01-preview' = {
  name: 'string'
  parent: <Resource Name>
  properties: {
    azureDnsZone: {
      id: 'string'
    }
    extendedProperties: {}
    hostName: 'string'
    preValidatedCustomDomainResourceId: {
      id: 'string'
    }
    tlsSettings: {
      certificateType: 'string'
      minimumTlsVersion: 'string'
      secret: {
        id: 'string'
      }
    }
  }
}

What-If将我们的ARM模板与部署的服务进行比较,根据比较结果,可以决定是否需要部署。这与terraform中的“terraform plan”命令相同
这是tutorial的例子,我找到了一些与whatif相关的有用的博客

相关问题