I want to add an azurerm_virtual_machine_extension resource to an already existing VM resource:
resource "azurerm_virtual_machine_extension" "vm-bootstrap" {
count = "1"
name = "bootstrap"
virtual_machine_id = ...
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.1"
auto_upgrade_minor_version = "false"
settings = <<SETTINGS
{
"script": "${filebase64("bootstrap.sh")}"
}
SETTINGS
}
Running terraform apply returns with the following error:
Error: compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ArtifactVersionNotFound" Message="No version found in the artifact repository that satisfies the requested version '2.1' for VM extension with publisher 'Microsoft.Azure.Extensions' and type 'CustomScript'."
Though it looks like the VM extenson exists:
az vm extension image list-versions -n CustomScript --publisher Microsoft.Azure.Extensions --lo
cation westeurope --query "[].name" -o tsv | sort -u
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.0.7
2.1.1
2.1.2
2.1.3
2.1.6
Terraform v1.0.11,
azure-cli: "2.30.0",
azure-cli-core: "2.30.0",
azure-cli-telemetry: "1.0.6",
"extensions": {}
Can you please advise?