Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.2k stars 742 forks source link

SQL Database and SQL Server in separate resource groups #6043

Closed MattHartz closed 2 years ago

MattHartz commented 2 years ago

Is it possible via Bicep/ARM Templates to have 1 template creating the SQL server in resource group A, and another template creating the SQL Database in resource group B?

I know via the Azure Portal it is possible, but seems strange that I cannot seem to find a way to do it in an Bicep/ARM template.

This is not a feature request, or a bug report, just looking for guidance

Thanks!

alex-frankel commented 2 years ago

Can you share where in the portal you did this? It should be impossible to create a child resource in a different resource group than its parent. Otherwise, the Resource ID would not make sense:

/subscriptions/<subId>/resourceGroups/<whatIsTheRgName>/microsoft.sql/servers/<serverName>/databases/<dbName>
MattHartz commented 2 years ago

You know what, I just noticed that when you select a DB server outside of the specified resource group, it updates the desired resource group.

Thank you. Closing