Question

Difficulty: MediumConfigure Azure App Service Web Apps

You need to configure local Git deployment for a new Azure App Service web app. Which sequence of steps should you perform? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order.

  1. 1Configure subscription-level deployment credentials using the Azure CLI command `az webapp deployment user set`.
  2. 2Enable local Git deployment on the Azure App Service web app using the `az webapp deployment source config-local-git` command.
  3. 3Add the Azure Git clone URL as a remote named `azure` in your local repository using `git remote add azure <git-clone-url>`.
  4. 4Deploy the application code to the Azure web app by running `git push azure main`.

Answer

First, configure subscription-level deployment credentials with `az webapp deployment user set`. Second, enable local Git deployment on the web app using `az webapp deployment source config-local-git` to obtain the clone URL. Third, add the clone URL as a local remote named `azure` using `git remote add`. Finally, deploy the application code by running `git push azure main`.
The correct sequence begins by configuring subscription-level credentials with `az webapp deployment user set`. Once credentials are set, the next step is to enable local Git deployment on the target web app using `az webapp deployment source config-local-git`, which provides the Git repository clone URL. This URL is then added as a remote endpoint to the local Git repository using `git remote add azure`. Finally, the application code is deployed by pushing the local branch to the remote using `git push azure main`.

Step-by-Step Solution

1
Run the command `az webapp deployment user set --user-name <username> --password <password>`.
Subscription-level deployment credentials are created or updated.
Azure App Service local Git deployment requires authentication credentials configured at the subscription level to authenticate the push operation.
2
Run the command `az webapp deployment source config-local-git --name <app-name> --resource-group <group-name>`.
Local Git deployment is enabled for the web app, and the Git repository URL is returned.
This establishes the remote Git endpoint inside Azure App Service for receiving deployments.
3
Run the command `git remote add azure <git-clone-url>` locally.
The local Git repository is configured with a new remote target named `azure`.
This registers the Azure repository endpoint as a remote branch source inside the local Git repository.
4
Run the command `git push azure main` locally.
The code is transferred, built, and deployed to the Azure App Service web app.
Pushing the commits to the `azure` remote triggers the server-side deployment engine (Kudu) to deploy the app.

Key Concept

Configuring local Git deployment for an Azure App Service web app requires setting deployment credentials, enabling the Git repository on the web app, configuring a local git remote pointing to the Azure Git URL, and pushing the code to trigger the build.
Rate this question