-
Notifications
You must be signed in to change notification settings - Fork 16
Power BI Integration: Analysis Tools and Configuration #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/flow
Are you sure you want to change the base?
Power BI Integration: Analysis Tools and Configuration #39
Conversation
Resolved conflicts by keeping PowerBI tools (67, 71, 72) and custom tool entries. Conflicts resolved: - src/backend/src/seeds/tools.py: Merged enabled_tool_ids lists - src/frontend/src/components/Tools/ToolForm.tsx: Merged customTools arrays 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Added complete setup documentation for the PowerBI Analysis Tool including: ## Documentation Added - Comprehensive setup guide with 11 major sections - Step-by-step installation instructions for Ubuntu/VDI environment - Databricks job configuration (pbi_e2e_pipeline) - Azure Service Principal setup with admin consent workflow - Security best practices and troubleshooting ## Key Sections 1. Development environment setup (Python 3.11, dependencies) 2. Databricks SDK configuration and verification 3. Frontend build and deployment instructions 4. Databricks job setup with exact naming requirements 5. Azure Service Principal configuration for non-interactive auth 6. Power BI Admin Portal configuration 7. Testing instructions with reference crew template 8. Comprehensive troubleshooting for common issues 9. Architecture overview and authentication flow 10. Security best practices for credential management 11. Email template for requesting Azure admin assistance ## Customer Benefits - Complete end-to-end setup documentation - Clear instructions for Service Principal setup (no device code flow) - Reference crew template for quick testing - Troubleshooting guide for 403 errors and OAuth issues - Production-ready security guidelines ## Files Added - src/docs/powerbi_analysis_tool_setup.md (main documentation) - src/frontend/public/docs/powerbi_analysis_tool_setup.md (UI accessible) - src/frontend_static/docs/powerbi_analysis_tool_setup.md (deployment) This documentation enables customers to set up PowerBI integration independently with minimal support, reducing deployment time from days to hours. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
📊 Power BI Integration - Ready for ReviewThis PR adds comprehensive Power BI integration to Kasal, enabling AI agents to analyze Power BI semantic models using DAX queries 🎯 OverviewAdds two PowerBI tools for AI agent workflows:
Use Case: Enable customers like Syngenta/Coca-Cola to have AI agents query PowerBI data without manual intervention, supporting ✨ Key FeaturesBackend
Frontend
Documentation
🏗️ ArchitectureKasal AI Agent Authentication Hierarchy:
📝 Changes Summary34 files changed: +9,584 additions, -80 deletions Major Additions
Database Changes
🧪 Testing Instructions1. Backend Testscd src/backend
python run_tests.py --type unit
python run_tests.py --type integration
2. Manual Testing (Requires Azure Setup)
Prerequisites:
- Azure Service Principal with Dataset.Read.All (Application permission)
- Power BI workspace with SP access
- Databricks job: pbi_e2e_pipeline
Test Flow:
1. Deploy Kasal app to Databricks Apps
2. Configure PowerBI workspace in UI
3. Import reference crew (tools ID 71/72)
4. Run crew with question: "What is total revenue?"
5. Verify Databricks job execution
6. Check Power BI audit logs
3. Key Test Scenarios
- ✅ Service Principal authentication
- ✅ DAX query execution and result parsing
- ✅ Databricks job triggering and monitoring
- ✅ Error handling (403, timeout, invalid DAX)
- ✅ Multi-workspace support
- ✅ Encrypted credential storage
---
🔍 Review Focus Areas
Critical Paths
1. Security:
- Service Principal credential encryption (powerbi_config_repository.py:45-67)
- API key handling in tool initialization
- No credential leakage in logs/errors
2. Authentication Flow:
- Service Principal token acquisition (powerbi_service.py:89-134)
- OAuth fallback handling
- Token refresh logic
3. Async Operations:
- All I/O operations are async (powerbi_service.py, powerbi_dax_tool.py)
- Proper event loop handling in CrewAI tools
- No blocking operations
4. Data Extraction:
- Notebook output parsing (powerbi_analysis_tool.py:469-650)
- Result formatting and JSON serialization
- Handling large result sets (simplified output logic)
Edge Cases Handled
- ✅ Multi-task Databricks jobs (task_key parameter)
- ✅ Empty result sets
- ✅ Expired credentials
- ✅ Timeout handling (5-minute job timeout)
- ✅ Missing workspace permissions
---
🚨 Breaking Changes
None - This is a pure feature addition with no impact on existing functionality.
---
📦 Dependencies Added
# Already in requirements.txt - no new dependencies needed
- msal (Microsoft Authentication Library)
- aiohttp (async HTTP client)
- litellm (LLM routing)
---
🔒 Security Considerations
1. Credential Storage: Encrypted in database using Fernet
2. API Key Management: Per-group isolation, no sharing
3. Least Privilege: Service Principal only needs Dataset.Read.All
4. Audit Trail: All queries logged to Power BI audit logs
5. Token Rotation: Documented in setup guide
---
📚 Documentation Completeness
- ✅ API documentation (docstrings)
- ✅ Setup guide (11 sections)
- ✅ Integration guide with examples
- ✅ Troubleshooting guide
- ✅ Security best practices
- ✅ Example notebooks and crews
---
✅ Checklist
- All tests passing
- Code coverage >80%
- No credentials in code
- Async/await properly used
- Clean architecture patterns followed
- Multi-tenant isolation maintained
- Documentation complete
- Migration scripts included
- Frontend builds successfully
- No breaking changes
---
🚀 Next Steps After Merge
1. Customers can deploy and configure PowerBI integration
2. Setup guide enables self-service onboarding
3. Databricks job template available in examples/
4. Reference crew for quick testing
---
Ready for review! This has been tested with Syngenta/Coca-Cola use cases and enables production-ready PowerBI analysis workflows
for AI agents. |
Summary
Adds comprehensive Power BI integration to Kasal, enabling AI agents to analyze Power BI semantic models using DAX queries and Databricks job execution.
Key Features
Changes
Backend
Frontend
Documentation
Infrastructure
Commits
Files Changed
34 files changed: +9584 additions, -80 deletions
Testing
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]