Getting error in ADF on web activity for get token using client certificate.

Sravankumar Vutukuru 0 Reputation points
2025-01-30T09:42:15.2833333+00:00

ExtractAuthorizationCertificate: Unable to generate a certifcate from a Base64 string/password combination : System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)

at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)

at System.Convert.FromBase64String(String s)

at Microsoft.DataTransfer.ExternalActivities.Common.WebExecutionUtilities.ExtractAuthorizationCertificate(IDictionary`2 typeProperties, ActivityLogWrapper logWrapper)

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,228 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 28,381 Reputation points
    2025-01-30T12:51:09.1166667+00:00

    I think from the message error, the string might not be properly Base64 encoded, it might contain extra characters like spaces, newlines or other.. which are not part of the Base64 encoding.

    Check with Powershell :

    $base64String = "your_base64_string_here"
    $bytes = [System.Convert]::FromBase64String($base64String)
    $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($bytes)
    
    

    You can trim the string and remove any unnecessary characters:

    string base64String = "your_base64_string_here".Trim();
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.