There is a problem with how the serviceclient and SkipDiscovery is handled.
We have build a emulator for dataverse for aspire however it is currently forced to use port 443 because its not possible to connect to a custom port like https://localhost:43434
The problem is:
When the connectionstring is build from options like this:
Then the skipdiscovery is actually omitted when building connectring string:
|
public static string CreateConnectionStringFromConnectionOptions(Model.ConnectionOptions options) |
if (options.SkipDiscovery) sbConnectionString.Append($"SkipDiscovery={options.SkipDiscovery};");
and then for connecting its parsing the generated connection string where it defaults back to true due to logic.
|
if (bool.TryParse(skipDiscovery, out tempbool)) |
var parsedConnStr = DataverseConnectionStringProcessor.Parse(connectionString, logger);
https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/master/src/GeneralTools/DataverseClient/Client/ServiceClient.cs#L992C33-L992C67
which ultimately ends up in this exeception path:
Using a self made connection string results in another exception where it tries to get instance name and fails due to localhost:
So currently there is no happy path to actually connect to a emulator we build unless running it on port 443 directly.