Lookup of pre-existing resources #6200
-
Hi all, Is there a means using Bicep to get details of pre-existing resources within a resource group where the resource name is unknown? So, I'd like to look in a resource group called "bob" to find the storage accounts which are in that group "resource.... existing" seems to rely on the name being provided. Our use-case is that we're provisioning key vault and storage accounts within a consumer's subscription, with those resources in a known resource group name. We're giving the consumers modules they can use to deploy further resources and would like to include in those modules the ability to lookup these resources so that they can be used latterly. Appreciate that the resource names can be queried in a pipeline and passed to Bicep, although the ability to undertake that search/lookup within Bicep would be cleaner in our circumstance. Thanks, Matt |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I cannot think if anyway to do this practically with Bicep. I would recommend looking to az powershell or az cli for this task. Perhaps create a parameter file that could then be passed onto a Bicep deployment/template. |
Beta Was this translation helpful? Give feedback.
I cannot think if anyway to do this practically with Bicep.
I would recommend looking to az powershell or az cli for this task. Perhaps create a parameter file that could then be passed onto a Bicep deployment/template.