Skip to content

Latest commit

 

History

History
118 lines (86 loc) · 2.97 KB

Register-AvmFeature.md

File metadata and controls

118 lines (86 loc) · 2.97 KB

Register-AvmFeature

Synopsis

Ensure features declared at a module root are registered in one Azure test subscription.

Description

Reads the optional .required-features.json string array at the exact module root, or for a Bicep registry module the repository-root object entry keyed by its exact avm/... module path, and validates every entry before accessing Azure. Requires an explicit subscription GUID and an Azure CLI session selected to that same subscription. Already Registered features are left alone. Missing features are registered, polled until Registered, and their resource provider is registered again to propagate the change. Pending approval, failed CLI calls, and timeouts stop the test run. Feature registrations persist; this command never unregisters them.

CLI commands

  • avm register-features

Syntax

Register-AvmFeature [[-Path] <string>] -SubscriptionId <string> [-MaximumPolls <int>] [-PollIntervalSeconds <int>] [-SkipModuleVersionCheck] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

-MaximumPolls

Maximum status checks per feature or provider. Defaults to 60.

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

-Path

Module root. Bicep registry modules read the repository-root manifest.

Property Value
Type String
Required false
Position 1
Default value $PWD.Path
Accept pipeline input false
Accept wildcard characters false

-PollIntervalSeconds

Seconds between status checks. Defaults to 10.

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

-SkipModuleVersionCheck

Skip the PowerShell Gallery check that otherwise stops the command when a newer Avm.Authoring version is available. Writes a warning once.

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

-SubscriptionId

GUID of the selected test subscription. Must also match any effective ARM_SUBSCRIPTION_ID and the Azure CLI's selected subscription.

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

Examples

EXAMPLE 1

avm register-features --subscription-id 00000000-0000-4000-8000-000000000001

EXAMPLE 2

Register-AvmFeature -SubscriptionId $testSubscriptionId -WhatIf

Outputs

  • pscustomobject with Status, SubscriptionId, FeaturesTotal, RegisteredFeatures, AlreadyRegisteredFeatures, and Reason.