-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI Environment] Do not delete tags that already exist on subscription level #3280
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
$currentTags = $(Get-AzTag -ResourceId /subscriptions/$subscriptionId).Properties | ||
|
||
# Get the tags to remove | ||
$tagsToRemove = @('Test', 'TestToo') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tags provided by deployment validation tests are just for testing purposes and shouldn't be hardcoded in the CI environment utilities.
If the entire tags object gets deleted even if onlyUpdate
is set to true
, then I agree that an issue should be opened to address it. @ntaheij could you please open a bug in the board explaining the actual and indended behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the response. Currently, yes, onlyUpdate
does delete all tags. Issue is that, when deploying the tests for the module, currently all tags are being deleted, which means tags for i.e. billing are not available. I will open a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is any way to only delete the tags that are created, I'd be interested to use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ntaheij! I'm going to put the PR in draft for the moment and reference the PR in the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, I replied in the issue :)
Description
Currently, whenever the
Microsoft.Resources/tags
module is tested by the CI environment, it will delete the entire tags object, which in most cases, is not desirable.This change gets all the previous tags from Azure and after deletion adds them back without the test tags.
Behaviour:
Pipeline references
Type of Change
Please delete options that are not relevant.
Checklist