Forum Discussion
Creating connection to Warehouse
- 10 months ago
Hi hsa297 ,
Thank you for reaching out to the Microsoft Community Forum.
Please check below things to fix the "401" Error.
1. Please check the Tenant ID, Service Principal ID, and Service Principal Key for typos or outdated values. Check the key hasn’t expired.2. Please confirm the Service Principal has Fabric Admin or Warehouse Contributor roles assigned. Check if the Service Principal is granted API permissions for Microsoft Fabric.
3. You mentioned that enabling Service Principal settings, Check that “Users can consent to apps accessing company data on their behalf” is enabled. The app registration is multi-tenant if you are accessing resources across tenants.
4. Check the Service Principal is added as a user to the Warehouse artifact with appropriate permissions. You can check this via SQL commands.SQLCREATE USER [appId] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [appId];
ALTER ROLE db_datawriter ADD MEMBER [appId];
5. If you are using VNet or on-prem gateways, check the gateway is properly configured and reachable. Try to disable the gateway option temporarily to test direct connectivity.6. A "401" often means the token wasn’t accepted. Use tools like Postman or Azure CLI to manually acquire a token using the Service Principal and test access.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Hi hsa297 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
Hi @hsa297 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- v-dineshya9 months agoCommunity Support
Hi @hsa297 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh