File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
infrastructure/afd-apim-pe
shared/bicep/modules/afd/v1 Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ module afdModule '../../shared/bicep/modules/afd/v1/afd.bicep' = {
292292 fdeName : afdEndpointName
293293 afdSku : 'Premium_AzureFrontDoor'
294294 apimName : apimName
295+ logAnalyticsWorkspaceId : lawId
295296 }
296297 dependsOn : [
297298 apimModule
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ param afdSku string = 'Premium_AzureFrontDoor'
2727@description ('The name of the API Management instance. Defaults to "apim-<resourceSuffix>".' )
2828param apimName string = 'apim-${resourceSuffix }'
2929
30+ @description ('Log Analytics Workspace ID for diagnostic settings (optional)' )
31+ param logAnalyticsWorkspaceId string = ''
32+
3033
3134// ------------------------------
3235// RESOURCES
@@ -175,6 +178,35 @@ resource securityPolicy 'Microsoft.Cdn/profiles/securityPolicies@2025-04-15' = {
175178 }
176179}
177180
181+ // https://learn.microsoft.com/azure/templates/microsoft.insights/diagnosticsettings
182+ resource frontDoorDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (!empty (logAnalyticsWorkspaceId )) {
183+ name : 'afd-diagnostics'
184+ scope : frontDoorProfile
185+ properties : {
186+ workspaceId : logAnalyticsWorkspaceId
187+ logs : [
188+ {
189+ categoryGroup : 'allLogs'
190+ enabled : true
191+ retentionPolicy : {
192+ enabled : false
193+ days : 0
194+ }
195+ }
196+ ]
197+ metrics : [
198+ {
199+ category : 'AllMetrics'
200+ enabled : true
201+ retentionPolicy : {
202+ enabled : false
203+ days : 0
204+ }
205+ }
206+ ]
207+ }
208+ }
209+
178210
179211// ------------------------------
180212// OUTPUTS
You can’t perform that action at this time.
0 commit comments