You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use resources created outside of my bicep template - for example, using a database server or API Management instance, but allowing my bicep template to create the database or API. To do this, I want to pass the ID of the resource as a parameter and then decode it to get the reference to the resource.
targetScope = 'resourceGroup'
@description('ID of the database service')
paramdatabaseServiceIdstringresourcedatabaseService'Microsoft.Network/sqlServers@2022-08-01'existing = {
name: reference(databaseServiceId).namescope: reference(databaseServiceId).resourceGroup
}
Obviously, the reference function exists, but the resourceGroup, etc. don't.
What's the best way to get a reference to a resource based on the ID, so that it can be used for resource creation in the rest of the bicep script?
The text was updated successfully, but these errors were encountered:
I want to use resources created outside of my bicep template - for example, using a database server or API Management instance, but allowing my bicep template to create the database or API. To do this, I want to pass the ID of the resource as a parameter and then decode it to get the reference to the resource.
Obviously, the reference function exists, but the resourceGroup, etc. don't.
What's the best way to get a reference to a resource based on the ID, so that it can be used for resource creation in the rest of the bicep script?
The text was updated successfully, but these errors were encountered: