Skip to content

Latest commit

 

History

History
152 lines (111 loc) · 3.59 KB

Invoke-AvmTestCleanup.md

File metadata and controls

152 lines (111 loc) · 3.59 KB

Invoke-AvmTestCleanup

Synopsis

Resume Bicep test cleanup from its saved JSON state.

Description

Retries unfinished deployment-owned cleanup using an existing Azure PowerShell and Azure CLI sign-in. The supplied subscription and tenant must match the saved state. Unknown deployment outcomes are checked before removal; active or unverified deployments retain their resources. The file remains available after success or failure. A downloaded Actions artifact can be used in the same way as a locally saved file. This command does not log in, install modules, or execute test hooks.

CLI commands

  • avm test cleanup

Syntax

Invoke-AvmTestCleanup [-StatePath] <string> -SubscriptionId <guid> -TenantId <guid> [-SearchRetryLimit <int>] [-SearchRetryInterval <int>] [-RemovalRetryLimit <int>] [-RemovalRetryInterval <int>] [-SkipModuleVersionCheck] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

-RemovalRetryInterval

Seconds between cleanup passes. Defaults to 15.

Property Value
Type Int32
Required false
Position named
Default value 15
Accept pipeline input false
Accept wildcard characters false

-RemovalRetryLimit

Maximum cleanup passes over unfinished resources. Defaults to three.

Property Value
Type Int32
Required false
Position named
Default value 3
Accept pipeline input false
Accept wildcard characters false

-SearchRetryInterval

Seconds between deployment status or discovery attempts. Defaults to 60.

Property Value
Type Int32
Required false
Position named
Default value 60
Accept pipeline input false
Accept wildcard characters false

-SearchRetryLimit

Maximum attempts to establish deployment outcomes and discover missing deployment records. Defaults to 40.

Property Value
Type Int32
Required false
Position named
Default value 40
Accept pipeline input false
Accept wildcard characters false

-SkipModuleVersionCheck

Skip the installed-module version check.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-StatePath

Existing cleanup JSON file. Relative paths use the current PowerShell location.

Property Value
Type String
Required true
Position 1
Default value
Accept pipeline input false
Accept wildcard characters false

-SubscriptionId

Explicit test subscription GUID recorded in the state file.

Property Value
Type Guid
Required true
Position named
Default value
Accept pipeline input false
Accept wildcard characters false

-TenantId

Explicit test tenant GUID recorded in the state file.

Property Value
Type Guid
Required true
Position named
Default value
Accept pipeline input false
Accept wildcard characters false

Examples

EXAMPLE 1

avm test cleanup --state-path cleanup.json --subscription-id $testSubscriptionId --tenant-id $testTenantId

EXAMPLE 2

Invoke-AvmTestCleanup -StatePath cleanup.json -SubscriptionId $testSubscriptionId -TenantId $testTenantId -WhatIf

Outputs

  • A result with Status, Cleaned, CleanupPending, Issues and StatePath.