0

I have 2 azure bicep files.

  1. Storage.bicep
  2. cdn.bicep

Now, I successfully created a storage account and BLOB container from storage.bicep. Is it possible to get the value of storage account properties from storage.bicep to use it in cdn.bicep ?

1 Answers1

0

Yes, you can reference Storage Account in cdn.bicep as existing resource if you pass Storage Account name in to it.

resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
  name: 'examplestorage'
}

output blobEndpoint string = stg.properties.primaryEndpoints.blob

Just make sure you declare cdn.bicep has dependency on Storage.bicep and is executed after it.

The example above is taken from documentation.