Trigger Azure Synapse Analytics pipelines directly from Microsoft Excel using VBA and Azure Functions.
This solution allows users to trigger Azure Synapse pipelines with a simple button click in Excel. It consists of:
- Azure Function (Python) - Serverless API that communicates with Azure Synapse
- Excel VBA Module - User-friendly interface for triggering pipelines
- Comprehensive Documentation - Setup guides for administrators and end users
✅ Simple Excel Interface - One-click pipeline triggering from Excel ✅ Secure Authentication - Uses Azure Managed Identity for secure access ✅ Error Handling - Clear error messages and success notifications ✅ Flexible - Easy to configure for different pipelines ✅ Scalable - Serverless architecture, no infrastructure to manage ✅ Optional Parameters - Support for pipeline parameters
Excel (VBA) → Azure Function (Python) → Azure Synapse Analytics
- User clicks button in Excel
- VBA code sends HTTP POST request to Azure Function
- Azure Function authenticates using Managed Identity
- Function triggers the specified Synapse pipeline
- Response is displayed to user in Excel
If you just want to use the Excel trigger (not deploy the Azure Function):
- Download
TriggerPipeline.basfrom theexcel/folder - Follow the User Setup Guide
- Import the VBA code into Excel
- Create a button and start triggering pipelines!
If you need to deploy the Azure Function:
- Follow the Deployment Guide
- Configure environment variables
- Enable Managed Identity
- Grant Synapse permissions
- Deploy the function code
.
├── TriggerPipelineFunction/ # Azure Function code
│ ├── __init__.py # Main function handler
│ ├── config.py # Configuration management
│ ├── synapse_client.py # Synapse API client
│ ├── validator.py # Request validation
│ ├── response.py # Response formatting
│ └── exceptions.py # Custom exceptions
├── excel/ # Excel VBA code
│ ├── TriggerPipeline.bas # VBA module
│ └── EXCEL_SETUP.md # Excel setup instructions
├── tests/ # Unit and integration tests
│ ├── test_integration.py # End-to-end tests
│ ├── manual_test.py # Manual testing script
│ └── ...
├── .kiro/specs/ # Feature specifications
├── DEPLOYMENT.md # Azure deployment guide
├── USER_SETUP_GUIDE.md # End user setup guide
├── TESTING.md # Testing documentation
├── requirements.txt # Python dependencies
└── README.md # This file
- Deployment Guide - Deploy the Azure Function
- User Setup Guide - Set up Excel for end users
- Testing Guide - Test the function locally and in Azure
- Excel Setup - Detailed Excel configuration
- Azure Function:
pipelinetrigger-bpbzera6dufpahfq.southafricanorth-01.azurewebsites.net - Synapse Workspace:
autolineanalytics - Resource Group:
GoscorIT - Subscription:
Azure subscription 1 - Default Pipeline:
A_Lai_Accounts - Region:
South Africa North
- Python 3.9+
- Azure Functions Core Tools 4.x
- Azure CLI
- Azure subscription with appropriate permissions
- Microsoft Excel 2016 or later
- Windows PC
- Macros enabled
- Network access to Azure
git clone https://github.com/KFLATELA/Synapse-data.git
cd Synapse-dataFollow the Deployment Guide for detailed instructions.
Quick deploy:
# Set subscription
az account set --subscription "Azure subscription 1"
# Deploy function
func azure functionapp publish PipelineTriggerFollow the User Setup Guide for detailed instructions.
Quick setup:
- Open Excel
- Press Alt + F11
- Import
excel/TriggerPipeline.bas - Create a button and assign the macro
- Open your Excel workbook with the VBA code
- Click the "Trigger Pipeline" button
- Wait for confirmation message
- Check Synapse Studio for pipeline run status
Modify the GetPipelineParameters() function in the VBA code to read parameters from Excel cells:
Private Function GetPipelineParameters() As String
Dim inputPath As String
inputPath = Range("InputPath").Value
GetPipelineParameters = "{"
GetPipelineParameters = GetPipelineParameters & """inputPath"": """ & inputPath & """"
GetPipelineParameters = GetPipelineParameters & "}"
End FunctionEdit the VBA code constant:
Const PIPELINE_NAME As String = "Your_Pipeline_Name"# Set environment variables
$env:SYNAPSE_WORKSPACE_NAME="autolineanalytics"
$env:AZURE_SUBSCRIPTION_ID="2d5273ef-b491-446f-8879-4edc2c4a5cc1"
$env:SYNAPSE_RESOURCE_GROUP="GoscorIT"
# Run manual test
python tests/manual_test.py --pipeline A_Lai_Accounts# Run all tests
python -m pytest tests/
# Run specific test
python -m pytest tests/test_integration.py -vSee TESTING.md for more details.
- Azure Function uses Managed Identity for authentication
- No credentials stored in code
- Function key required for API access
- Rotate function keys every 90 days
- Use IP restrictions if possible
- Monitor pipeline runs in Synapse Studio
- Don't share VBA code outside your organization
If you need to rotate the function key:
- Generate new key in Azure Portal
- Update the VBA code with new URL
- Redistribute to all users
Excel: "Macros have been disabled"
- Enable macros in Trust Center settings
Excel: "Error triggering pipeline"
- Check internet connection
- Verify function URL is correct
- Check if corporate firewall blocks Azure
Azure: "401 Unauthorized"
- Verify Managed Identity is enabled
- Check Synapse RBAC permissions
Azure: "500 Configuration Error"
- Verify environment variables are set
- Check all three variables are present
See USER_SETUP_GUIDE.md for more troubleshooting tips.
This is an internal project for Goscor IT. For changes or improvements:
- Create a feature branch
- Make your changes
- Test thoroughly
- Create a pull request
az webapp log tail --name PipelineTrigger --resource-group GoscorIT- Open Synapse Studio
- Go to Monitor → Pipeline runs
- Filter by pipeline name or run ID
func azure functionapp publish PipelineTriggeraz functionapp config appsettings set --name PipelineTrigger --resource-group GoscorIT --settings KEY=VALUEaz functionapp restart --name PipelineTrigger --resource-group GoscorIT- Initial working version
- Azure Function deployed to production
- Tested with A_Lai_Accounts pipeline
- Excel VBA module complete
- Full documentation
For issues or questions:
- Check the User Setup Guide
- Review Troubleshooting section
- Contact Goscor IT Azure administrator
- Check Synapse Studio for pipeline run details
Internal use only - Goscor IT
- Kflatela - Initial development and deployment
- Azure Functions documentation
- Azure Synapse Analytics documentation
- Python azure-identity and azure-synapse-artifacts libraries
Status: ✅ Production Ready
Last Updated: November 2025
Maintained By: Goscor IT