JWT Encoding error while using Azure secret key

Wycliff
New Contributor II

My secret value in Azure key vault is like below.
private_key="""-----BEGIN RSA PRIVATE KEY-----
****
****
-----END RSA PRIVATE KEY-----"""

Running this command in Databricks notebook - jwt.encode(claim_set,private_key,algorithm='RS256')

While using the above hardcoded secret value in the command, it is working well.

But failing while using keyvaults in the command - private_key=dbutils.secrets.get(scope="scope_nm",key="key_nm").

Error : ('Could not deserialize key data.The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type(e.g. EC curves with explicit parameters).'