<p>To run prefect jobs in azure kubernetes (aks) virtual nodes, besides adding the recommended <code>nodeSelector/tolerations</code>:</p>
<pre class="lang-py prettyprint-override"><code>&quot;nodeSelector&quot;: {
    &quot;kubernetes.io/role&quot;: &quot;agent&quot;,
    &quot;beta.kubernetes.io/os&quot;: &quot;linux&quot;,
    &quot;type&quot;: &quot;virtual-kubelet&quot;,
},
&quot;tolerations&quot;: [
    {&quot;key&quot;: &quot;virtual-kubelet.io/provider&quot;, &quot;operator&quot;: &quot;Exists&quot;},
    {&quot;key&quot;: &quot;azure.com/aci&quot;, &quot;effect&quot;: &quot;NoSchedule&quot;},
],
</code></pre>
<p>container creation fails with:</p>
<pre class="lang-bash prettyprint-override"><code>Warning   ProviderCreateFailed   pod/prefect-job-XXXXX-XXXXX   ACI does not support providing args without specifying the command. Please supply both command and args to the pod spec.
</code></pre>
<p>The different <code>command</code> options stated in <a href="https://linen.prefect.io/t/48087/topic" rel="nofollow noreferrer">https://linen.prefect.io/t/48087/topic</a> do not work.</p>
<p>How to solve it?</p>

Nuno Silva
<pre><code>command&quot;: [&quot;tini&quot;, &quot;-g&quot;, &quot;--&quot;],
</code></pre>
<p>solves the issue and allows prefect jobs to run in aks virtual nodes.</p>
<p>Here an example of a working <code>job_template</code>:</p>
<pre class="lang-py prettyprint-override"><code>{
    &quot;apiVersion&quot;: &quot;batch/v1&quot;,
    &quot;kind&quot;: &quot;Job&quot;,
    &quot;spec&quot;: {
        &quot;template&quot;: {
            &quot;spec&quot;: {
                &quot;containers&quot;: [
                    {
                        &quot;name&quot;: &quot;flow&quot;,
                        &quot;command&quot;: [&quot;tini&quot;, &quot;-g&quot;, &quot;--&quot;],
                    }
                ],
                &quot;nodeSelector&quot;: {
                    &quot;kubernetes.io/role&quot;: &quot;agent&quot;,
                    &quot;beta.kubernetes.io/os&quot;: &quot;linux&quot;,
                    &quot;type&quot;: &quot;virtual-kubelet&quot;,
                },
                &quot;tolerations&quot;: [
                    {&quot;key&quot;: &quot;virtual-kubelet.io/provider&quot;, &quot;operator&quot;: &quot;Exists&quot;},
                    {&quot;key&quot;: &quot;azure.com/aci&quot;, &quot;effect&quot;: &quot;NoSchedule&quot;},
                ],
                &quot;imagePullSecrets&quot;: [
                    {&quot;name&quot;: &quot;regcred&quot;},
                ],
            },
        }
    },
}
</code></pre>
