We get similar behavior when trying to use Azure IR (Microsoft Managed Virtual Network) along with the Data Flow ... The Source Lookup Data set ...
- Edit the Linked Service - Test Connection from the Linked Service to SQL MI ALWAYS works and connects to DB (Private Endpoints enabled)
- When you are in the Data Flow and you use Test Connection to call the Data Set - it would fail with :
exception:java.util.concurrent.ExecutionException: com.microsoft.aad.msal4j.MsalServiceException: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '<our aad sp id goes here>. Trace ID: d6087b52-f309-4148-8635-20108ddbbe00 Correlation ID: e0e2b0b4-a4c0-4908-bd2e-20bcf1d20a69 Timestamp: 2022-03-09 22:36:15Z, authority:None,tenantId:Some(<our aad tenant goes here>), spnId:<our aad sp id goes here>
We are using Service Principal with KeyVault credential as a CERTIFICATE stored in vault.
IF we switch the SQL MI Linked Service to authenticate with Service Principal Key - with a hardcoded SECRET ... then it started working.
THEN we switched it back to Key Vault (with credential as a CERTIFICATE stored under secret in vault) --- now the Test Connection on Data Flow works !!!!
^^ This scenario is very similar to the original issue I reported, looks like it is manifesting itself in different ways.