Forum Discussion
experi18
Oct 05, 2023Brass Contributor
Azure CLI to join a domain
Hi, wich parameters should I add into my script to create Azure VM (Via CLI) in order to automatically join my domain?
KennethML
Oct 05, 2023Iron Contributor
I suppose you are refering to a Windows VM image. You should add a Joindomain extension to the Windows VM, using az vm extension set. This, of course, requires domain credentials to allow a VM to join the domain.
You can help the community if you post your bash script (without domain info).
/Kenneth ML
- experi18Oct 05, 2023Brass Contributor
Oh yes, sure.
This is the script that I am using right now as base of it (after using az login and after changing to the right subscription (where I do want to deploy the VM). But I do not know the right syntax in order to make the VM to join the domain, unfurtunately.
Let me show you in the screenshot.When I run this command, I receive this error: "argument --public-ip-address: expected one argument"
- KennethMLOct 06, 2023Iron Contributor
If you don't want to a assign a public IP address, you should remove the argument and not just assign an empty value otherwise put in a name for the PIP (or resource id for existing PIP).
/Kenneth ML