Azure / arm-template-whatif

A repository to track issues related to what-if noise suppression
MIT License
86 stars 13 forks source link

Microsoft.Web/sites/hostnameBindings #164

Open allanlw opened 3 years ago

allanlw commented 3 years ago

Describe the noise

Resource type Microsoft.Web/sites/hostnameBindings

apiVersion 2019-08-01

Client (PowerShell, Azure CLI, or API) Azure CLI

Relevant ARM Template code (we only need the resource object for the above resourceType and apiVersion, but if it's easier you can include the entire template

resource functionAppHostnameBinding 'Microsoft.Web/sites/hostnameBindings@2019-08-01' = if (!empty(backendHostname)) {
  name: '${functionAppName}/${backendHostname}'
  dependsOn: [
    functionApp // remove when bicep supports lexical scoping: https://github.com/Azure/bicep/issues/1363
  ]
  properties: {
    sslState: 'SniEnabled'
    thumbprint: reference(backendCertificate.name).Thumbprint
  }
}

resource backendCertificate 'Microsoft.Web/certificates@2019-08-01' = if (!empty(backendHostname)) {
  name: '${namePrefix}-backendCert'
  location: location
  // bicep thinks "password" is required, but it is not.
  // Tracking issue: https://github.com/Azure/azure-rest-api-specs/issues/5029
  properties: {
    serverFarmId: hostingPlan.id
    canonicalName: backendHostname
  }
}

Expected response made no change

Current (noisy) response (either include a screenshot of the what-if output, or copy/paste the text)

  ~ Microsoft.Web/sites/REDACTED/hostNameBindings/REDACTED [2019-08-01]
    - location:                "Japan East"
    - properties.hostNameType: "Verified"
    - properties.siteName:     "REDACTED"
    ~ properties.thumbprint:   "REDACTED" => "[reference(format('{0}-backendCert', parameters('namePrefix'))).Thumbprint]"
shenglol commented 3 years ago

The property "location" is read-only, and is tracked by the S360 KPI, but it takes time for the web RP to fix them, so I tagged it in our metadata. The other properties are immutable (cannot be updated after creation), but currently the What-If engine doesn't handle them. I'm going to update the engine to ignore immutable properties.