// , Packer 1.2.4 - Azure Resource Not Found

1,076 views
Skip to first unread message

Nate B

unread,
Jun 25, 2018, 10:03:51 PM6/25/18
to Packer
  // , It looks like the Packer API has moved on a bit since the last time there were any serious updates to the Terraform module for Azure Vault: 


I just started using Packer today, and ran into the following error: 

$ packer build vault-consul.json
azure
-arm output will be in this color.


==> azure-arm: Running builder ...
    azure
-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: ERROR: -> ResourceNotFound : The Resource 'Microsoft.Compute/images/vault-consul-ubuntu-2018-06-26-012357' under resource group 'packerresourcegroup' was not found.
==> azure-arm:
==> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF
Build 'azure-arm' errored: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Some builds didn't complete successfully and had errors:
--> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Builds finished but no artifacts were created.
l-sfo01ehtdd-m:vault-consul-image nbasane$ packer build vault-consul.json
azure-arm output will be in this color.


==> azure-arm: Running builder ...
    azure-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: ERROR: -> ResourceNotFound : The Resource '
Microsoft.Compute/images/vault-consul-ubuntu-2018-06-26-014346' under resource group 'packerresourcegroup' was not found.
==> azure-arm:
==> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF
Build '
azure-arm' errored: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Some builds didn'
t complete successfully and had errors:
--> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Builds finished but no artifacts were created.


I'm trying to get the examples working from here: 


But I'm wondering how I would tell whether I've run into some kind of a bug in the module, in my Azure configuration, or in Packer's Azure Builder itself. 

The service provider which I'm using for this has owner permissions on the resource group with the super creative name packerresourcegroup
Which means it's unlikely that it's a permissions issue, unless the underlying Builder is generating an incorrect Resource Name to send to the ARM endpoint.

Anyway, I wonder if anyone else has run into similar issues with Packer's Azure Builder, and if you have any ideas I can use to investigate further?

Nate B

unread,
Jun 25, 2018, 10:09:56 PM6/25/18
to Packer
  // , I think I may be reprising this GitHub issue: 

`azure-arm` builder "fails" to find your desired resource group when your service principal credentials are incorrect#5610

https://github.com/hashicorp/packer/issues/5610#issuecomment-400124163

Nate B

unread,
Jun 25, 2018, 10:24:01 PM6/25/18
to Packer
  // , I then attempted to create an existing image, packerconsulvaulttest-image-20180625160240

I then gave the name of that pre-existing image to Packer to use: 

$ packer build -force vault-consul.json
azure
-arm output will be in this color.



==> azure-arm: Running builder ...
    azure
-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: the managed image named packerconsulvaulttest-image-20180625160240 already exists, but deleting it due to -force flag
==> azure-arm:
==> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF
Build 'azure-arm' errored: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Some builds didn't complete successfully and had errors:
--> azure-arm: resources.GroupsClient#CheckExistence: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF


==> Builds finished but no artifacts were created.


Still no luck. 

And this time, I didn't even get a parseable error.  

Just "".

John A

unread,
Aug 27, 2018, 4:14:30 PM8/27/18
to Packer
Hi Nate,
Did you ever find a resolution to this?
I'm running into the exact same issue.

John A

unread,
Aug 28, 2018, 3:51:57 PM8/28/18
to Packer
In my case the issue was due to permissions not being granted on the created application.
I originally ran this step to grant permission to my application  https://www.packer.io/docs/builders/azure-setup.html#grant-permissions-to-your-application
Azure returned all the information and an “ok” status, indicating that the command succeeded, but that doesn’t seem to be the case.

`az role assignment list` did not contain the created role.  So I ran the command the create the role again and then packer started succeeding

Shashank

unread,
Mar 6, 2019, 6:03:29 AM3/6/19
to Packer
For me, The problem has been solved by giving Contributor access to the service principal.
Reply all
Reply to author
Forward
0 new messages