1

I am trying to deploy a webapp to Azure. I am following these directions https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/

First step, I created a webapp (Django) on the portal.

Then it says to follow the directions to configure Continuous deployment using GIT in Azure App Service. This should apparently lead to my having a local directory of Django files. https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/

So I follow those directions, installing Git, creating a local repository, adding a webpage, enabling web app repository, deploying.

The webportal now shows that I have deployed ('active' deployment). However, when I go to the web app url, what's showing is NOT what I deployed, but rather what I guess is the default Django app with its urls (login, logout, contacts).

So then I create an actual Django app in my local directory (instead of the static index.html from the directions). I commit and push it to Azure. It shows as being deployed.

The result is the same as before: the default web app is showing.

So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)

user984003
  • 28,050
  • 64
  • 189
  • 285

1 Answers1

0

Things are working as expected, but you ended up overwriting the Django app in your first the Git commit. The Continuous Deployment instructions as written are generic to any deployment, even a blank Web App.

So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)

All you need to do is git clone your repo after you've initialized your local Git repo on the Azure Web App. You've already gone through most of these steps, but I'll include them here for others who may be looking for this answer.

After you create the Django Web App from the Azure Marketplace/Gallery, scroll down to set up continuous deployment.

enter image description here

Choose Local Git repo.

enter image description here

Notice that you now have a Git Clone URL in both your Quickstart Essentials info and under All Settings >> Properties. Go ahead and copy this URL.

enter image description here

If you haven't already done so, you may need to set or reset your Deployment Credentials. You'll find this under All Settings. This will be your Git & FTP credentials. Note that this is actually the credentials for your Microsoft Account, not just this one Web App.

enter image description here

You already have Git installed from your first attempt. You should now be able to navigate to the folder you want to clone the repo into and run:

git clone <your_git_clone_url>

enter image description here

After you type in your password, you'll have a cloned repo of the Django Web App on your local system. cd into the directory and start working from there. Once you have changes, git add ., git commit, and git push them back to the repo in Azure to see your changes there.

Ryan Joy
  • 3,021
  • 19
  • 20
  • Thank you!! One thing I discovered: Create the local directory, but do NOT "git init" this. git clone into the directory. Then CD to the directory that was just added via cloning and run git init on this directory. – user984003 Sep 26 '15 at 19:01