It’s been a long standing “issue” and challenge with Azure Resource Manager (ARM) Templates. If you want to deploy an ARM template, you must already have a Resource Group created to deploy into
Workarounds have included writing a PowerShell script, which pre-creates the Resource Group and then calling the ARM template deployment.
Other templating languages, like Terraform, didn’t have this issue; and you could create your new Resource Group AND deploy to it, all within the same template.
Today, that all changes! We now have the ability to create a new Resource Group in an ARM template, and then also deploy to that Resource Group!