Subject: Assistance Needed – Create Django Superuser (Azure App Service)

Damion Barrett 20 Reputation points
2026-01-15T08:28:00.0566667+00:00

I am deploying a Django backend on Azure App Service. The application is running, but SSH/Kudu instability during startup has prevented me from reliably running python manage.py createsuperuser.

I need assistance creating a Django superuser for the production database so I can access the Django admin.

Please let me know if you can:

Temporarily run createsuperuser on my behalf, or

Provide the recommended Azure-supported method to create a Django superuser when SSH is unstable.

Thank you for your help.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

Answer accepted by question author
  1. Praneeth Maddali 4,525 Reputation points Microsoft External Staff Moderator
    2026-01-16T18:14:20.1833333+00:00

    Hi @Damion Barrett ,

    Thank you for reaching out. I'm sorry to hear you're experiencing issues with SSH/Kudu during startup. Due to access restrictions, we aren't able to run the createsuperuser command for you, but you can use the Azure App Service Console, which is more reliable than SSH, to set up your Django superuser for the production database.

    Steps to Create a Superuser

    1. Open your App Service in the Azure portal and go to Development Tools > Console.
    2. Use cd /home/site/wwwroot to navigate to your app directory.
    3. Run python manage.py migrate to update your database.
    4. Then, run python manage.py createsuperuser and enter the required details.

    Afterward, log into your Django admin at using your new credentials. The Console is stable and remains available even after restarts.

    Reference:

    https://learn.microsoft.com/en-us/azure/app-service/quickstart-python?tabs=flask%2Cwindows%2Cazure-cli%2Cazure-cli-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli

    https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app-django?tabs=copilot&pivots=azure-portal

    https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#access-files-via-console

    https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app-flask?tabs=copilot&pivots=azure-portal

    https://learn.microsoft.com/en-us/azure/app-service/resources-kudu

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-01-15T08:28:08.9733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To create a Django superuser in a production environment on Azure App Service, especially when facing SSH instability, you can follow these steps:

    1. Use the Azure App Service Console: Instead of SSH, you can use the Azure App Service Console, which is accessible through the Azure portal. Here’s how:
      • Go to your Azure App Service in the Azure portal.
      • In the left menu, select Development Tools > Console.
      • In the console, navigate to your application directory if necessary.
      • Run the command python manage.py createsuperuser directly in the console.
    2. Run Migrations First: Ensure that you have run any necessary migrations before creating the superuser. You can do this in the same console with python manage.py migrate.
    3. Environment Variables: Make sure that your environment variables are set correctly, as they might affect the command execution.
    4. Alternative Methods: If the console method is also unstable, consider creating a management command that creates a superuser automatically and running it once your app starts. This can be done by creating a custom management command in your Django app.

    These methods should help you create a superuser without relying solely on SSH.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.