diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 39c1d9a..f1e2aef 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -44,6 +44,7 @@ "msazurermtools.azurerm-vscode-tools", "ms-azuretools.vscode-bicep", "ms-azure-devops.azure-pipelines", + "github.vscode-github-actions", "shuworks.vscode-table-formatter", "streetsidesoftware.code-spell-checker", "wmaurer.change-case", diff --git a/.github/workflows/repository.yml b/.github/workflows/analyse-psrule.yml similarity index 77% rename from .github/workflows/repository.yml rename to .github/workflows/analyse-psrule.yml index 24ab44a..a359887 100644 --- a/.github/workflows/repository.yml +++ b/.github/workflows/analyse-psrule.yml @@ -8,7 +8,7 @@ # For action details see: # https://aka.ms/ps-rule-action -name: Analyze repository +name: Analyze with PsRule # Run for main or PRs against main on: @@ -18,6 +18,7 @@ on: pull_request: branches: - main + workflow_dispatch: jobs: analyze: @@ -27,7 +28,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 + # Run analysis by using the PSRule GitHub action. - name: Run PSRule analysis - uses: Microsoft/ps-rule@v2.9.0 + uses: microsoft/ps-rule@v2.9.0 with: modules: PSRule.Rules.Azure diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4eef8c7..355276f 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,6 +8,7 @@ "msazurermtools.azurerm-vscode-tools", "ms-azuretools.vscode-bicep", "ms-azure-devops.azure-pipelines", + "github.vscode-github-actions", "shuworks.vscode-table-formatter", "streetsidesoftware.code-spell-checker", "wmaurer.change-case", diff --git a/modules/storage/v1/storage.bicep b/modules/storage/v1/storage.bicep index 1107d10..aa267c8 100644 --- a/modules/storage/v1/storage.bicep +++ b/modules/storage/v1/storage.bicep @@ -36,17 +36,30 @@ resource sa 'Microsoft.Storage/storageAccounts@2022-09-01' = { environment: 'Production' costCode: '123456' } - resource blobs 'blobServices@2022-09-01' = { - name: 'default' - properties: { - deleteRetentionPolicy: { - enabled: true - days: 7 - } - containerDeleteRetentionPolicy: { - enabled: true - days: 7 - } +} + +resource blobs 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = { + name: 'default' + parent: sa + properties: { + deleteRetentionPolicy: { + enabled: true + days: 7 + } + containerDeleteRetentionPolicy: { + enabled: true + days: 7 + } + } +} + +resource files 'Microsoft.Storage/storageAccounts/fileServices@2022-09-01' = { + name: 'default' + parent: sa + properties: { + shareDeleteRetentionPolicy: { + enabled: true + days: 7 } } } diff --git a/ps-rule.yaml b/ps-rule.yaml index 87e3b32..09a1c39 100644 --- a/ps-rule.yaml +++ b/ps-rule.yaml @@ -45,14 +45,14 @@ input: # Exclude bicepconfig.json - 'bicepconfig.json' - + # ignore all bicep files except the ones that have been created to test modules - 'modules/**/*.bicep' - '!modules/**/*.tests.bicep' rule: exclude: - - "Azure.Storage.UseReplication" + - Azure.Storage.UseReplication include: module: