Remove App Lens microsoft.web/sites kind gate and support all site kinds#2596
Remove App Lens microsoft.web/sites kind gate and support all site kinds#2596
microsoft.web/sites kind gate and support all site kinds#2596Conversation
Agent-Logs-Url: https://github.com/microsoft/mcp/sessions/274dcc6a-c7ea-4e2d-a43e-6ed2c6e2f60f Co-authored-by: tmeschter <10506730+tmeschter@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/mcp/sessions/274dcc6a-c7ea-4e2d-a43e-6ed2c6e2f60f Co-authored-by: tmeschter <10506730+tmeschter@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/mcp/sessions/274dcc6a-c7ea-4e2d-a43e-6ed2c6e2f60f Co-authored-by: tmeschter <10506730+tmeschter@users.noreply.github.com>
microsoft.web/sites kind gate and support all site kinds
|
@copilot Since the updated method now just checks the |
Agent-Logs-Url: https://github.com/microsoft/mcp/sessions/06514e5e-b94e-43ef-8657-e8896f88653a Co-authored-by: tmeschter <10506730+tmeschter@users.noreply.github.com>
Updated in c58f4b3. I simplified the method to a single case-insensitive membership check against Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR removes App Lens’ legacy kind-based restriction for microsoft.web/sites, making support decisions based solely on the ARM resource type to align with current backend capabilities.
Changes:
- Simplified
AppLensService.IsResourceTypeSupportedto check onlyresourceType(case-insensitive) againstSupportedResourceTypes(). - Updated the App Lens resource filtering path to call the new
IsResourceTypeSupported(resourceType)signature. - Updated unit tests to validate type-only behavior and case-insensitive matching.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AppLens/src/Services/AppLensService.cs | Removes kind gating from support checks and updates the filtering call site accordingly. |
| tools/Azure.Mcp.Tools.AppLens/tests/Azure.Mcp.Tools.AppLens.UnitTests/Resource/ResourceDiagnoseCommandTests.cs | Updates unit tests to reflect the new type-only support logic. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
| // Filter to supported resource types | ||
| var supportedResults = filteredResults | ||
| .Where(r => IsResourceTypeSupported(r.ResourceType, r.ResourceKind)) | ||
| .Where(r => IsResourceTypeSupported(r.ResourceType)) | ||
| .ToImmutableArray(); |
There was a problem hiding this comment.
Clean simplification - removes the legacy kind restriction so all microsoft.web/sites are accepted by type alone. Using SupportedResourceTypes() as the single source of truth is a solid pattern.
The existing bot comment about ResourceKind = "app" being hard-coded downstream is valid, but it's pre-existing (already on main before this PR). This change doesn't regress that behavior - it just allows more resource kinds to reach that code path. Worth a follow-up but shouldn't block this.
App Lens in MCP was still carrying a legacy restriction that only allowed select
microsoft.web/siteskinds (app,linux,functionapp). This PR removes that gate so App Lens accepts allmicrosoft.web/sitesresources, matching current backend support.Service logic update
AppLensService.IsResourceTypeSupportedto evaluate support by resource type only.microsoft.web/sitesnow returns supported regardless ofkind.SupportedResourceTypes()as the single source of truth for supported resource types.Unit test updates
ResourceDiagnoseCommandTests.IsResourceTypeSupported_ReturnsCorrectResultto validate type-only behavior.