MetricSign
Start free
High severitycredentials

Power BI Refresh Error:
SftpInvalidSftpCredential

What does this error mean?

Authentication to the SFTP server failed. The username/password or SSH key in the ADF linked service was rejected by the SFTP server.

Common causes

  • 1The SSH private key stored in Azure Key Vault is not correctly base64 encoded — the entire original key file must be base64 encoded (not just the key content)
  • 2The SSH private key is in PKCS#8 format (starts with '-----BEGIN ENCRYPTED PRIVATE KEY-----') which is not supported — it must be converted to traditional RSA format
  • 3The SFTP username or password is incorrect

How to fix it

  1. 1If the private key is from Azure Key Vault: base64-encode the entire original private key file and store the encoded string in Key Vault.
  2. 2In Python: import base64; keyContent = open(key_path, 'rb').read(); print(base64.b64encode(keyContent)).
  3. 3In C#: string keyContent = Convert.ToBase64String(File.ReadAllBytes(keyPath), Base64FormattingOptions.None).
  4. 4If the private key is in PKCS#8 format (starts with '-----BEGIN ENCRYPTED PRIVATE KEY-----'): convert to traditional RSA format using: openssl pkcs8 -in pkcs8_key.pem -out rsa_key.pem && chmod 600 rsa_key.pem.
  5. 5After converting, base64-encode the converted file before storing in Key Vault.
  6. 6If the key file can be uploaded directly (not via Key Vault), uploading the original file via the SFTP connection UI works without base64 encoding.
  7. 7For credential validation, test the key file or password using WinSCP with the same SFTP server.

Frequently asked questions

Does this error affect all users or just the dataset owner?

All users — scheduled and manual refreshes run under the credentials stored in the dataset settings, not individual user accounts.

Can expired OAuth tokens cause this error?

Yes — if the data source uses OAuth (SharePoint, Dynamics 365, Azure), the token expires periodically and must be re-authorized by the dataset owner.

Will this error clear itself after I update the credentials?

Yes — once you re-enter valid credentials in the dataset settings, the next refresh (scheduled or triggered manually) will succeed.

How do I know which dataset is using which credentials?

Go to Power BI Service → Settings → Datasets → Data source credentials for the affected dataset. Each connection shows the credential type and the account it's stored under.

Source · learn.microsoft.com/en-us/fabric/data-factory/connector-troubleshoot-ftp-sftp-http

Other credentials errors