Yes I had tried to follow these instructions. I tried running this script https://github.com/mitchellh/packer/blob/master/contrib/azure-setup.sh It failed repeatedly at the same spot with error
info: *storage account create* command *OK* ==> Creating application ==> Creating service principal info: Executing command *ad sp create* error: missing required argument `name' It turns out the azure cli has change how it creates ad sp so the setup script is out of sync. I was able to get past the errors by removing client_id, tenant_id and client_secret. packer prompted me for device login. Once I authenticated my image was built. I also have a question about this simple template https://github.com/mitchellh/packer/blob/master/examples/azure/ubuntu_quickstart.json It has these lines at the bottom "apt-get update", "apt-get upgrade -y", "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" The last line uses waagent -deprovision to wipe out all user specific information. If I want to install additional packages when should I do that? It is before running waagent -deprovision or after running the deprovisioning. Thanks On Thursday, August 4, 2016 at 1:38:28 AM UTC-5, Alvaro Miranda Aguilera wrote: > > Hello, > > Have you done all the steps that are shown here? > https://www.packer.io/docs/builders/azure-setup.html > > Thanks > Alvaro. > > On Thu, Aug 4, 2016 at 5:57 AM, Rajinder Singh <[email protected] > <javascript:>> wrote: > >> I am trying to build a ubuntu VHD in azure using packer. >> >> I took an existing sample. >> >> https://github.com/mitchellh/packer/blob/master/examples/azure/ubuntu.json >> >> I created a service principle using these instructions. >> >> >> <https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/> >> >> <https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/> >> >> <https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/> >> https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/ >> >> I have create service principle many times before. >> >> I updated above template and set the values for >> >> "client_id": "xxxx", >> "client_secret": "gggg", >> "resource_group_name": "group name", >> "storage_account": "stgacctname", >> "subscription_id": "xxx", >> "tenant_id": "brrrr", >> >> "capture_container_name": "images", >> "capture_name_prefix": "packer", >> >> >> *Build 'azure-arm' errored: autorest#WithErrorUnlessStatusCode: POST >> https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxx/oauth2/token?api-version=1.0 >> >> <https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxx/oauth2/token?api-version=1.0> >> >> failed with 400 Bad Request: StatusCode=400* >> >> >> *I need to find a fix this this issue ASAP. Seems like an authentication >> failure but I don't know why.* >> >> *I have used Packer with AWS for a while and it has worked well.* >> >> *I recommended Packer to a client for Azure and I am surprised to see >> that even my simple example does not work.* >> >> >> *appreciate any tips or suggestions.* >> >> >> *Thanks* >> >> -- >> This mailing list is governed under the HashiCorp Community Guidelines - >> https://www.hashicorp.com/community-guidelines.html. Behavior in >> violation of those guidelines may result in your removal from this mailing >> list. >> >> GitHub Issues: https://github.com/mitchellh/packer/issues >> IRC: #packer-tool on Freenode >> --- >> You received this message because you are subscribed to the Google Groups >> "Packer" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/packer-tool/e6c9be43-9fe1-4165-b42f-1671daf1ae75%40googlegroups.com >> >> <https://groups.google.com/d/msgid/packer-tool/e6c9be43-9fe1-4165-b42f-1671daf1ae75%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Alvaro > (+31)103400555 > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/cff141f8-3421-4475-8865-9dd455788533%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
