NOTE: The Power Query SDK extension for Visual Studio Code is currently in Public Preview. You can learn more about this extension and the development of Power Query data connectors from the link aka.ms/PowerQuerySDKDocs.
Provides functionality related to the development and testing of Custom Connectors for Power Query and Power BI.
Install the latest version of the Power Query SDK through the Visual Studio Code Marketplace.
NOTE: You can learn how to manually build and install this project from the article on build and install.
What you can do with this extension:
- Create a new extension project using a custom connector template
- Build connector file (.mez)
- Set and manage credentials
- Run test queries
- Test your TestConnection function for refresh on the cloud
- View query results
- Leverage syntax highlighting and intellisense for writing M script
- Manage your workspace settings and other project-level configurations
This extension uses a modern, comprehensive testing approach designed for reliability and maintainability:
-
Unit Tests (152 tests): Pure business logic testing with no external dependencies
- Property-based testing for validation logic
- Performance testing with automated thresholds
- Edge case and boundary condition testing
- Service logic testing with dependency injection
-
Integration Tests (13 tests): VS Code API integration testing
- Extension loading and command registration
- Schema management and validation
- File system operations in VS Code context
# Run all tests (unit + integration)
npm test
# Run only unit tests (fast, no VS Code dependencies)
npm run test:unit-test
# Run only integration tests (requires VS Code)
npm run test:e2e
The project follows these testing patterns:
- Pure Business Logic: Extract validation and data processing into testable functions
- Service Abstraction: Use dependency injection with interface abstractions
- Property-Based Testing: Generate random test data to verify business rules
- Performance Baselines: Automated performance testing with realistic thresholds
- Place unit tests in
unit-tests/
directory - Use property-based testing for validation logic
- Include edge case and performance tests for critical paths
- Follow existing patterns in
unit-tests/validation/
andunit-tests/commands/handlers/
# Install dependencies
npm install
# Development build (watch mode)
npm run watch
# Production build
npm run compile
# Lint code
npm run lint
# Package extension
npm run package
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
Before creating a new issue or discussion, please make sure to the read our support article for guidelines.