terraform-provider-azurerm: azurerm_virtual_machine_scale_set_extension not running

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave โ€œ+1โ€ or โ€œme tooโ€ comments, they generate extra noise for issue followers and do not help prioritize the request

Terraform (and AzureRM Provider) Version

Terraform v0.12.21

  • provider.azurerm v1.44.0

Terraform Configuration Files

resource "azurerm_virtual_machine_scale_set_extension" "test" {
  name                         = "init-script"
  virtual_machine_scale_set_id = azurerm_windows_virtual_machine_scale_set.test.id
  publisher                    = "Microsoft.CPlat.Core"
  type                         = "RunCommandWindows"
  type_handler_version         = "1.1"
  auto_upgrade_minor_version   = true
  settings = jsonencode({
    script = split("\n", file("${path.module}/init.ps1"))
  })
  protected_settings = jsonencode({
    parameters = [
      {
        Name  = "input"
        Value = data.external.ip_address.result.privateIpAddress
      },
    ]
  })
}

Description / Feedback

Iโ€™m trying out the new azurerm_virtual_machine_scale_set_extension resource, and I may be missing something, but although the extensions are created they donโ€™t seem to actually run. Iโ€™ve used the above example on the old VM scale set resource and it runs the script fine, but with the new resource nothing is run. Querying with the Azure CLI shows

{
  "autoUpgradeMinorVersion": true,
  "forceUpdateTag": null,
  "id": null,
  "name": "init-script",
  "protectedSettings": null,
  "provisionAfterExtensions": [],
  "provisioningState": null,
  "publisher": "Microsoft.CPlat.Core",
  "settings": {
    "script": [
      "param (",
      "  [string]$input",
      ")",
      "$ErrorActionPreference = \"Stop\"",
      "$ProgressPreference = \"SilentlyContinue\"",
      "Write-Host test"
    ]
  },
  "type": "RunCommandWindows",
  "typeHandlerVersion": "1.1"
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 23
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Inline extensions for VMSS was released as a Beta feature in v2.26.0, please see the docs for the azurerm_windows_virtual_machine_scale_set and azurerm_linux_virtual_machine_scale_set for use.

Iโ€™m going to close this for now, we can re-open if this does not resolve this issue.