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' = {
292
292
fdeName : afdEndpointName
293
293
afdSku : 'Premium_AzureFrontDoor'
294
294
apimName : apimName
295
+ logAnalyticsWorkspaceId : lawId
295
296
}
296
297
dependsOn : [
297
298
apimModule
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ param afdSku string = 'Premium_AzureFrontDoor'
27
27
@description ('The name of the API Management instance. Defaults to "apim-<resourceSuffix>".' )
28
28
param apimName string = 'apim-${resourceSuffix }'
29
29
30
+ @description ('Log Analytics Workspace ID for diagnostic settings (optional)' )
31
+ param logAnalyticsWorkspaceId string = ''
32
+
30
33
31
34
// ------------------------------
32
35
// RESOURCES
@@ -175,6 +178,35 @@ resource securityPolicy 'Microsoft.Cdn/profiles/securityPolicies@2025-04-15' = {
175
178
}
176
179
}
177
180
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
+
178
210
179
211
// ------------------------------
180
212
// OUTPUTS
You can’t perform that action at this time.
0 commit comments