Skip to content

[AVM Module Issue]: web-site has no built in support for Certificates and hostnameBindings #5191

@kevin-381ecc2e

Description

@kevin-381ecc2e

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Feature Request

Module Name

avm/res/web/site

(Optional) Module Version

0.15.1

Description

I'm trying to deploy a Web App with a hostname bindings and a certificated attached to it. However it seems that the module does not support this out of the box and requires additional resources to be deployed. The use of 'hostNameSslStates' was not sufficient alone

I had to deploy these resources besides the AVM web-site module

resource certificate 'Microsoft.Web/certificates@2024-04-01' = {
  name: certificate_Name
  location: resourceGroup().location
  properties: {
    keyVaultId: certificate_KeyVaultId
    keyVaultSecretName: certificate_KeyVaultSecretName
    serverFarmId: serverfarm.outputs.resourceId
  }
}

// This is required because its not possible to reference to a module
resource siteOutput 'Microsoft.Web/sites@2024-04-01' existing = {
  name: site_Name
}

resource webAppName_customHostname 'Microsoft.Web/sites/hostnameBindings@2019-08-01' = {
  parent: siteOutput
  name: customHostname
  properties: {
    sslState: 'SniEnabled'
    thumbprint: certificate.properties.thumbprint
  }
  dependsOn: [
    site
    siteOutput
  ]
}

(Optional) Correlation Id

No response

Metadata

Metadata

Type

No type

Projects

Status

Needs: Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions