I have the same situation. can someone please advise?
How to configure windows ado agent using powershell script in a terraform module
I am using terraform to provision a vm and using a powershell script to install and configure ado agent on the vm upon creation. I have the powershell script both in azure blob storage and in my github repo. However the vm is still unable to route to both the github repo and blob storage to download the script. I keep getting the following error:
Error: Code="VMExtensionProvisioningError" Message="VM has reported a failure when processing extension 'ConfigureADOAgent' (publisher 'Microsoft.Compute' and type 'CustomScriptExtension'). Error message: 'File download failure'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot. "
│
│ with azurerm_virtual_machine_extension.extension[0],
│ on resource.tf line 87, in resource "azurerm_virtual_machine_extension" "extension":
│ 87: resource "azurerm_virtual_machine_extension" "extension" {
│
Here is a snippet of the block of code in the terraform config that creates the custom script extension;
resource "azurerm_virtual_machine_extension" "extension" {
count = var.no_of_vm
name = "ConfigureADOAgent"
virtual_machine_id = azurerm_windows_virtual_machine.ado_agent[count.index].id
publisher = "Microsoft.Compute"
type = "CustomScriptExtension"
type_handler_version = "1.10"
settings = <<SETTINGS
{
"fileUris": ["https://winadoblob.blob.core.windows.net/newcontainer/userdata.ps1"],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File userdata.ps1"
}
SETTINGS
}