-
Notifications
You must be signed in to change notification settings - Fork 359
Publish to Azure Website using Git
🎵Note: This documentation is outdated at this point, especially when using the Node tools in Visual Studio 2017. We're working on update docs, and will redirect you to those when they're ready.
Visual Studio 2013 has integrated Git support, so it's easy to deploy to Azure using Git, no command-line necessary.
🎵Note: Git integration is also available for Visual Studio 2012 as an extension on the Visual Studio gallery.
From the Azure portal, create a new Website.
Click on the newly created Website, and choose Set up deployment from source control.
Then select Local Git Repository.
The URL to the repository can be copy/pasted from the portal.
In Visual Studio, create a new Node.js project or load an existing project which isn't associated with source control.
🎵Note: Git deployment to Azure does not require the use of the Azure project types. You may want to use them anyway, as you get a default web.config which you can configure. If you Git deploy a project without a web.config, Azure will detect that it's a Node.js application and use an appropriate web.config for it.
Select File->Add to Source Control.
Then select Git as the source control system.
A Git repository will be created for your solution. It will be listed in the Team Explorer window, under Local Git Repositories.
From Team Explorer, click on the Home button on the toolbar. You may see a prompt to install Git command prompt tools. You may choose to install them, but they are not necessary.
Click on Changes to see your pending changes. Review the files that will be included in the commit, enter a comment and click Commit.
🎵Note: When using Git, by default the node_modules are checked in to the repository. You can choose to exclude it from the repository. When Azure detects a new deployment, it will automatically npm install the modules specified in package.json on the Azure machine.
Once it's done, you'll see a notification for your commit.
In the notification message, click Sync to bring up the Unsynced Commits page.
Enter the URL for the Git repository, as displayed in the Azure Portal. Click Publish. Enter your credentials when prompted.
The Deployments page for your Website will show the commit information.
You can click the Browse button at the bottom of the Deployments page to navigate to your site.