This cmdlet is used to add or remove the MSI from the recovery services vault. Use -IdentityType param to add a SystemAssigned/UserAssigned identity to the RSVault. Use RemoveSystemAssigned/RemoveUserAssigned switch to remove the MSI from the vault. Additionally, this cmdlet can be used to configure vault settings such as cost management granularity, public network access, immutability state, and cross-subscription restore state.
Examples
Example 1: Add SystemAssigned identity to the recovery services vault
The first cmdlet fetches the recovery services vault.
The second and third cmdlet fetches the user created MSIs.
The fourth cmdlet adds the user MSIs to the vault.
The fifth cmdlet shows the Identities added to the vault.
Example 3: Remove SystemAssigned and UserAssigned identities from the vault
PrincipalId :
TenantId :
Type : None
UserAssignedIdentities :
The first cmdlet fetches the recovery services vault.
The second cmdlet removes the SystemAssigned identity from the vault.
The third cmdlet fetches all the user MSIs as a list from the vault.
The fourth cmdlet removes all the user MSIs from the vault. In case you want, you can provide selected user identities to be removed as comma separated, like in previous example.
The fifth cmdlet shows the identities in the vault, as we removed all the identities, Type is displayed as None.
Example 4: Update PublicNetworkAccess, ImmutabilityState of recovery services vault
The first cmdlet fetches the recovery services vault.
The second cmdlet updates PublicNetworkAccess, ImmutabilityState properties of the recovery services vault.
The third and fourth command are used to fetch the public network access and immutability state of the vault.
Example 5: Enable/Disable CrossSubscriptionRestore for recovery services vault
The first cmdlet fetches the recovery services vault.
The second cmdlet updates CrossSubscriptionRestoreState of the recovery services vault.
The third command gets the cross subscription restore state of the vault.
Example 6: Update CostManagementGranularity for recovery services vault
The first cmdlet fetches the recovery services vault.
The second cmdlet updates the CostManagementGranularity to "VaultLevel". Allowed values are "VaultLevel", "ProtectedItemLevel", and "ProtectedItemWithParentTag".
The third command gets the cost management granularity level of the vault.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Specifies the granularity level for cost management settings of the vault. This parameter controls the level at which cost data is tracked and reported.
Immutability State of the vault. Allowed values are "Disabled", "Unlocked", "Locked".
Unlocked means Enabled and can be changed, Locked means Enabled and can't be changed.
Parameter to authorize operations protected by cross tenant resource guard. Use command (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token to fetch authorization token for different tenant
Parameter to authorize operations protected by cross tenant resource guard. Use command (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token to fetch authorization token for different tenant
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.