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.
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
Fix ARMViolations for Microsoft.Resources #3912
Fix ARMViolations for Microsoft.Resources #3912
Changes from 1 commit
2677dee
a6b4f32
d1873c4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
In this file, when we use autorest to check ARM violations, we always have ARMViolations for "TagDetails". The error is that we must have name and type properties for it, and "TagDetails" has extra properties ['tagName', 'count', 'values']. I checked resources.json for 2018-02-01, the definition for "TagDetails" is the same, but there is no such errors in autorest. Do you know how I can address it?
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.
Hi @zjpjack
Please add a suppression rule for the TagDetails object in the Readme. You can tag example on the compute file, this should look like this:
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.
I will let @ravbhatnagar knows this suppression, he or I will send another PR for these suppression rules.
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.
I just checked the CLI recording that is supposed to return this object:
https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_deployment.yaml#L66-L68
There is no "type" in the JSON. Could you give me more context why you think it's necessary?
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.
According to Autorest, if there is no "type", then we get the following error
ERROR (RequiredPropertiesMissingInResourceModel/R2020/ARMViolation): Model definition 'DeploymentExtended' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.
Any suggestion for this?
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.
The most important is that the Swagger represent the absolute truth about the server. This is indeed an ARM violation, the linter is right that this call does not respect ARM.
Correct to handle this is to send an email to @ravbhatnagar to describe the issue and ask for a ARM suppression rule. So at least the non-conformance is known and documented. Adding type here just shut off the alarm and doesn't solve anything.
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.
I will let @ravbhatnagar knows this suppression, he or I will send another PR for these suppression rules.