I am more familiar with Terraform, where I can do something like:
module "storagemod" {
source = "git::https://[email protected]/MyProj/Dataplatform/_git/myrepo//storage-account?ref=v0.2.0"
rg_name = "MyRG"
resource_name = "mynewdatalake"
.
.
.
}
where the source referenced above is a different repository of Terraform modules that I am referencing to create resources.
The repository is a private Azure repository (on Azure DevOps) that I am able to access because I have already established git credentials in a previous step of the pipeline:
steps:
- task: PowerShell@2
inputs:
targetType: inline
script: 'git config --global http.extraheader "AUTHORIZATION: bearer ${Env:SYSTEM_ACCESSTOKEN}"'
displayName: 'Setting Git Authentication header'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
How could I do something similar using Azure Bicep? We are trying to move over to Bicep.
I can do the same authentication of the Git headers, of course, but how can I handle the module?
If it were local on the same repo, I could do:
module storagemod './storage/datalake.bicep' = {
name: 'createDataLakeAndContainers'
params: {
.
.
.
}
}
Can I do something like this?
module storagemod 'git::https://[email protected]/MyProj/Dataplatform/_git/myrepo//storage-account?ref=v0.2.0' = {
name: 'createDataLakeAndContainers'
params: {
.
.
.
}
}
I couldn't get that to work, but I was hoping that the capability is there and I just had the syntax wrong. I could not find any documentation on it.
This is not possible in Bicep (yet).
There are two open issues in bicep's github that addresses this issue:
For now only way is to use either git submodules or maintain "remote" bicep files using some custom solutions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With