I have used the new terraform module for Linux vmss to include monitoring agents as a custom extension, however, the instance doesn't have the "Latest model" when everything is done and manually restart vmss to get a newer model that works but I don't want manual intervention. The previous module doesn't need to manually re-image to get the newest one. did I miss anything?
the code the extension is
"azurerm_virtual_machine_scale_set_extension" "oms" {
name = "OmsAgentForLinux"
depends_on = [azurerm_linux_virtual_machine_scale_set.vmss]
virtual_machine_scale_set_id = azurerm_linux_virtual_machine_scale_set.vmss.id
publisher = "Microsoft.EnterpriseCloud.Monitoring"
type = "OmsAgentForLinux"
type_handler_version = "1.11"
settings = <<-BASE_SETTINGS
{
"workspaceId" : "xxxx"
}
BASE_SETTINGS
protected_settings = <<-PROTECTED_SETTINGS
{
"workspaceKey" : "xxxxx"
}
PROTECTED_SETTINGS
}
Module for creating azure vmss
resource "azurerm_linux_virtual_machine_scale_set" "example" {
name = "example-vmss"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "Standard_F2"
instances = 1
admin_username = "administer"
admin_ssh_key {
username = "administer"
public_key = file("~/.ssh/id_rsa.pub")
}
source_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
version = "latest"
}
os_disk {
storage_account_type = "Standard_LRS"
caching = "ReadWrite"
}
network_interface {
name = "example"
primary = true
ip_configuration {
name = "internal"
primary = true
subnet_id = azurerm_subnet.internal.id
}
}
}
the old module does not specify OS
"azurerm_virtual_machine" "demovm"