Skip to content

Commit

Permalink
Merge pull request #22 from Azure-Samples/appdiag_meta
Browse files Browse the repository at this point in the history
Add app diagnostics and disable metadata write
  • Loading branch information
tonybaloney authored May 5, 2024
2 parents 1c554d1 + f8a48d5 commit f610d9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Azure-Samples/Azure-Python-Standardization-Template-Generator",
"commit": "397605f4143cc348247197e9b1c30729a94b828f",
"commit": "f9a5fdc99895df6e7f4844a19cb000ec8eb23bca",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
1 change: 1 addition & 0 deletions infra/core/database/cosmos/cosmos-account.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' = {
enableMultipleWriteLocations: false
apiProperties: (kind == 'MongoDB') ? { serverVersion: '4.2' } : {}
capabilities: [ { name: 'EnableServerless' } ]
disableKeyBasedMetadataWriteAccess: true // See PsRule AZR-000095
}
}

Expand Down
6 changes: 6 additions & 0 deletions infra/core/host/appservice.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ param runtimeName string
param runtimeNameAndVersion string = '${runtimeName}|${runtimeVersion}'
param runtimeVersion string

param enableDiagnosticLogging bool = true

// Microsoft.Web/sites Properties
param kind string = 'app,linux'

Expand Down Expand Up @@ -58,6 +60,10 @@ resource appService 'Microsoft.Web/sites@2022-03-01' = {
cors: {
allowedOrigins: union([ 'https://portal.azure.com', 'https://ms.portal.azure.com' ], allowedOrigins)
}
// Diagnostic logging
detailedErrorLoggingEnabled: enableDiagnosticLogging
httpLoggingEnabled: enableDiagnosticLogging
requestTracingEnabled: enableDiagnosticLogging
}
clientAffinityEnabled: clientAffinityEnabled
httpsOnly: true
Expand Down

0 comments on commit f610d9c

Please sign in to comment.