Skip to content

azure-arm 2.5.2: Using image_url results in an error of "Parameter 'osDisk.image' is not allowed" #584

@jhrabi

Description

@jhrabi

Overview of the Issue

When trying to use the azure-arm builder and using the image_url function, the build fails with a message of "osDisk.image is not allowed". A full example of the error message can be seen below:

Reproduction Steps

packer build with the sample packer file

Plugin and Packer version

Packer v1.15.0
Azure Plugin v2.5.2 (packer-plugin-azure_v2.5.2_x5.0_windows_386.exe)

Simplified Packer Buildfile

packer {
  required_plugins {
    azure = {
      source  = "github.com/hashicorp/azure"
      version = "2.5.2" # Specify the desired version constraint
    }
  }
}

source "azure-arm" "lab"{
  azure_tags = {
    dept = "department"
    task = "task"
  }

  image_url                         = "https://sample.blob.core.windows.net/images/WindowsSample.vhd"
  vm_size                           = "Standard_E4_v4"
  location                          = "East US"
  storage_account                   = "sample"
  resource_group_name               = "resourcegroup"
  capture_container_name            = "images"
  capture_name_prefix               = "labimage"
  os_type                           = "Windows"
  client_id                         = "*********************************"
  client_secret                     = "*********************************"
  subscription_id                   = "*********************************"
  tenant_id                         = "*********************************"
  skip_create_image                 = "true"
}

build {
  sources = ["source.azure-arm.lab"]
    provisioner "powershell" {
      inline            = ["$env:chocolateyVersion = '1.4.0'"]
      valid_exit_codes  = [0, 3010]
    }
}

Operating system and Environment details

Windows 11

Log Fragments and crash.log files

Build 'azure-arm.lab' errored after 6 minutes 2 seconds: polling after CreateOrUpdate: polling failed: the Azure API returned the following error:

Status: "DeploymentFailed"
Code: "InvalidParameter"
Message: "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.\nParameter 'osDisk.image' is not allowed."
Activity Id: ""
```.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions