Export to SQL Server Using Azure Functions
Overview
This guide walks you through setting up and deploying an Azure Function for integrating Delta Sharing data with Procore Analytics. The Azure Function enables efficient data processing and sharing workflows with Delta Sharing profiles.
Prerequisites
Procore Analytics 2.0 SKU.
Delta Sharing profile file:
Your *.share file containing Delta Sharing credentials. For convenience, place it inside the downloaded package.
Python Environment:* Installed Python 3.9+ and pip on your system.
Azure Setup:
Azure CLI installed and logged in.
Azure Functions Core Tools installed.
Steps
Prepare the Package
Install Dependencies
Generate Configuration
Azure CLI Setup
Install Azure Functions Core Tools
Prepare the Azure Function
Deployment
Validation
Prepare the Package
Download the required package (adls_azure_function or sql_server_azure_function).
Note: You can download the zipped package from the company level Procore Analytics tool (via Procore Analytics > Getting Started > Connection Options > Azure).Extract the package files to a local directory.
Place Delta Sharing file:
Copy your *.share Delta Sharing profile file into the extracted directory.
Install Dependencies
Open a terminal in the package directory.
Run the following command to install the required Python dependencies:
pip install -r requirements.txt
Generate Configuration
Generate the config.yamlfile by running:
python user_exp.py
The script will prompt you to enter credentials such as:
Tables
Database name
Host
Additional credentials..
The configuration can be reused or updated manually or by re-running python user_exp.py.
Azure CLI Setup
Log in to Azure.
Run the following command to log in:
az loginVerify Azure Account:
az account show
If the _az_command is not available, install the Azure CLI by following the instructions found here: Microsoft Learn.
Install Azure Functions Core Tools
Go to Microsoft Learn to for instructions on installing Azure Functions Core Tools.
Prepare the Azure Function
Use the Azure Portal guide to create the following:
A function app
A resource group
Consumption plan
Storage account
Set Custom Cron schedule (Optional).
Open function_app.py in an editor.
Locate the line: @app.timer_trigger(schedule="0 0 */8 * * *",
Replace the schedule with your custom Cron expression and save the file.
Deployment
Open a terminal in the package directory (adls_azure_function).
Run the following deployment command:
func azure functionapp publish --build remote --python --clean
Replace with the name of your Azure function app in your Azure subscription.
Validation
Ensure the deployment is successful by checking the Azure Portal for your function app status.
Monitor logs to verify that the function is executing as expected.