title: Domain join with bicep file in azure
body: <p>I'm creating an azure vm and having issues joining it to a domain and it appears to be around tcp/ip v6  being enabled.  How do I disable v6 in the bicep file on creation so I can using Microsoft.Compute/virtualMachines/extensions to auto join to my domain?</p>
  <p>Using Microsoft.Network/networkInterfaces to create my nic and Microsoft.Compute/virtualMachines to create my vm.</p>
  <p>On further discovery I can after all join once I get the machine booted up.
  Here is my bicep section I am using to join the domain:</p>
  <pre><code>resource virtualMachineExtension 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' = {
    parent: windowsVm
    name: 'joindomain'
    location: location
    properties: {
      publisher: 'Microsoft.Compute'
      type: 'JsonADDomainExtension'
      typeHandlerVersion: '1.3'
      autoUpgradeMinorVersion: true
      settings: {
        name: 'corp.mydomain.com'
        ouPath: 'Servers,DC=corp,DC=mydomain,DC=com'
        user: 'corp.mydomain.com\\${domainJoinUserName}'
        restart: true
        options: 3
      }
      protectedSettings: {
        Password: domainJoinUserPassword
      }
    }
  }
  </code></pre>
  <p>I capture the username and password with a deploy script that includes:</p>
  <pre><code>$domainJoinUserName = Read-Host -Prompt 'Domain Admin Username'
      $domainJoinUserPassword = Read-Host -AsSecureString -Prompt 'Domain Admin Password'
      $domainJoinUserPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($domainJoinUserPassword))
  </code></pre>