You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The code seems a bit complicated, but from what I can figure out AzOps deletion of custom resources seems to require following the AzOps naming convention for resolving the diffdeletedfiles to "statepath", that is resourceprovider+resource+childpath
i.e microsoft.authoriation_policydefinitions_somename.json/bicep.
I believe this is a product of how AzOpsScopes are built, see the below link for more information.
It would be great if this is more obvious in the wiki, perhaps some statement that azops requires the naming convention to be followed, and also a separate wiki page detailing exactly how azops builds the file names and a disclaimers that they need to be followed if resource deletion is wanted. https://github.com/azure/azops/wiki/ResourceDeletion
A good bonus to this might be that the validate.yaml could screen for naming convention resource type prefix.
Steps to reproduce
Create a file with naming that does not follow azops standards
deploy file
delete file
nothing gets deleted
The text was updated successfully, but these errors were encountered:
Hi @Freakling, when enabling Custom Template Resource Deletion by setting "Core.CustomTemplateResourceDeletion": true the intent is to enable deletion of files regardless of file base name.
Meaning a file called name1.bicep or name2.json are expected to both be processed and deleted, given the resource supports whatif.
I have attempted to re-create the scenario you mention unsuccessfully, what I have however found is there seems to be some change in the underlying Az.PowerShell module in regards to resource retrieval for policyDefinitions resulting in the module throwing when executing deletion, however the deletion is still successful (#908).
Would it be possible for you to share the template you are attempting to delete along with AzOps version and Settings to enable me to further troubleshoot the issue you are experiencing.
Describe the bug
The code seems a bit complicated, but from what I can figure out AzOps deletion of custom resources seems to require following the AzOps naming convention for resolving the diffdeletedfiles to "statepath", that is resourceprovider+resource+childpath
i.e microsoft.authoriation_policydefinitions_somename.json/bicep.
I believe this is a product of how AzOpsScopes are built, see the below link for more information.
AzOps/src/internal/classes/AzOpsScope.ps1
Line 543 in c3ad03a
It would be great if this is more obvious in the wiki, perhaps some statement that azops requires the naming convention to be followed, and also a separate wiki page detailing exactly how azops builds the file names and a disclaimers that they need to be followed if resource deletion is wanted.
https://github.com/azure/azops/wiki/ResourceDeletion
A good bonus to this might be that the validate.yaml could screen for naming convention resource type prefix.
Steps to reproduce
The text was updated successfully, but these errors were encountered: