Including the actual hidden folder in the wwwroot folder is straightforward, and works just like you'd expect in the UI.
However, when you publish it (at least, at the time this post is being written), the folder is not included in the publish output. The easiest way I know of to include it is to edit the .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Snip -->
</PropertyGroup>
<!-- Snip -->
<ItemGroup>
<Content Include="wwwroot\.well-known\**" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes)" />
</ItemGroup>
<!-- Snip -->
</Project>
The key here is the ItemGroup
→ Content
element directly under Project
. After you add that, your hidden folder should be in the publish output.