// EasyLife 365 setup template. Use case: audit/audit-workspace (the audit log). Version: v1. // Source: https://docs.easylife365.cloud/downloads/audit/audit-workspace/v1/template.bicep // template.json next to it is built from this file with `az bicep build`. // // Creates a Log Analytics workspace in the resource group you deploy to. It gives no access: run grant.ps1 or grant.sh // afterwards, once for each EasyLife 365 product that reads the workspace, which assigns "Log Analytics Reader" to that // product's app on the workspace. // // Use it for a new workspace. Deploying it over an existing workspace sets its pricing tier and retention back to the // ones below; for an existing workspace, run the grant script only. metadata description = 'EasyLife 365, audit/audit-workspace v1: a Log Analytics workspace for the audit log. Give access with the grant script afterwards, once per EasyLife 365 product.' @description('The workspace: 4 to 63 letters, digits and hyphens, starting and ending with a letter or digit.') @minLength(4) @maxLength(63) param workspaceName string @description('The Azure region of the workspace. Default: the region of the resource group.') param region string = resourceGroup().location // Pay-as-you-go pricing, data kept 30 days. resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' = { name: workspaceName location: region properties: { sku: { name: 'PerGB2018' } retentionInDays: 30 } } output workspaceResourceId string = workspace.id