2
votes

I want to create a new Azure DevOps organization with the az command line.

I have installed the devops extension.

I have read the Microsoft documentation and it describes how to create an organization through web interface, but there is nothing described for command line.

I have also read the documentation of az and az devops extension.

Have I missed something?

1

1 Answers

1
votes

I am afraid currently it is not supported to create Azure DevOps organization via az devops command line or the DevOps REST API.

However, you can use Azure CLI az resource create to create a resource of type microsoft.visualstudio/account as a workaround. This will create an Azure DevOps organization. For example:

az resource create -g AzureResourceGroup -n MyDevopsOrganizationName `
    --resource-type microsoft.visualstudio/account --is-full-object `
    --properties '{\"location\":\"Central Us\", \"properties\":{ \"operationType\": \"Create\"}}'

The command above creates Azure DevOps organization MyDevopsOrganizationName. https://MyDevopsOrganizationName.visualstudio.com

You can also use an ARM template to create an Azure DevOps organization.