Bicep template challenges for azure storage and function

AmiteshAseem-2336 1 Reputation point
2022-10-07T10:32:22.43+00:00

I have a repository (repo A) using which I publish bicep files (Storage Account, App Insights) to ACR. Among this I also have function app bicep which initially just had function app resource.

I had another repository (repo B) which had to deploy an azure function, so I called storage account, app insights, hosting plan and function app bicep from ACR which was deployed/published using repo A as individual modules in B. To improve efficiency, I thought of having the function app bicep in repo A call the dependent resources as modules in itself so that from repo B I need to call only one module function app.

I have been unable to achieve this. It is able to access output variable from other bicep like app insight but not from storage so I am unable to add the connection string as an app setting. If I refer local file it is able to recognize output variable from storage. But still deployment fails stating that storage account was not found under the resources group but works on the second run. In the function app bicep I do have a storage look up which was allowing me to do list keys for app setting value and to remove this look up was why I did the output variable.

I am not sure what is the best way to achieve this or should I be calling all dependent services as individual modules rather than merging all in function app bicep to call just one module.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,678 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,944 questions
{count} votes