首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Packer azure-arm vhd构建失败,找不到资源组

Packer azure-arm vhd构建失败,找不到资源组
EN

Stack Overflow用户
提问于 2020-05-07 23:01:59
回答 1查看 309关注 0票数 1

我有一个打包和Azure堆栈的问题,我正在尝试在azure堆栈中构建一个Image,但看起来Packer不会尝试使用我的自定义url。

代码语言:javascript
运行
复制
{
  "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"
  }]
}

错误

代码语言:javascript
运行
复制
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域或类似的东西?

谢谢!=)

EN

回答 1

Stack Overflow用户

发布于 2020-10-30 08:06:06

我知道这个问题很老了,你可能已经解决了,但我今天遇到了同样的问题,我想为遇到这个问题的任何人添加我的解决方案可能会有所帮助:

确保您的服务主体已作为参与者添加到资源组中。

  • 在Azure门户中,导航到目标资源组

  • 单击左侧的"Access (IAM)“。

  • 单击顶部的"Add“,然后搜索服务主体
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61661051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档