Forum Discussion

arlindTrystar's avatar
arlindTrystar
Advocate I
1 year ago
Solved

Fabric notebook connection to API that requires mTLS authentication

I need to connect to an API that requires mTLS authentication. I have stored the certificate in Azure Key Vault, and I can retrieve it this way: certificate = mssparkutils.credentials.getSecret('ht...
  • spencer_sa's avatar
    1 year ago

    Theoretically a Key Vault secret is only [Redacted] if you try to print() it*.  You should be able to use it 'as is'.
    How are you getting from certificate to cert?  Is cert an actual path in your output?  Can you print the path?

     

    From the link below, the cert parameter appears to need to be a tuple of the certificate path and the key path.
    python requests library mtls

    If you're storing the cert / key in the key vault you may need to write these to a temporary file location for the requests to pick them up?  (I've not seen methods of just adding the cert to a loaded string)

    * I'm not going to speculate about any bypass methods.