
You can add Dataverse as data source in your code app using the command below:
pac code add-data-source -a dataverse -t <table-logical-name>
Quick notes:
pac auth list and pac auth select -n <profile-name> or pac auth select -i <profile-index> to connect to an existing profilepac auth create -env <environment-url or environment-guid> -n <profile-name> to create a profile connected to an environment
Here's the documentation you can reference for adding Dataverse as a data source to your app: How to: Connect your code app to Dataverse - Power Apps | Microsoft Learn
If this reply helped you in any way, please give it a Like 💜 and in case it resolved your issue, please mark it as the Verified Answer ✅.