Hi,
I want to execute powershell in a remote machine. Script I used for the same is pasted below. Powershell file is saved in Azure Blob Storage.
resource “azurerm_virtual_machine_extension” “software” {
name = “vm-ir-poc-devopsagent”
virtual_machine_id = azurerm_windows_virtual_machine.vmWindows.id
publisher = “Microsoft.Azure.Extensions” #“Microsoft.Compute”
type = “CustomScriptExtension”
type_handler_version = “2.0”
auto_upgrade_minor_version = “true”
protected_settings = <<PROTECTED_SETTINGS
{
“commandToExecute”: “powershell.exe -Command "./gatewayInstall.ps1 ‘IR@497119c8-0010-47e3-8fbb-63d10c8b9999@adf-poc-05-medium09@ServiceEndpoint=adf-poc-05-medium09.canadacentral.datafactory.azure.net@BgP3qsHN1XI0mhvAAAAdO5wp3fD4KM7tpAAaaO2Dt0o=’; exit 0;"”
}
PROTECTED_SETTINGS
settings = <<SETTINGS
{
“fileUris”: [
“https://rg9c06.blob.core.windows.net/powerscript/gatewayInstall.ps1”
]
}
SETTINGS
}
When I am trying to execute powershell in remote machine facing below error
Error: compute.VirtualMachineExtensionsClient#CreateOrUpdate: Failure sending request: StatusCode=404 – Original Error: Code=“ArtifactNotFound” Message="The VM extension with publisher ‘Microsoft.Azure.Extensions’ and type ‘CustomScriptExtension’ could not be found.
Please help me to resolve the above issue