Post/Code

HomeAboutUsesNow

Git, Azure and Deploying a AngularJS app from VS Code.

  • If you are working behind a corporate proxy, first setup Git for this: git config --global http.proxy http://username:password@proxy:port
  • Check it looks right: git config --global --get http.proxy
  • You can also unset it: git config --global --unset http.proxy
  • In the Azure portal, select your App Service, then select Deployment Options and configure your local Git as a deployment source. Take note of your deployment credentials
  • git checkout your-branch
  • Add your azure instance as a remote via: git remote add azure https://your.provided.azure.git
  • Check that the remote added by running: git remote -v
  • Since the AngularJS app runs from the dist folder, you will need to: touch .deployment | code .deployment

    [config]
    folder = dist
    
  • You will also need to remove the dist/ line from your .gitignore
  • git add --all
  • git commit -m ".deployment for deploying from repo to Azure. Update .gitignore for this purpose. Adding /dist"
  • git push azure your-branch
  • Note that Azure deploys from the master branch by default, to change this, you can add an Azure App Setting on your App Service called deployment_branch with the name of your-branch. Remember to stop and start your App Service once this has been done.
  • Once your push has been successful, check your App Service URL.
  • Next steps: Use Deployment Slots to manage moving your Development service through Staging/UAT to Production.