Improve BCP081 diagnostic message and update corresponding unit tests - #18860
Open
Ilan Grapel (igrapel) wants to merge 4 commits into
Open
Ilan Grapel (igrapel) wants to merge 4 commits into
Ilan Grapel (igrapel) wants to merge 4 commits into
Conversation
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | ||
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + | ||
| "See https://learn.microsoft.com/azure/azure-resource-manager/bicep/diagnostics/bcp081 for details."); |
There was a problem hiding this comment.
This line isn't necessary - the CoreWarning method already fills out the Uri field, which contains a link to the docs, and should be surfaced by IDEs or CLI:
| "BCP081", | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | ||
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + |
There was a problem hiding this comment.
We should avoid referring to "Intellisense" or "Azure Resource Manager" because Bicep is used in non-Microsoft IDEs, and supports deploying of non-Azure resources through local deploy.
Suggested change
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + | |
| "Property type validations and code completions are not available for this resource type, but the resource update operation will still be attempted if this file is deployed. " + |
| public Diagnostic ResourceTypesUnavailable(ResourceTypeReference resourceTypeReference) => CoreWarning( | ||
| "BCP081", | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + |
There was a problem hiding this comment.
What about something like:
Suggested change
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | |
| $"Bicep does not have type definitions available for resource type \"{resourceTypeReference.FormatName()}\". " + |
Anthony Martin (anthony-c-martin)
requested changes
Jan 21, 2026
Anthony Martin (anthony-c-martin)
left a comment
Member
There was a problem hiding this comment.
Thanks for contributing! See comments
Author
Thanks for the review Anthony Martin (@anthony-c-martin)! I've updated the message based on your feedback. |
Anthony Martin (anthony-c-martin)
enabled auto-merge (squash)
September 3, 2026 02:31
Anthony Martin (anthony-c-martin)
approved these changes
Sep 3, 2026
auto-merge was automatically disabled
September 3, 2026 02:31
Pull request was closed
Anthony Martin (anthony-c-martin)
enabled auto-merge (squash)
September 3, 2026 02:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR improves the BCP081 diagnostic message to make it clearer:
All unit tests that reference BCP081 have been updated to match the new message.
Fixes #13287
Checklist
Microsoft Reviewers: Open in CodeFlow