Skip to content

Commit 23c9be5

Browse files
committed
Merge branch 'feature/avm' of https://github.com/microsoft/content-processing-solution-accelerator into feature/avm
2 parents 4a320dc + ab82043 commit 23c9be5

3 files changed

Lines changed: 58 additions & 44 deletions

File tree

infra/main.bicep

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -153,37 +153,41 @@ module avmKeyVault_RoleAssignment_appConfig 'br/public:avm/ptn/authorization/res
153153
}
154154

155155
// ========== Application insights ========== //
156-
module avmLogAnalyticsWorkspace 'br/public:avm/res/operational-insights/workspace:0.11.2' = {
157-
name: format(
158-
deployment_param.resource_name_format_string,
159-
deployment_param.naming_abbrs.managementGovernance.logAnalyticsWorkspace
160-
)
156+
module avmAppInsightsLogAnalyticsWorkspace './modules/app-insights.bicep' = {
157+
//name: format(deployment_param.resource_name_format_string, abbrs.managementGovernance.logAnalyticsWorkspace)
161158
params: {
162-
name: '${deployment_param.naming_abbrs.managementGovernance.logAnalyticsWorkspace}${deployment_param.solution_prefix}'
163-
location: deployment_param.resource_group_location
164-
diagnosticSettings: [{ useThisWorkspace: true }]
165-
enableTelemetry: deployment_param.enable_telemetry
166-
skuName: 'PerGB2018'
167-
dataRetention: 30
159+
appInsights_param: {
160+
appInsightsName: '${deployment_param.naming_abbrs.managementGovernance.applicationInsights}${deployment_param.solution_prefix}'
161+
location: deployment_param.resource_group_location
162+
//diagnosticSettings: [{ useThisWorkspace: true }]
163+
skuName: 'PerGB2018'
164+
applicationType: 'web'
165+
disableIpMasking: false
166+
disableLocalAuth: false
167+
flowType: 'Bluefield'
168+
kind: 'web'
169+
logAnalyticsWorkspaceName: '${deployment_param.naming_abbrs.managementGovernance.logAnalyticsWorkspace}${deployment_param.solution_prefix}'
170+
publicNetworkAccessForQuery: 'Enabled'
171+
requestSource: 'rest'
172+
retentionInDays: 30
173+
}
174+
deployment_param: deployment_param
168175
}
169176
}
170177

171-
module avmApplicationInsights 'br/public:avm/res/insights/component:0.6.0' = {
172-
name: format(
173-
deployment_param.resource_name_format_string,
174-
deployment_param.naming_abbrs.managementGovernance.applicationInsights
175-
)
176-
params: {
177-
name: '${deployment_param.naming_abbrs.managementGovernance.applicationInsights}${deployment_param.solution_prefix}'
178-
location: deployment_param.resource_group_location
179-
workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
180-
retentionInDays: 30
181-
kind: 'web'
182-
disableIpMasking: false
183-
flowType: 'Bluefield'
184-
diagnosticSettings: [{ workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId }]
185-
}
186-
}
178+
// module avmApplicationInsights 'br/public:avm/res/insights/component:0.6.0' = {
179+
// name: format(deployment_param.resource_name_format_string, abbrs.managementGovernance.applicationInsights)
180+
// params: {
181+
// name: '${abbrs.managementGovernance.applicationInsights}${deployment_param.solution_prefix}'
182+
// location: deployment_param.resource_group_location
183+
// workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
184+
// retentionInDays: 30
185+
// kind: 'web'
186+
// disableIpMasking: false
187+
// flowType: 'Bluefield'
188+
// diagnosticSettings: [{ workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId }]
189+
// }
190+
// }
187191

188192
// ========== Container Registry ========== //
189193
module avmContainerRegistry 'modules/container-registry.bicep' = {
@@ -365,7 +369,8 @@ module avmAiServices_storage_hub 'br/public:avm/res/storage/storage-account:0.20
365369
allowSharedKeyAccess: false
366370
diagnosticSettings: [
367371
{
368-
workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
372+
//workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
373+
workspaceResourceId: avmAppInsightsLogAnalyticsWorkspace.outputs.logAnalyticsWorkspaceResourceId
369374
}
370375
]
371376
blobServices: {
@@ -374,7 +379,8 @@ module avmAiServices_storage_hub 'br/public:avm/res/storage/storage-account:0.20
374379
containerDeleteRetentionPoloicyEnabled: false
375380
diagnosticSettings: [
376381
{
377-
workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
382+
//workspaceResourceId: avmLogAnalyticsWorkspace.outputs.resourceId
383+
workspaceResourceId: avmAppInsightsLogAnalyticsWorkspace.outputs.logAnalyticsWorkspaceResourceId
378384
}
379385
]
380386
}
@@ -406,7 +412,7 @@ module avmAiHub 'br/public:avm/res/machine-learning-services/workspace:0.12.1' =
406412
associatedKeyVaultResourceId: avmKeyVault.outputs.resourceId
407413
associatedStorageAccountResourceId: avmAiServices_storage_hub.outputs.resourceId
408414
associatedContainerRegistryResourceId: avmContainerRegistry.outputs.resourceId
409-
associatedApplicationInsightsResourceId: avmApplicationInsights.outputs.resourceId
415+
associatedApplicationInsightsResourceId: avmAppInsightsLogAnalyticsWorkspace.outputs.applicationInsightsId
410416

411417
kind: 'Hub'
412418
connections: [
@@ -459,8 +465,8 @@ module avmContainerAppEnv 'br/public:avm/res/app/managed-environment:0.11.1' = {
459465
appLogsConfiguration: {
460466
destination: 'log-analytics'
461467
logAnalyticsConfiguration: {
462-
customerId: avmLogAnalyticsWorkspace.outputs.logAnalyticsWorkspaceId
463-
sharedKey: avmLogAnalyticsWorkspace.outputs.primarySharedKey
468+
customerId: avmAppInsightsLogAnalyticsWorkspace.outputs.logAnalyticsWorkspaceId
469+
sharedKey: avmAppInsightsLogAnalyticsWorkspace.outputs.logAnalyticsWorkspacePrimaryKey
464470
}
465471
}
466472
zoneRedundant: false

infra/modules/app-insights.bicep

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module avmLogAnalyticsWorkspace 'br/public:avm/res/operational-insights/workspac
2626
location: appInsights_param.location
2727
skuName: appInsights_param.skuName
2828
dataRetention: appInsights_param.retentionInDays
29+
diagnosticSettings: [ { useThisWorkspace: true }] //TODO: Add as a parameter
2930
// features: {
3031
// searchVersion: appInsights_param.features.searchVersion
3132
// }
@@ -43,16 +44,19 @@ module avmApplicationInsights 'br/public:avm/res/insights/component:0.6.0' = {
4344
disableIpMasking: appInsights_param.disableIpMasking
4445
disableLocalAuth: appInsights_param.disableLocalAuth
4546
flowType: appInsights_param.flowType
46-
forceCustomerStorageForProfiler: appInsights_param.forceCustomerStorageForProfiler
47+
//forceCustomerStorageForProfiler: appInsights_param.forceCustomerStorageForProfiler
4748
//immediatePurgeDataOn30Days: false
4849
//IngestionMode: 'LogAnalytics'
49-
publicNetworkAccessForIngestion: appInsights_param.publicNetworkAccessForIngestion
50+
//publicNetworkAccessForIngestion: appInsights_param.publicNetworkAccessForIngestion
5051
publicNetworkAccessForQuery: appInsights_param.publicNetworkAccessForQuery
5152
requestSource: appInsights_param.requestSource
5253

5354
}
5455
}
5556

5657
output applicationInsightsId string = avmApplicationInsights.outputs.resourceId
57-
output logAnalyticsWorkspaceId string = avmLogAnalyticsWorkspace.outputs.resourceId
58+
output logAnalyticsWorkspaceId string = avmLogAnalyticsWorkspace.outputs.logAnalyticsWorkspaceId
59+
output logAnalyticsWorkspaceResourceId string = avmLogAnalyticsWorkspace.outputs.resourceId
5860
output logAnalyticsWorkspaceName string = avmLogAnalyticsWorkspace.outputs.name
61+
@secure()
62+
output logAnalyticsWorkspacePrimaryKey string = avmLogAnalyticsWorkspace.outputs.primarySharedKey

infra/modules/types.bicep

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ type app_insights_param_type = {
139139
applicationType: app_insights_applicationType
140140
@description('Disable local authentication for the Application Insights resource')
141141
disableLocalAuth: bool
142-
@description('Force customer storage for profiler in Application Insights resource')
143-
forceCustomerStorageForProfiler: bool
144-
@description('Public network access for ingestion in Application Insights resource')
145-
publicNetworkAccessForIngestion: 'Enabled' | 'Disabled'
142+
// @description('Force customer storage for profiler in Application Insights resource')
143+
// forceCustomerStorageForProfiler: bool
144+
// @description('Public network access for ingestion in Application Insights resource')
145+
// publicNetworkAccessForIngestion: 'Enabled' | 'Disabled'
146146
@description('Public network access for query in Application Insights resource')
147147
publicNetworkAccessForQuery: 'Enabled' | 'Disabled'
148148
@description('Request source for the Application Insights resource')
@@ -152,11 +152,15 @@ type app_insights_param_type = {
152152
logAnalyticsWorkspaceName: string
153153
@description('SKU name for the Log Analytics Workspace resource')
154154
skuName: app_insights_sku_name
155-
@description('This is the features properties for Log Analytics Workspace resource')
156-
features: {
157-
@description('Search version for the Log Analytics Workspace resource')
158-
searchVersion: 1
159-
}
155+
// @description('This is the features properties for Log Analytics Workspace resource') --DEFAULT to 1
156+
// features: {
157+
// @description('Search version for the Log Analytics Workspace resource')
158+
// searchVersion: 1
159+
// }
160+
// diagnosticSettings: {
161+
// @description('Enable diagnostic settings for the Application Insights resource')
162+
// enableDiagnosticSettings: bool
163+
// }
160164
}
161165

162166
type container_registry_sku_type = 'Basic' | 'Standard' | 'Premium'

0 commit comments

Comments
 (0)