How To Implement the Git Deployment

Now that you have set up your local git repository, you need to add Azure as a remote for our local repository.

Once you have configured Azure as Git’s remote repository, you will be able to deploy our .NET Core Application.

In this task, you will configure your Azure Web App to be the remote for your local Git repository and verify that Azure has completed the deployment.

  1. Open your web browser and navigate to the Azure portal https://portal.azure.com
  2. On your Azure dashboard, open a blade for the Web App that you created earlier in this lab.
  3. On the left navigation pane, under DEPLOYMENT, click Deployment credentials.
  4. Enter a Username and Password.The Username and Password that you specify as your Deployment credentials will be stored with your Azure account. You will use these credentials when you complete a Git or FTP deployment to Azure.
  5. DeploymentCred
  6. On the left navigation pane, under DEPLOYMENT, click Deployment options.
  7. On the Deployment option blade, click Chose Source, and then click Local Git Repository.
  8. To save your changes, click OK.Don’t worry about the performance test option.
  9. On the left navigation pane, click Overview.
  10. Notice that the Essentials pane includes a new value for Git/Deployment username and Git clone url.We will be using the values assigned to these settings to complete the upcoming steps in Visual Studio Code.pets1
  11. Switch to Visual Studio Code.
  12. On the View menu, click Integrated Terminal.The Integrated Terminal panel in Visual Studio Code enables you to enter commands in a way that is similar to using a command prompt.
  13. In the Terminal panel, at the command prompt, type git remote add azure and then press Space.
  14. Paste-in the value of the Git clone url that you copied from your Azure dashboard, and then press Enter.Your command should be similar to the following example: “git remote add azure https://petswithhats.scm.azurewebsites.net:443/petswithhats.git”With this step completed, you have added a remote repository named “azure” and specified the location of the remote repository. The name “azure” that you specified describes that the location is in Azure, it is not a keyword representing Azure.

    Note: Git supports the creation of additional remote repositories using the “git remote add ” command. This can be useful when considering more advanced scenarios, such as deploying code revisions to a staging site before releasing to a production environment.

  15. At the command prompt, type git push azure master and then press Enter.This command initiates a Git push operation to push the file to the remote. Azure will now deploy your code and check for the server.js file.Note: When you enter the Git push command, you will be prompted to enter the Username and Password that you set up when you configured your Deployment credentials in Azure. If the password characters are not be displayed as you type them, don’t worry, they will be recognized.

    deployment

  16. Examine the output displayed in the Terminal panel.
  17. Navigate to the URL for your site. Your Web site should now be displaying your application!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.