Issue connectiong Azure Django Web App to Azure SQL Database?

Denise Wong 1 Reputation point
2020-08-12T09:33:14.23+00:00

I'm having an error connecting my Azure Django Webapp to my Azure SQL database.

Accessing any page that makes use of this error (2013, 'Lost connection to MySQL server at \'reading initial communication packet\', system error: 104 "Connection reset by peer"').

Additionally, I have a problem connecting to the database generally. I cannot connect at all.

Using these settings:
'host':'praxeum.database.windows.net',
'user':'denise',
'password':
'database':'praxeum'
my error is 9002 (28000): The connection string may not be right. Please visit portal for references.

Using these settings:
'host':'praxeum.database.windows.net',
'user':'denise@praxeum',
'password':
'database':'praxeum'
my error is 9002 (28000): The server name you tried cannot be found. Please use the correct name and retry. Please check your server name praxeum.

Thank you so very much.

Azure SQL Database
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,269 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anurag Sharma 17,586 Reputation points
    2020-08-12T10:08:47.77+00:00

    Hi @Denise Wong , Can you please try the user property in the format: 'denise@praxeum.database.windows.net' once?

    If this does not work out, could you please attach the code file, and we shall have a deeper look into it?

    Thanks,

    0 comments No comments

  2. Ronen Ariely 15,101 Reputation points
    2020-08-12T10:21:29.33+00:00

    Good day,

    Note: Django official forum is probably your best place for discussing the Django framework and applications that use it.

    In the mean time, please check if this tutorial help you (note that the QnA system messed up the link! copy it fully instead of click it)

    https://medium.com/@__pamaron__/deploy-a-django-application-connected-to-azure-sql-using-docker-and-azure-app-service-a2c107773c11

    And you might get some of the basics from this document even so it is using PostgreSQL instead of Azure Database:

    https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app?tabs=bash%2Cclone

    0 comments No comments

  3. Denise Wong 1 Reputation point
    2020-08-12T12:09:59.97+00:00

    Unfortunately 'denise@praxeum.database.windows.net' doesn't work.

    settings.py
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'praxeum',
    'USER': 'denise@praxeum',
    'PASSWORD': '{}',
    'HOST': 'praxeum.database.windows.net',
    'PORT': '1433',}

    }

    I'll have a look at the links, thank you so very much!

    0 comments No comments