Skip to content

Commit

Permalink
Merge pull request #110 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 committed May 5, 2024
2 parents e011c5d + 7b05928 commit 3c59d7d
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 3c59d7d

Please sign in to comment.