How can I include a template by URL? #8388
-
I have a bicep template and I would like to include an ARM template by URL. specifically this one: I tried just creating a module and putting the full URL as the module path but that results in an error. Is it expected that I download it and convert it into a bicep template, or is there actually a way to directly utilize such published templates? resource RecoverySearchResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'recovery-${envName}-search'
location: location
tags: {
branchName: branchName
gitCommit: gitCommit
env: env
}
}
module Search 'https://raw.githubusercontent.com/elastic/azure-marketplace/7.11.1/src/mainTemplate.json' = {
// error, https scheme unexpected
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not possible, the recommendation is to use curl/invoke-webrequestto download the template locally first, then reference this. If it's json then you can reference it as below. i.e. as a deployment. Other than that you can publish your templates to the container registry and reference them from there directly in Bicep. https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules#file-in-registry |
Beta Was this translation helpful? Give feedback.
This is not possible, the recommendation is to use curl/invoke-webrequestto download the template locally first, then reference this.
If it's json then you can reference it as below.
i.e. as a deployment.
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/x.RBAC-ALL-RA-Resource.bicep#L32
Other than that you can publish your templates to the container registry and reference them from there directly in Bicep.
https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules#file-in-registry