Power-Fx icon indicating copy to clipboard operation
Power-Fx copied to clipboard

Connectors shouldn't need both HttpClient and uriPrefix

Open MikeStall opened this issue 1 year ago • 1 comments

HttpClient already provides the base address. So we shouldn't also need uriPrefix (which is conceptually just part of the base address).

An additional benefit is that this lets the host fully control the endpoint.

  • They can pick v1 vs. v2, (will this also lets us revert #2718 and instead defer that responsibility to the host?)
  • They can call CDP hosted outside of APIM. (this includes localhost)

MikeStall avatar Dec 17 '24 05:12 MikeStall

This will also flush out other concerns. We extract a connectorName from the uri: https://github.com/microsoft/Power-Fx/blob/8d2a19061d747f0baaefc35b6ee7c3bbf42c7691/src/libraries/Microsoft.PowerFx.Connectors/Tabular/CdpTableResolver.cs#L96

we should avoid this because:

  • Fx.Connectors (client code) shouldn't be having per-connector logic. CDP is supposed to be a standard interface.
  • we can't always assume the uri implies the connector type.

Worst case - we could still get this information from httpClient.baseAddress.

MikeStall avatar Dec 17 '24 06:12 MikeStall