Developer adds empty-folder guard to prevent accidental full workspace deletion
A developer working on a Microsoft Fabric CI/CD pipeline discovered that deployment tools performing cleanup can delete an entire target workspace if the source folder is empty, since every target item appears as an orphan. The risk was identified during onboarding of new solutions, when folders had been created and pipelines wired up but no workspace items had yet been committed. To prevent accidental mass deletion, a pre-deployment guard function was written that aborts the process if the source directory contains no deployable items, with a descriptive error explaining what would have been deleted. An override flag, ALLOW_EMPTY_SOURCE, is available for cases where intentionally clearing a workspace is the goal. The guard was designed to run before any API or SDK calls, keeping it lightweight and independently testable without cloud dependencies installed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in