Lakehouse creation with service principal
I've coded this to create a lakehouse using a "service principal" token and Fabric API, but I got an unknown error. Howerver, If I use an Entra account it works.
Have you done something alike successfully? Any ideas to troubleshoot the error. Or alternatives.
----/ A code fragment /---
url_lakehouse = fabric_base_url+f"workspaces/{dest_workspaceid}/lakehouses"
client_secret_credential_class = ClientSecretCredential(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)
access_token_class = client_secret_credential_class.get_token(scope)
token_string = access_token_class.token
headers = {'Content-Type':'application/json','Authorization': f'Bearer {token_string}'}
payload = f'{{"displayName": "LakehouseTEST1"}}'
response = requests.request("POST", url_lakehouse, headers=headers, data=payload)
----/ Error /---
<Response [400]> {"requestId":"45544588-914f-4d84-97c5-56f3a414cc59","errorCode":"UnknownError","moreDetails":[{"errorCode":"DatamartCreationFailedDueToBadRequest","message":"Datamart creation failed with the error 'Required feature switch disabled'."}],"message":"An unexpected error occurred while processing the request"}
🙄
2
3 comments
Geiber Ugalde
2
Lakehouse creation with service principal
Learn Microsoft Fabric
skool.com/microsoft-fabric
Helping passionate analysts, data engineers, data scientists (& more) to advance their careers on the Microsoft Fabric platform.
Leaderboard (30-day)
Powered by