Skip to content

Improve BCP081 diagnostic message and update corresponding unit tests - #18860

Open
Ilan Grapel (igrapel) wants to merge 4 commits into
Azure:mainfrom
igrapel:improve-bcp081-message
Open

Ilan Grapel (igrapel) wants to merge 4 commits into
Azure:mainfrom
igrapel:improve-bcp081-message

Conversation

@igrapel

@igrapel Ilan Grapel (igrapel) commented Jan 19, 2026

Copy link
Copy Markdown

Description

This PR improves the BCP081 diagnostic message to make it clearer:

  • Clarifies that missing resource type definitions affect IntelliSense and property validation
  • States that deployment is still handled by Azure Resource Manager
  • Adds a link to the official documentation

All unit tests that reference BCP081 have been updated to match the new message.

Fixes #13287

Checklist

Microsoft Reviewers: Open in CodeFlow

$"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.");

@anthony-c-martin Anthony Martin (anthony-c-martin) Jan 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

{ Uri = new($"https://aka.ms/bicep/core-diagnostics#{code}") };

"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. " +

@anthony-c-martin Anthony Martin (anthony-c-martin) Jan 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. " +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()}\". " +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! See comments

@igrapel

Copy link
Copy Markdown
Author

Thanks for contributing! See comments

Thanks for the review Anthony Martin (@anthony-c-martin)! I've updated the message based on your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning about missing resource types should be more explicit about impact (and where is the link to the help page?)

2 participants