<p>Use the following configuration key:</p>
<pre class="lang-json prettyprint-override"><code>.
.
&quot;temp_compute_name&quot;: &quot;&lt;desired_name&gt;&quot;,
.
.
</code></pre>
<p>Note: Try to keep name short.</p>

CC BY-SA 4.0
2022-07-01T00:35:24.710Z
2022-07-01T10:22:47.237Z
2022-07-01T10:22:47.237Z
Vix
<p>According to <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder" rel="nofollow noreferrer">this</a> manual one can build an image on Azure using Azure Image Builder. When running the first example, the following error is shown in the customization log:</p>
<pre><code>PACKER ERR ==&gt; azure-arm: ERROR: -&gt; RequestDisallowedByPolicy :
Resource '1f43d6s8hd4fr5e' was disallowed by policy
&quot;Virtual Machine Naming Policy&quot;
</code></pre>
<p>The question is how to set the Virtual Machine image name using Azure Image Builder.</p>
<p><strong>Attempts to solve the issue</strong></p>
<ol>
<li>Asked the team that is responsible for the policy to remove are change the <em>Virtual Machine Naming Policy</em></li>
<li>Tried to change the VM image name by modifying some keys in the json file.</li>
<li>Created the following GitHub <a href="https://github.com/Azure/azvmimagebuilder/issues/28" rel="nofollow noreferrer">issue</a>.</li>
</ol>

<azure><packer><vm>
How to set the Virtual Machine name using Azure Image Builder?
030
# How to set the Virtual Machine name using Azure Image Builder?

(Asked by: username_0 on 2022-03-11)

According to this manual one can build an image on Azure using Azure Image Builder. When running the first example, the following error is shown in the customization log:
PACKER ERR ==> azure-arm: ERROR: -> RequestDisallowedByPolicy :
Resource '1f43d6s8hd4fr5e' was disallowed by policy
"Virtual Machine Naming Policy"

The question is how to set the Virtual Machine image name using Azure Image Builder.
Attempts to solve the issue

Asked the team that is responsible for the policy to remove are change the Virtual Machine Naming Policy
Tried to change the VM image name by modifying some keys in the json file.
Created the following GitHub issue.

**Tags:** azure, packer, vm


---

## 1 answers

### Answer by username_1 on 2022-07-01. Score: 0

Use the following configuration key:
.
.
"temp_compute_name": "",
.
.

Note: Try to keep name short.


---

