Skip to content

We cant connect with ServiceClient to a emulator running on anything other than port 443 #523

@pksorensen

Description

@pksorensen

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:

Image

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.

Image

        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:

Image

Using a self made connection string results in another exception where it tries to get instance name and fails due to localhost:

Image

So currently there is no happy path to actually connect to a emulator we build unless running it on port 443 directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions