Skip to content
Star
478
Star
478

SQL Writer

This guide shows you how to work with Azure SQL Database locally using Azure Functions and SQLAlchemy. This lab demonstrates how to process HTTP POST requests and persist data into a local SQL database.

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Start Azurite: From the Command Palette, select Azurite: Start Blob Service. This starts the local blob storage emulator required by the Azure Functions runtime.

  3. Start Function Host:

    Terminal window
    func start
  4. Run the Example:

    Terminal window
    python main.py

This lab includes a pre-configured connection profile for the SQL Server (mssql) extension in .vscode/settings.json.

  1. Open the SQL Server extension in VS Code.
  2. Select the Azure SQL Edge (Local) connection profile.
  3. Run the following query to verify the data:
    SELECT * FROM Users;
Terminal window
docker compose down -v
IssueSolution
ImportError: libodbc.so.2Run scripts/setup-mve.sh to install ODBC system dependencies.
AzureWebJobsStorage errorEnsure Azurite Blob Service is started (Azurite: Start Blob Service) and port 10000 is available.