I have python script which runs on HDI spark cluster, and it access key vault to read secret values. The code would create SecretClient and use managed identity as credential. I have a user assigned managed identity set on HDI. But the SecretClient creation fails giving error that "No managed identity assigned to this resource. I also tried to set the client id of managed identity explicitly in the credential, but then it threw exception that "Provided managed identity is not assigned to this resource".
File "/usr/bin/anaconda/envs/py37test/lib/python3.7/site-packages/azure/identity/_credentials/managed_identity.py", line 224, in _refresh_token
six.raise_from(CredentialUnavailableError(message=message), ex)
File "<string>", line 3, in raise_from
azure.identity._exceptions.CredentialUnavailableError:
ManagedIdentityCredential authentication unavailable. No identity has been assigned to this resource.