Bicep Templates

Jennifer 26 Reputation points
2022-11-30T09:22:59.253+00:00

Dear Azure Community,

I want to create different templates for different services in Azure (e.g. for Application Insights, Network Watcher, Azure Monitor, Sentinel, Security Center) to be able to monitor different metrics and logs. To do this, I first create the templates generated by Azure in their basic form. However, services like Azure Monitor or Application Insights have other child services like Alerts, Workbooks, Performance and so on. For each of these services, there is usually a separate template. Now I would like to know if you create the templates for each of these services separately in Azure, or if you can merge two templates (bicep templates) if they come from the same service (like Network Watcher)? As an example: Network Watcher has a template for connection monitor and a template for flow logs. In addition, there is also an existing template to create Network Watcher as a resource (which corresponds to the base template). Now if I want to include the templates from the Connection Monitor and Flow Logs in my base template, can I include them in my base template, or do all three templates need to be created and deployed separately (under the same resource group) in Visual Studio and then in the Azure portal?

I am very new in this field and need your advice please.

Thank you very much for your help!

Best regards
Jenny

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,782 questions
Azure Network Watcher
Azure Network Watcher
An Azure service that is used to monitor, diagnose, and gain insights into network performance and health.
156 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Cogan 10,082 Reputation points MVP
    2022-11-30T10:32:48.123+00:00

    The templates generated by the portal are usually quite verbose and will be separate by service etc. I generally would not recommend using them as is, but use them as a starting point for building your own templates. You can certainly deploy all your services from a single template, you do not need separate templates for each service. In most scenarios you can deploy everything from a single template. You can take what the portal generates and paste them into a single file, but as I mentioned you are likely going to want to try and adjust what the portal creates to remove duplication and verbosity.

    You may find that as you add more resources and do more complex things that you might want to break your deployment into multiple templates and have them call each other via the modules feature, but you do not have to.

    If you are looking for some training on getting started with Bicep you might be interested in the free course I created at bicepforreal.com

    0 comments No comments