Setup Web app deployment settings with a script

MoTaar 310 Reputation points
2024-02-14T22:38:10.04+00:00

Hello, can you help out on the script that set up the deployment setting for a web app. In my case I trying to connect it to an Azure devops Branch. Thank you! Screenshot that shows how to choose the deployment source.

Windows for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Windows for business Windows Server User experience PowerShell
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2024-02-15T11:10:00.4533333+00:00

    @MoTaar Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on the shared information, I understand that you are looking for a script to update the source control settings of your app service with AzureRepos.

    You achieve this by using the Azure CLI cmdlet az webapp deployment source config

    az webapp deployment source config --branch {branchName} --repo-url {repo-Url} -g {ResourceGroupName} -n {WebAppName} --manual-integration $false
    

    Alternatively, you can add the source controls using the Azure Management Create or Update Source Controls Rest API with below Request body.

    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web?api-version=2022-03-01
    
    {
      "properties": {
        "repoUrl": "<Repo_Url>",
        "branch": "<BranchName>",
        "isManualIntegration": false,
        "isGitHubAction": false,
        "isMercurial": false
      }
    }
    

    Request body:

    {
    "properties": {
    "repoUrl": "<Repo_Url>",
    "branch": "<BranchName>",
    "isManualIntegration": false,
    "isGitHubAction": false,
    "isMercurial": false
    }
    }
    

    Hope this helps, let me know if you have any further questions on this.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.


1 additional answer

Sort by: Most helpful
  1. Silvia Wibowo 6,041 Reputation points Microsoft Employee Volunteer Moderator
    2024-02-15T03:49:12.8233333+00:00

    Hi @MoTaar , as you want to use Azure DevOps, you need to select Azure Repos, which refers to Azure Repository inside Azure DevOps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.