使用puppet模块创建azure vm

使用puppet模块创建azure vm,azure,virtual-machine,puppet,Azure,Virtual Machine,Puppet,当我想在azure上创建vm时,我遇到以下错误: 无权在作用域上执行操作“Microsoft.Storage/register/action” 我在classic portal上创建了一个应用程序,并遵循本教程: 之后,我在新门户上创建了一个资源组,并为该应用程序分配了所有者 我正在使用这个傀儡脚本创建vm: azure_vm { 'sample': ensure => present, location => 'westus',

当我想在azure上创建vm时,我遇到以下错误:

无权在作用域上执行操作“Microsoft.Storage/register/action”

我在classic portal上创建了一个应用程序,并遵循本教程:

之后,我在新门户上创建了一个资源组,并为该应用程序分配了所有者

我正在使用这个傀儡脚本创建vm:

azure_vm { 'sample':
    ensure         => present,
    location       => 'westus',
    image          => 'canonical:ubuntuserver:14.04.2-LTS:latest',
    user           => 'azureuser',
    password       => 'Password',
    size           => 'Standard_A0',
    resource_group => 'puppettest123',
}
当我运行它时,我得到了一个确切的错误:

Error: {"error"=>{"code"=>"AuthorizationFailed", "message"=>"The client '5b0bc6d-fcad-4223-8527-a2c9afc2661' with object id '5b0bc6d-fcad-4223-8527-a2c9afc2661' does not have authorization to perform action 'Microsoft.Storage/register/action' over scope '/subscriptions/5ad96a9-45de-4fe1-91e8-2514dd5e6a9'."}}
Error: /Stage[main]/Main/Azure_vm[sample]/ensure: change from absent to present failed: {"error"=>{"code"=>"AuthorizationFailed", "message"=>"The client '5b0bc6d-fcad-4223-8527-a2c9afc2661' with object id '5b0bc6d-fcad-4223-8527-a2c9afc2661' does not have authorization to perform action 'Microsoft.Storage/register/action' over scope '/subscriptions/5ad96a9-45de-4fe1-91e8-2514dd5e6a9'."}}

关于如何解决这个问题,有什么想法吗

我使用以下命令修复了该问题:
azure角色分配创建--objectId 7dbc8265-51ed-4038-8e13-31948c7f4ce7-o所有者-c/subscriptions/{subscriptionId}/

azure角色分配创建--objectId 7dbc8265-51ed-4038-8e13-31948c7f4ce7-o所有者-c/subscriptions/{subscriptionId}/

如果您确定复制的代码中哪些是导致错误的原因,您将获得更好的帮助。否则,贡献者将被要求遵循完全相同的教程。@Jonathon我认为提出这个问题的部分原因是询问者不确定代码的哪一部分导致了错误。