Resume Bicep test cleanup from its saved JSON state.
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.
avm test cleanup
Invoke-AvmTestCleanup [-StatePath] <string> -SubscriptionId <guid> -TenantId <guid> [-SearchRetryLimit <int>] [-SearchRetryInterval <int>] [-RemovalRetryLimit <int>] [-RemovalRetryInterval <int>] [-SkipModuleVersionCheck] [-WhatIf] [-Confirm] [<CommonParameters>]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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
avm test cleanup --state-path cleanup.json --subscription-id $testSubscriptionId --tenant-id $testTenantIdInvoke-AvmTestCleanup -StatePath cleanup.json -SubscriptionId $testSubscriptionId -TenantId $testTenantId -WhatIfA result with Status, Cleaned, CleanupPending, Issues and StatePath.