Custom Script Extension Stuck Creating

Matt Davison 26 Reputation points
2020-06-04T18:28:16.867+00:00

Hi,

I have been using the custom script extension with Terraforms to deploy run a script on a 2016 Datacenter VM. I have been having an issue where the custom script extension runs till timeout and I can't seem to figure out why. Here is my code:

resource "azurestack_virtual_machine_extension" "temp" {
  name                 = "temp"
  location             = var.location
  resource_group_name  = var.resource_group_name
  virtual_machine_name = local.virtual_machine_name
  publisher            = "Microsoft.Compute"
  type                 = "CustomScriptExtension"
  type_handler_version = "1.9"
  depends_on           = [azurestack_virtual_machine.domain-controller]

  settings           = <<SETTINGS
  {
    "commandToExecute": "exit 0"
  }
SETTINGS
}

Even with setting commandToExecute to "exit 0" the deployment still runs for 90 minutes before timing out. Is there something I am doing wrong here?

Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
180 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dennis Birk 401 Reputation points
    2020-06-05T09:32:05+00:00

    Hi,

    check on your created VM the script path on "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\<Version>\Downloads\<Version>. This script run on local system context.
    Run this script on your VM and check the output.

    This make also the custom script extension.

    0 comments No comments