An Azure service for ingesting, preparing, and transforming data at scale.
Hello Patrick !
Thank you for posting on Microsoft Learn Q&A.
That error is raised when a linked credential that uses service principal auth is evaluated at runtime and that can be:
- the Azure SQL linked service (if it uses AAD service principal auth)
- the Key Vault linked service/credential (if it uses service principal instead of MI)
- a factory credential asset that your linked services reference
Try to compare between DEV and PROD :
- Data Factory : managed identities
- DEV: which identity is enabled (system-assigned? user-assigned?)
- PROD: must match whichever your KV LS or credential expects
- Key Vault : access configuration
- If using Access policies: add the PROD factory’s identity (or the UAMI you selected) with Get + List (Secrets).
- If using RBAC: grant Key Vault Secrets User (or better: Key Vault Secrets Officer) to that identity at the vault scope.
Try to check the secret itself in key vault in prod since the secret name referenced by your LS/credential exists, is Enabled, Not before is in the past, Expiry not passed, and latest version contains the actual SP secret string (no quotes/JSON/line breaks).
If you parameterize the secret name, confirm the PROD parameter resolves to the expected name (not DEV).
Open the Azure SQL linked service JSON in PROD and check:
{
"type": "AzureSqlDatabase",
"typeProperties": {
"connectionString": "@Microsoft.KeyVault(SecretUri=...)", // or individual fields
"authenticationType": "AADServicePrincipal", // <- if present, you DO need clientId+clientSecret
"servicePrincipalId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"tenant": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
"servicePrincipalCredential": {
"type": "AzureKeyVaultSecret",
"store": { "referenceName": "<your-kv-linked-service>", "type": "LinkedServiceReference" },
"secretName": "sql-sp-client-secret" // must exist in PROD KV
}
},
"connectVia": { "referenceName": "AutoResolveIntegrationRuntime", "type": "IntegrationRuntimeReference" }
}
If authenticationType = AADServicePrincipal, make sure servicePrincipalCredential really points to a valid KV secret in PROD.
If you actually intend to use Managed Identity to SQL, switch to authenticationType = ManagedIdentity (no clientSecret needed), and ensure:
The PROD factory MI (or UAMI) is created as a user in the SQL DB:
-- at server level
-- Set an AAD admin at the SQL server, then in the database:
CREATE USER [<factory-identity-or-UAMI-name>] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [<name>];
ALTER ROLE db_datawriter ADD MEMBER [<name>];
SQL server firewall / private endpoints allow access from the IR used at runtime.