Application Health Extension for VMSS

Just trying to provision an Application Gateway with a VM Scale set, the Scale Set should be configured for automatic OS upgrade and hence a health extension is required. However, it´s not documented how the extension should be referenced. Documentation just contains information how a loadbalancer health probe is referenced.

1m[31mError: [0m[0m[1mhealth_probe_id must be set or a health extension must be specified when upgrade_mode is set to “Automatic” and automatic_os_upgrade_policy block exists[0m

I have added a health extension to my code:

resource “azurerm_virtual_machine_scale_set_extension” “ApplicationHealthExtension” {
name = “applicationhealth”
virtual_machine_scale_set_id =
publisher = “Microsoft.ManagedServices”
type = “ApplicationHealthWindows”
auto_upgrade_minor_version = true

tag to force update

force_update_tag = “current”
type_handler_version = “1.0”
settings =jsonencode({
protocol = “http”
port = “80”
requestPath = “/”

How is this extension then “linked” to the upgrade setting?