I am using Terraform v0.12.24 with provider.azurerm v2.2.0 I get this error below when i try to create scaleset VMs:
Error: compute.VirtualMachineScaleSetsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The value of parameter linuxConfiguration.ssh.publicKeys.path is invalid." Target="linuxConfiguration.ssh.publicKeys.path"
on scaleset.tf line 1, in resource "azurerm_virtual_machine_scale_set" "demo": 1: resource "azurerm_virtual_machine_scale_set" "demo" {
I am using Windows 10 for the terraform configuration. My os_profile_linux_config is as below:
storage_profile_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "18.04-LTS"
version = "latest"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
key_data = file("C:/Users/jack/Documents/key/id_rsa.pub")
path = "C:/Users/jack/Documents/key"
}
}
First, i have tried two different key pairs. one is created by puttygen and the other by ssh-keygen with git bash. I had the same error with both of them. Do you have any idea?