{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/packer/issues/6003","repository_url":"https://api.github.com/repos/hashicorp/packer","labels_url":"https://api.github.com/repos/hashicorp/packer/issues/6003/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/packer/issues/6003/comments","events_url":"https://api.github.com/repos/hashicorp/packer/issues/6003/events","html_url":"https://github.com/hashicorp/packer/pull/6003","id":304094186,"number":6003,"title":"azure: respect -force for managed image deletion","user":{"login":"boumenot","id":91112,"avatar_url":"https://avatars2.githubusercontent.com/u/91112?v=4","gravatar_id":"","url":"https://api.github.com/users/boumenot","html_url":"https://github.com/boumenot","followers_url":"https://api.github.com/users/boumenot/followers","following_url":"https://api.github.com/users/boumenot/following{/other_user}","gists_url":"https://api.github.com/users/boumenot/gists{/gist_id}","starred_url":"https://api.github.com/users/boumenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boumenot/subscriptions","organizations_url":"https://api.github.com/users/boumenot/orgs","repos_url":"https://api.github.com/users/boumenot/repos","events_url":"https://api.github.com/users/boumenot/events{/privacy}","received_events_url":"https://api.github.com/users/boumenot/received_events","type":"User","site_admin":false},"labels":[{"id":348325176,"url":"https://api.github.com/repos/hashicorp/packer/labels/builder/azure","name":"builder/azure","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-10T18:46:36Z","updated_at":"2018-04-10T19:52:59Z","closed_at":"2018-03-13T16:47:17Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/hashicorp/packer/pulls/6003","html_url":"https://github.com/hashicorp/packer/pull/6003","diff_url":"https://github.com/hashicorp/packer/pull/6003.diff","patch_url":"https://github.com/hashicorp/packer/pull/6003.patch"},"body":"Closes #5509 "},"comment":{"url":"https://api.github.com/repos/hashicorp/packer/issues/comments/380225970","html_url":"https://github.com/hashicorp/packer/pull/6003#issuecomment-380225970","issue_url":"https://api.github.com/repos/hashicorp/packer/issues/6003","id":380225970,"user":{"login":"zanecodes","id":1373020,"avatar_url":"https://avatars1.githubusercontent.com/u/1373020?v=4","gravatar_id":"","url":"https://api.github.com/users/zanecodes","html_url":"https://github.com/zanecodes","followers_url":"https://api.github.com/users/zanecodes/followers","following_url":"https://api.github.com/users/zanecodes/following{/other_user}","gists_url":"https://api.github.com/users/zanecodes/gists{/gist_id}","starred_url":"https://api.github.com/users/zanecodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanecodes/subscriptions","organizations_url":"https://api.github.com/users/zanecodes/orgs","repos_url":"https://api.github.com/users/zanecodes/repos","events_url":"https://api.github.com/users/zanecodes/events{/privacy}","received_events_url":"https://api.github.com/users/zanecodes/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T19:52:59Z","updated_at":"2018-04-10T19:52:59Z","author_association":"NONE","body":"Looks like the Azure REST API supports [overwriting VHDs during image capture](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/capture#request-body), and right now Packer [does not do so](https://github.com/hashicorp/packer/blob/master/builder/azure/arm/config.go#L180). So all that needs to happen is to:\r\n* change [this line](https://github.com/hashicorp/packer/blob/master/builder/azure/arm/config.go#L180) to something like `OverwriteVhds: &c.PackerConfig.OverwriteVhds,`\r\n* add `OverwriteVhds bool` somewhere [around here](https://github.com/hashicorp/packer/blob/master/builder/azure/arm/config.go#L81)\r\n* add `\tif b.config.PackerConfig.PackerForce {\r\n\t\tb.config.OverwriteVhds = true\r\n\t}` around [here](https://github.com/hashicorp/packer/blob/master/builder/azure/arm/builder.go#L44)"}}
{"actor":{"display_login":"zanecodes"}}