Skip to content

Commit

Permalink
set the defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
miekki committed Jan 24, 2024
1 parent e4129cf commit f01ce0a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 44 deletions.
23 changes: 17 additions & 6 deletions modules/storage/storage-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,27 @@ Default is Hot.
])
param accessTier string = 'Hot'

@description('Allow or disallow public access to all blobs or containers in the storage account.')
@description('Optional. Allow or disallow public access to all blobs or containers in the storage account.')
param allowBlobPublicAccess bool = false

@description('Required. Properties object for a Blob service of a Storage Account.')
param blobServiceProperties blobServicePropertiesType = {}
@description('Optional. Properties object for a Blob service of a Storage Account.')
param blobServiceProperties blobServicePropertiesType = {
containerDeleteRetentionPolicy: {
allowPermanentDelete: false
days: 90
enabled: true
}
deleteRetentionPolicy: {
allowPermanentDelete: false
days: 90
enabled: true
}
}

@description('Optional. Array of blob containers to be created for blobServices of Storage Account.')
param blobContainers blobContainerType[] = []

@description('Configuration for network access rules.')
@description('Optional. Configuration for network access rules.')
param networkAcls networkAclsType = {
defaultAction: 'Deny'
}
Expand Down Expand Up @@ -126,12 +137,12 @@ type changeFeed = {

type deleteRetentionPolicyType = {
@description('This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.')
allowPermanentDelete: false
allowPermanentDelete: bool
@minValue(1)
@maxValue(365)
@description('Indicates the number of days that the deleted item should be retained.')
days: int
enabled: true
enabled: bool
}

@description('Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service.')
Expand Down
41 changes: 3 additions & 38 deletions modules/storage/storage-account/test/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,25 @@ var my_tags = {
env: 'dev'
}

// TEST 1
// TEST 1 - minimum parameters
module test1 '../main.bicep' = {
name: 'test1'
params: {
location: location
name: names.test1.storage
tags: my_tags
sku: 'Standard_GRS'

blobServiceProperties: {
containerDeleteRetentionPolicy: {
allowPermanentDelete: false
enabled: true
days: 90
}
deleteRetentionPolicy: {
allowPermanentDelete: false
enabled: true
days: 90
}
}
}
}

// TEST 2
// TEST 2 - storage with blobs
module test2 '../main.bicep' = {
name: 'test2'
params: {
location: location
name: names.test2.storage
tags: my_tags
allowBlobPublicAccess: false
networkAcls: {
defaultAction: 'Deny'
}
blobServiceProperties: {
containerDeleteRetentionPolicy: {
allowPermanentDelete: false
enabled: true
days: 90
}
isVersioningEnabled: true
changeFeed: {
enabled: true
}
lastAccessTimeTrackingPolicy: {
enable: true
}
deleteRetentionPolicy: {
allowPermanentDelete: false
enabled: true
days: 90
}
}

blobContainers: [
{
name: names.test2.containers[0]
Expand Down

0 comments on commit f01ce0a

Please sign in to comment.