Skip to content

Commit

Permalink
Update main.bicep
Browse files Browse the repository at this point in the history
  • Loading branch information
rrichley authored Dec 30, 2024
1 parent ea0f2b7 commit e285853
Showing 1 changed file with 6 additions and 39 deletions.
45 changes: 6 additions & 39 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
param location string
param logAnalyticsWorkspaceName string
param storageAccountName string
param containerName string
param allowedIP string
param logAnalyticsWorkspaceName string

// Log Analytics Workspace
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
name: logAnalyticsWorkspaceName
location: location
properties: {
retentionInDays: 30
sku: {
name: 'PerGB2018'
}
}
properties: {}
}

// Storage Account
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: storageAccountName
location: location
Expand All @@ -26,74 +19,48 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
kind: 'StorageV2'
properties: {
networkAcls: {
bypass: 'AzureServices'
virtualNetworkRules: []
ipRules: [
{
value: allowedIP
action: 'Allow'
value: allowedIP
}
]
defaultAction: 'Deny'
}
}
}

// Blob Service
resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount
name: 'default'
}

// Blob Container
resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01' = {
parent: blobService
parent: storageAccount::default
name: containerName
properties: {
publicAccess: 'None'
}
}

// Diagnostic Settings for Storage Account
resource diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
name: 'EnableDiagnostics'
name: 'storage-diagnostics'
scope: storageAccount
properties: {
workspaceId: logAnalyticsWorkspace.id
logs: [
{
category: 'StorageRead'
enabled: true
retentionPolicy: {
enabled: false
days: 0
}
}
{
category: 'StorageWrite'
enabled: true
retentionPolicy: {
enabled: false
days: 0
}
}
{
category: 'StorageDelete'
enabled: true
retentionPolicy: {
enabled: false
days: 0
}
}
]
metrics: [
{
category: 'Transaction'
enabled: true
retentionPolicy: {
enabled: false
days: 0
}
}
]
}
Expand Down

0 comments on commit e285853

Please sign in to comment.