0
votes

I have used this link in order to create a virtual machine all in power shell.

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/quickstart-sql-vm-create-powershell

For some reason I need to get the job done with Azure CLI, is there any what to fully automate it in Azure CLI?

2

2 Answers

1
votes

I don't know of an Azure CLI command that will explicitly install the SQL IaaS Extension. One thing you can try is to build out the VM in the CLI then do an ARM Template Deployment to Configure Automated Patching. Automated Patching is supported in your virtual machine through the SQL Server IaaS Agent extension. This extension must be installed on the VM to be able to use this feature. When you enable Automated Patching on your virtual machine, the extension will be automatically installed.

0
votes

Please try the following:

az vm create -n sql -g <resourcegroupname> --image MicrosoftSQLServer:SQL2017-WS2016:Standard:14.0.1000200 --location  EastUS2 --admin-username <username> --admin-password <password> --verbose