Comcare sync with Azre Sql database

I have been trying to sync my commcare hq data to an azure sql cloud database.

*steps I took *

  • downloaded docker desktop
  • cloned the project on github
  • sucssessfully run my docker containers, tested the database connect and few commands and my comcare_sync app was running on local host.
  • successfully added a project from my commcare hq.

How i proceeded

  • To add my Azure sql database as an export database in local host admin, i named it randomly and added the connection string in this format: mssql+pyodbc://username:password@server_name.database.windows.net:1433/database_name?driver=ODBC+Driver+17+for+SQL+Server

where i got stuck at:
Running the connection returns a module error:
ModuleNotFoundError: No module named 'pyodbc'

to try and resolve,

1
in the requirements.txt file, i added
pyobdc == 5.2.0
django-pyodbc-azure ==2.1.0.0

2
I edited the Docker file.dev to:

  • Install dependencies
  • Install ODBC Driver for SQL Server
    3
    then in my terminal, i run docker-compose build and this gave me errors. "WARNING: Ignoring version 4.4.7 of celery since it has invalid metadata:"
    which meant that my PIP version could not install celery[redis]==4.4.0

i tried to troubleshoot by independently running pip install -r requirements/requirements.txt and it still couldnt install ```
celery[redis]==4.4.0

i down graded my pip version and this gave me more errors

how do i fix this

**how do i get my comcare hq to send data to my Azure database **

There are a few options but generally a python script or something is a good bet.

alternatively CommCare has a tool here that could help

https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955952/CommCare+Data+Export+Tool+DET