Repository navigation
Add Remove-AdfObjects to delete chosen objects from ADF #30 - #516
Merged
Merged
Conversation
- New public cmdlet Remove-AdfObjects: select objects by type.name[@folder] patterns or by publish option (reverse deployment); supports -WhatIf - Remove-AdfObject takes the factory from adfInstance, works without a source model, throws for unsupported types, retries temporary errors and can limit the cascade to selected objects - Get-AdfObjectFolder reads folders via REST API Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… test #30 Remove-AdfObject now takes the factory from the instance, like the real Get-AdfFromService returns it; the mock left Name empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30
What
New public cmdlet
Remove-AdfObjects, which deletes chosen objects from an ADF instance whether or not they are in the source code.-Patternuses the sametype.name[@folder]format asIncludes/Excludes. This replaces the separate-Folder/-Recurseparameters proposed in the issue comment, so the module keeps a single pattern format.-Optiondeletes the objects that a deployment with this option would deploy (IncludesminusExcludes).-WhatIf/-Confirm: all objects are confirmed before any deletion, so a cascade never removes an object that was declined.ADFT0034.Refactoring of
Remove-AdfObject(also used byDeleteNotInSource)$adfInstanceinstead of the caller's variables.$adfTargetObj(not a parameter) is replaced by$obj.ADFT0018for an unsupported type, instead of a non-terminatingWrite-Errorinsidetry.Invoke-AdfWithRetry.Selection/Deletedparameters limit the cascade and skip objects that were already deleted.Folders are read through the REST API (
Get-AdfObjectFolder), because Az'sPSPipelinehas no folder property.Tests
test/Remove-AdfObjects.Tests.ps1: 18 unit tests. Az mocksWrite-Error; the tests pass under bothStopandContinue. TheRemove-AdfObjecttests failed before the refactoring.generic,Publish-AdfV2FromJson-ErrorHandling,Publish-AdfV2FromJson-DryRun,Invoke-AdfWithRetryandApplyExclusionOptionspass locally. The delete tests that need Azure run on CI.🤖 Generated with Claude Code