Skip to content

Bug report - naming conventions for resource deletion #903

Open

Description

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.

return (Join-Path (Join-Path $rgpath -ChildPath "$(Get-PSFConfigValue -FullName 'AzOps.Core.AutoGeneratedTemplateFolderPath')".ToLower()) -ChildPath ($this.ResourceProvider + "_" + $this.Resource + "-" + $childpath).ToLower())

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

  1. Create a file with naming that does not follow azops standards
  2. deploy file
  3. delete file
  4. nothing gets deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions