I'm using Sitecore 9.2
scaled environment on Azure, and am trying to make a .Net core 2.2 project connects to XConnect, am following this link from Sitecore documentation.
It worked fine in the .Net Console Application but when I tried it on the same machine and with the same code but in a .Net Core 2.2 project it gives the following error
Message = "One or more errors occurred. (The HTTP response was not successful: Forbidden)"
XdbCollectionUnavailableException: The HTTP response was not successful: Forbidden
And I checked that the certificate is self-signed and in the trusted root, the confusing thing is that its working fine in the console application but not in the .Net Core project.
Can someone please advise?