Skip to content

Commit

Permalink
fix: Small fix for both the post-removal logic & secret-passthru with…
Browse files Browse the repository at this point in the history
… PSRule (Azure#3149)

## Description

- Fixed the post-deployment loop referencing incorrect variables
- Enabled PSRule to work with secrets pass-thru parameters it must be
able to expand

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.compute.virtual-machine](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=users%2Falsehr%2FciRemovalAndPSRuleFix&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation
  • Loading branch information
AlexanderSehr authored Sep 3, 2024
1 parent 9a2433d commit 30a2e47
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The object id of the Backup Management Service Enterprise Application. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-BackupManagementServiceEnterpriseApplicationObjectId\'.')
@secure()
param backupManagementServiceEnterpriseApplicationObjectId string
param backupManagementServiceEnterpriseApplicationObjectId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The object id of the Backup Management Service Enterprise Application. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-BackupManagementServiceEnterpriseApplicationObjectId\'.')
@secure()
param backupManagementServiceEnterpriseApplicationObjectId string
param backupManagementServiceEnterpriseApplicationObjectId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The object id of the Backup Management Service Enterprise Application. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-BackupManagementServiceEnterpriseApplicationObjectId\'.')
@secure()
param backupManagementServiceEnterpriseApplicationObjectId string
param backupManagementServiceEnterpriseApplicationObjectId string = ''

// ============ //
// Dependencies //
Expand Down
2 changes: 1 addition & 1 deletion avm/res/databricks/workspace/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The object id of the AzureDatabricks Enterprise Application. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDatabricksEnterpriseApplicationObjectId\'.')
@secure()
param azureDatabricksEnterpriseApplicationObjectId string
param azureDatabricksEnterpriseApplicationObjectId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The object id of the AzureDatabricks Enterprise Application. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-AzureDatabricksEnterpriseApplicationObjectId\'.')
@secure()
param azureDatabricksEnterpriseApplicationObjectId string
param azureDatabricksEnterpriseApplicationObjectId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The tenant Id of the lighthouse tenant. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-LighthouseManagedByTenantId\'.')
@secure()
param lighthouseManagedByTenantId string
param lighthouseManagedByTenantId string = ''

// ============== //
// Test Execution //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The tenant Id of the lighthouse tenant. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-LighthouseManagedByTenantId\'.')
@secure()
param lighthouseManagedByTenantId string
param lighthouseManagedByTenantId string = ''

// ============== //
// Test Execution //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The tenant Id of the lighthouse tenant. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-LighthouseManagedByTenantId\'.')
@secure()
param lighthouseManagedByTenantId string
param lighthouseManagedByTenantId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ param namePrefix string = '#_namePrefix_#'

@description('Required. The tenant Id of the lighthouse tenant. This value is tenant-specific and must be stored in the CI Key Vault in a secret named \'CI-LighthouseManagedByTenantId\'.')
@secure()
param lighthouseManagedByTenantId string
param lighthouseManagedByTenantId string = ''

// ============ //
// Dependencies //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Invoke-ResourcePostRemoval {
[int] $PostRemovalRetryLimit = 3
)

$postRemovalRetryCount = 1
$removalRetryCount = 1
do {
try {
switch ($Type) {
Expand Down Expand Up @@ -191,5 +191,5 @@ function Invoke-ResourcePostRemoval {
Write-Warning ('[!] Post-removal operation failed. Reason: [{0}]. Retry [{1}/{2}]' -f $_.Exception.Message, $removalRetryCount, $PostRemovalRetryLimit)
$removalRetryCount++
}
} while ($postRemovalRetryCount -le $PostRemovalRetryLimit)
} while ($removalRetryCount -le $PostRemovalRetryLimit)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ binding:
# Require minimum versions of modules.
requires:
PSRule: "@pre >=2.9.0"
PSRule.Rules.Azure: "@pre >=1.29.0"
PSRule.Rules.Azure: "@pre >=1.38.0"

# Use PSRule for Azure.
include:
Expand Down

0 comments on commit 30a2e47

Please sign in to comment.