The "revealResource" command does not work for Container Apps
Repro steps
See https://github.com/Azure/azure-dev/issues/2043
More information
In the Azure resource tree hierarchy, the subscription nodes (with id like /subscriptions/s1234 have children that are "groupings" (with id like /subscriptions/s1234/groupings/Azure Cosmos DB). The problem is "grouping" is not a valid part of an Azure resource ID, which typically have a resource group as the second designator, for example /subscriptions/s1234/resourceGroups/rg-foo/providers/Microsoft.App/containerApps/mygreatapp.
As a result, when the findItemById function starts processing children of the subscription tree item, none of the "groupings" is considered an ancestor of an Azure resource that is part of a resource group, so the tree item corresponding to the passed resource ID is not found and nothing is revealed.
AzureResourceTreeDataProvider.isAncestorOf should be handling this scenario. Also see findItemById tests. This ensures we aren't just comparing resource ids at the grouping step in findItemById.
It's more likely that the reveal is working, but is just taking a very long time to complete. Could you try it again and wait a while? It can take 10s+ for me and will take longer the more resources you have. Related issue: https://github.com/microsoft/vscode-azureresourcegroups/issues/614.
We are aware that being this slow is essentially broken and we're working on fixing this.
Hmm. What I described is what I observed when stepping through code in the debugger. Are you positive the scenario works, but very slowly? E.g. have you tried the repro in the mentioned AZD issue?
Ok, I've figured out that revealing a Container App with its ARM ID via revealResource is not supported unless the setting azureResourceGroups.showHiddenTypes is enabled.
It's failing because Container Apps aren't shown in the tree view as a top-level resource by default, only Container App Environments are. Container Apps are shown as children of CAEs.
Without azureResourceGroups.showHiddenTypes enabled, the Container Apps in the tree have an id that differs from their ARM id, which is expected, but also makes it impossible to reveal with revealResource.
Ideally we support this, but I'm not sure what the ideal UX is since we purposely don't show Container Apps as top-level resources. We can potentially enable or prompt to enable the azureResourceGroups.showHiddenTypes setting if a hidden resource is requested to be revealed.
I would argue that a Container App is one of the fundamental building blocks for Azure apps, so it should be possible to reveal them. There is a bunch of AZD-enabled templates that use Container Apps; they hit an interesting and compelling sweet spot between simplicity of single containers and complexity of something like Kubernetes. That said I think your placement of CAs under Container App Environments is very reasonable.
Even with the current implementation, Container Apps are not really hidden, they just happen to be at a deeper level of the resource hierarchy. Ideally, where things happen to be in the resource hierarchy should not affect whether they can be "revealed".