Skip to content

Commit c31bbc4

Browse files
AjitPadhi-MicrosoftCopilot
andcommitted
Dev pipeline issue fix
Co-authored-by: Copilot <copilot@github.com>
1 parent d4c58c8 commit c31bbc4

18 files changed

Lines changed: 233 additions & 286 deletions

File tree

extensions/teams/infra/azure.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ resource webApp 'Microsoft.Web/sites@2024-04-01' = {
5252
httpsOnly: true
5353
siteConfig: {
5454
alwaysOn: true
55-
minTlsVersion: '1.2'
55+
minTlsVersion: '1.3'
5656
appSettings: [
5757
{
5858
name: 'WEBSITE_RUN_FROM_PACKAGE'

infra/main.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ module keyvault './modules/key-vault/vault/vault.bicep' = {
857857
enableVaultForDeployment: true
858858
enableVaultForDiskEncryption: true
859859
enableVaultForTemplateDeployment: true
860-
enableRbacAuthorization: true
861860
enableSoftDelete: true
862861
softDeleteRetentionInDays: 7
863862
diagnosticSettings: enableMonitoring ? [{ workspaceResourceId: monitoring!.outputs.logAnalyticsWorkspaceId }] : null

infra/main.json

Lines changed: 115 additions & 148 deletions
Large diffs are not rendered by default.

infra/modules/app/adminweb.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var siteConfig = {
8383
cors: {
8484
allowedOrigins: allowedOrigins
8585
}
86-
minTlsVersion: '1.2'
86+
minTlsVersion: '1.3'
8787
}
8888

8989
// Build the configs array expected by the child module (appsettings config)

infra/modules/app/eventgrid.bicep

Lines changed: 73 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -30,63 +30,84 @@ param logAnalyticsWorkspaceResourceId string = ''
3030
@description('Enable/Disable usage telemetry for module.')
3131
param enableTelemetry bool = true
3232

33-
module avmEventGridSystemTopic 'br/public:avm/res/event-grid/system-topic:0.6.4' = {
34-
name: take('avm.res.event-grid.system-topic.${name}', 64)
35-
params: {
36-
name: name
33+
var userAssignedIdentities = {
34+
'${userAssignedResourceId}': {}
35+
}
36+
37+
#disable-next-line no-deployments-resources
38+
resource telemetry 'Microsoft.Resources/deployments@2025-04-01' = if (enableTelemetry) {
39+
name: 'eventgrid.${substring(uniqueString(deployment().name, location), 0, 6)}'
40+
properties: {
41+
mode: 'Incremental'
42+
template: {
43+
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
44+
contentVersion: '1.0.0.0'
45+
resources: []
46+
}
47+
}
48+
}
49+
50+
resource systemTopic 'Microsoft.EventGrid/systemTopics@2025-02-15' = {
51+
name: name
52+
location: location
53+
tags: tags
54+
identity: {
55+
type: 'UserAssigned'
56+
userAssignedIdentities: userAssignedIdentities
57+
}
58+
properties: {
3759
source: storageAccountId
3860
topicType: 'Microsoft.Storage.StorageAccounts'
39-
location: location
40-
diagnosticSettings: enableMonitoring
41-
? [
42-
{
43-
name: 'diagnosticSettings'
44-
workspaceResourceId: logAnalyticsWorkspaceResourceId
45-
metricCategories: [
46-
{
47-
category: 'AllMetrics'
48-
}
49-
]
50-
}
51-
]
52-
: []
53-
eventSubscriptions: [
54-
{
55-
name: name
56-
deliveryWithResourceIdentity: {
57-
identity: {
58-
type: 'UserAssigned'
59-
userAssignedIdentity: userAssignedResourceId
60-
}
61-
destination: {
62-
endpointType: 'StorageQueue'
63-
properties: {
64-
queueName: queueName
65-
resourceId: storageAccountId
66-
}
67-
}
68-
}
69-
eventDeliverySchema: 'EventGridSchema'
70-
filter: {
71-
includedEventTypes: [
72-
'Microsoft.Storage.BlobCreated'
73-
'Microsoft.Storage.BlobDeleted'
74-
]
75-
enableAdvancedFilteringOnArrays: true
76-
subjectBeginsWith: '/blobServices/default/containers/${blobContainerName}/blobs/'
77-
}
78-
retryPolicy: {
79-
maxDeliveryAttempts: 30
80-
eventTimeToLiveInMinutes: 1440
61+
}
62+
}
63+
64+
resource eventSubscription 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2025-02-15' = {
65+
parent: systemTopic
66+
name: name
67+
properties: {
68+
deliveryWithResourceIdentity: {
69+
identity: {
70+
type: 'UserAssigned'
71+
userAssignedIdentity: userAssignedResourceId
72+
}
73+
destination: {
74+
endpointType: 'StorageQueue'
75+
properties: {
76+
queueName: queueName
77+
resourceId: storageAccountId
8178
}
82-
expirationTimeUtc: empty(expirationTimeUtc) ? null : expirationTimeUtc
79+
}
80+
}
81+
eventDeliverySchema: 'EventGridSchema'
82+
filter: {
83+
includedEventTypes: [
84+
'Microsoft.Storage.BlobCreated'
85+
'Microsoft.Storage.BlobDeleted'
86+
]
87+
enableAdvancedFilteringOnArrays: true
88+
subjectBeginsWith: '/blobServices/default/containers/${blobContainerName}/blobs/'
89+
}
90+
retryPolicy: {
91+
maxDeliveryAttempts: 30
92+
eventTimeToLiveInMinutes: 1440
93+
}
94+
expirationTimeUtc: empty(expirationTimeUtc) ? null : expirationTimeUtc
95+
}
96+
}
97+
98+
#disable-next-line use-recent-api-versions
99+
resource systemTopic_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = if (enableMonitoring && !empty(logAnalyticsWorkspaceResourceId)) {
100+
name: 'diagnosticSettings'
101+
properties: {
102+
workspaceId: logAnalyticsWorkspaceResourceId
103+
metrics: [
104+
{
105+
category: 'AllMetrics'
106+
enabled: true
83107
}
84108
]
85-
// Use only user-assigned identity
86-
managedIdentities: { systemAssigned: false, userAssignedResourceIds: [userAssignedResourceId] }
87-
tags: tags
88-
enableTelemetry: enableTelemetry
89109
}
110+
scope: systemTopic
90111
}
91112

92-
output name string = avmEventGridSystemTopic.outputs.name
113+
output name string = systemTopic.name

infra/modules/app/web.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var siteConfig = {
8585
cors: {
8686
allowedOrigins: allowedOrigins
8787
}
88-
minTlsVersion: '1.2'
88+
minTlsVersion: '1.3'
8989
}
9090

9191
// Build the configs array expected by the child module (appsettings config)

infra/modules/core/host/appservice.bicep

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ param serverFarmResourceId string
2828
param managedEnvironmentId string?
2929

3030
@description('Optional. Configures a site to accept only HTTPS requests. Issues redirect for HTTP requests.')
31+
@allowed([
32+
true
33+
])
3134
param httpsOnly bool = true
3235

3336
@description('Optional. If client affinity is enabled.')
@@ -63,10 +66,10 @@ param vnetRouteAllEnabled bool = false
6366
@description('Optional. Stop SCM (KUDU) site when the app is stopped.')
6467
param scmSiteAlsoStopped bool = false
6568

66-
@description('Optional. The site config object. The defaults are set to the following values: alwaysOn: true, minTlsVersion: \'1.2\', ftpsState: \'FtpsOnly\'.')
69+
@description('Optional. The site config object. The defaults are set to the following values: alwaysOn: true, minTlsVersion: \'1.3\', ftpsState: \'FtpsOnly\'.')
6770
param siteConfig object = {
6871
alwaysOn: true
69-
minTlsVersion: '1.2'
72+
minTlsVersion: '1.3'
7073
ftpsState: 'FtpsOnly'
7174
}
7275

@@ -171,6 +174,12 @@ var identity = !empty(managedIdentities)
171174
}
172175
: null
173176

177+
// Enforce security-critical web settings regardless of caller-provided siteConfig.
178+
var enforcedSiteConfig = union(siteConfig, {
179+
ftpsState: 'FtpsOnly'
180+
minTlsVersion: '1.3'
181+
})
182+
174183
resource app 'Microsoft.Web/sites@2024-04-01' = {
175184
name: name
176185
location: location
@@ -190,7 +199,7 @@ resource app 'Microsoft.Web/sites@2024-04-01' = {
190199
storageAccountRequired: storageAccountRequired
191200
keyVaultReferenceIdentity: keyVaultAccessIdentityResourceId
192201
virtualNetworkSubnetId: virtualNetworkSubnetId
193-
siteConfig: siteConfig
202+
siteConfig: enforcedSiteConfig
194203
functionAppConfig: functionAppConfig
195204
clientCertEnabled: clientCertEnabled
196205
clientCertExclusionPaths: clientCertExclusionPaths

infra/modules/core/host/functions.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module functions 'appservice.bicep' = {
182182
allowedOrigins: allowedOrigins
183183
}
184184
healthCheckPath: healthCheckPath
185-
minTlsVersion: '1.2'
185+
minTlsVersion: '1.3'
186186
ftpsState: 'FtpsOnly'
187187
}
188188
serverFarmResourceId: serverFarmResourceId

infra/modules/core/host/web-sites.config.bicep

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,9 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2024-01-01' existing
7979
scope: resourceGroup(split(storageAccountResourceId!, '/')[2], split(storageAccountResourceId!, '/')[4])
8080
}
8181

82-
resource app 'Microsoft.Web/sites@2024-04-01' existing = {
83-
name: appName
84-
}
85-
8682
resource config 'Microsoft.Web/sites/config@2024-04-01' = {
87-
parent: app
83+
name: '${appName}/${name}'
8884
#disable-next-line BCP225
89-
name: name
9085
properties: expandedProperties
9186
}
9287

infra/modules/document-db/database-account/sql-database/container/container.bicep

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,14 @@ var containerResourceParams = union(
7878
: {}
7979
)
8080

81-
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2025-10-15' existing = {
82-
name: databaseAccountName
83-
84-
resource sqlDatabase 'sqlDatabases@2024-11-15' existing = {
85-
name: sqlDatabaseName
86-
}
87-
}
81+
var databaseAccountResourceId = resourceId('Microsoft.DocumentDB/databaseAccounts', databaseAccountName)
8882

8983
resource container 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2025-10-15' = {
90-
name: name
91-
parent: databaseAccount::sqlDatabase
92-
tags: tags
84+
name: '${databaseAccountName}/${sqlDatabaseName}/${name}'
85+
tags: tags ?? {}
9386
properties: {
9487
resource: containerResourceParams
95-
options: contains(databaseAccount.properties.capabilities, { name: 'EnableServerless' })
88+
options: contains(reference(databaseAccountResourceId, '2025-10-15', 'Full').properties.capabilities, { name: 'EnableServerless' })
9689
? null
9790
: {
9891
throughput: autoscaleSettingsMaxThroughput == null && throughput != -1 ? throughput : null

0 commit comments

Comments
 (0)