@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.