Сбой сборки Packer azure -arm vhd, группа ресурсов не найдена - PullRequest
1 голос
/ 07 мая 2020

У меня проблема с упаковщиком и стеком Azure, я пытаюсь создать изображение в стеке azure, но похоже, что упаковщик не пытается использовать мой настраиваемый URL.

{
  "builders": [{
    "type": "azure-arm",

    "client_id": "client_id",
    "client_secret": "client_secret",
    "tenant_id": "tenant_id",
    "subscription_id": "subscription_id",

    "managed_image_resource_group_name": "resource_group_name",
    "managed_image_name": "random_name",

    "os_type": "Linux",
    "image_publisher": "Canonical",
    "image_offer": "UbuntuServer",
    "image_sku": "18.04-LTS",

    "azure_tags": {
        "dept": "Engineering",
        "task": "Image deployment"
    },

    "location": "custom_location",
    "vm_size": "Standard_DS2_v2"
  }],
  "provisioners": [{
    "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
    "inline": [
      "apt-get update",
      "apt-get upgrade -y",
      "apt-get -y install nginx",

      "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
    ],
    "inline_shebang": "/bin/sh -x",
    "type": "shell"
  }]
}

Ошибка

azure-arm: output will be in this color.

==> azure-arm: Running builder ...
==> azure-arm: Getting tokens using client secret
==> azure-arm: Getting tokens using client secret
    azure-arm: Creating Azure Resource Manager (ARM) client ...
Build 'azure-arm' errored: Cannot locate the managed image resource group resource_group_name.

==> Some builds didn't complete successfully and had errors:
--> azure-arm: Cannot locate the managed image resource group olaf.

==> Builds finished but no artifacts were created.

Но все верно, я могу войти в систему с учетными данными ServiceAccount / App и перечислить все группы ресурсов. Вроде все работает.

У кого-нибудь есть идеи, как заставить Packer работать со стеком azure? Есть ли способ предоставить домен стека вместо исходного домена azure или что-то в этом роде?

Спасибо! =)

...