Skip to content

Latest commit

 

History

History
102 lines (64 loc) · 3.36 KB

Set_up_local_database.md

File metadata and controls

102 lines (64 loc) · 3.36 KB

Guide: Set up local database

Overview

To run the Service Insights application on your local machine you will need to set up a local 'ServiceInsightsDB' database.

Podman is a free and open source tool for developing, managing, and running containers. This guide uses Podman to run a containerised instance of Microsoft Azure SQL Edge.

Prerequisites

Key files

Steps

  1. Ensure Podman is installed

    podman -v
  2. Ensure that the Podman virtual machine is running

    podman machine start
  3. Run the container

    podman run --name azuresqledge -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=YOUR_PASSWORD' -p 1433:1433 -d mcr.microsoft.com/azure-sql-edge

    Replace YOUR_PASSWORD with a password of your choice. It must comply with the SQL Server password complexity policy.

  4. Verify that the container is running

    podman container list -a
  5. Connect to the database server in Azure Data Studio

    • Server: localhost
    • User name: SA
    • Password: YOUR_PASSWORD
  6. Create the database by running the query found in create_database.sql in Azure Data Studio

  7. Create the database tables by running the query found in create_tables.sql in Azure Data Studio

  8. Update the ServiceInsightsDbConnectionString environment variables found in the local.settings.json files, replacing YOUR_CONNECTION_STRING with

    Server=localhost,1433;Database=ServiceInsightsDB;User Id=SA;Password=YOUR_PASSWORD;TrustServerCertificate=True

    Remember to also replace YOUR_PASSWORD in the connection string with the password you set in step 3.

Going forward

Going forward, to start up your Podman container you will just need to start the Podman virtual machine and start your container.

podman machine start
podman container start azuresqledge

Troubleshooting

If the Podman container stops shortly after starting then try:

  • Checking that your MSSQL_SA_PASSWORD complies with the password complexity policy

  • Restarting the Podman virtual machine

    podman machine stop
    podman machine start
  • Recreating the Podman container

  • Allocating extra resources to the Podman virtual machine

  • Completely uninstalling Docker if it is installed

  • Reinstalling Podman

If you cannot connect to the ‘localhost’ server, either update your hosts file to map the ‘localhost’ hostname to the IP address ‘127.0.0.1’, or use ‘127.0.0.1’ as the server name instead of ‘localhost’.