Azure / Azure/azure-cli

Adding externalgit as deployment source for functionapp via CLI does not work

Open
#28,644 6 comments 0 reactions 4 assignees Claimed by @kamperiadis View on GitHub
act-observability-squad Auto-Assign Auto-Resolve azf_bug azf_reviewed bug customer-reported Functions Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

We have a **self hosted gitlab** and want to provide all required resources for a functions app by using the Azure CLI.
The Functions app is created by using `az functionapp create` command. After this I am executing the command to config the deployment source (see related command).

It looks like, the CLI automatically uses `mercurial` as git source, but I am using `externalgit`.

### Related command

```ps1
az functionapp deployment source config `
--resource-group $ResourceGroupName `
--name $FunctionAppName `
--repo-url $RepoUrl `
--manual-integration `
--repository-type externalgit `
--branch deployment
```

### Errors

Error message in the Azure Portal afterwards (in the logs of deployment sync):

```txt
abort: repository 'censored.git' not found!\n\r\nC:\Program Files (x86)\Mercurial\hg.exe pull 'censored.git' --branch 'deployment' --noninteractive
```

In the UI of Azure Portal:

![image](https://github.com/Azure/azure-cli/assets/153179903/098f64cf-b159-410d-8c0b-9c8eadd4309e)

### Issue script & Debug output

As a result of `az functionapp deployment source config` in the terminal I receive the message:

```json
{
"branch": "deployment",
"deploymentRollbackEnabled": false,
"gitHubActionConfiguration": null,
"id": "censored",
"isGitHubAction": false,
"isManualIntegration": true,
"isMercurial": true,
"kind": null,
"location": "West Europe",
"name": "censored",
"repoUrl": "censored",
"resourceGroup": "censored",
"type": "Microsoft.Web/sites/sourcecontrols"
}
```

### Expected behavior

When I add my external git source using the Azure Portal, I works perfectly and the UI looks like follows:

![Microsoft_Azure_Externalgit_Deployment](https://github.com/Azure/azure-cli/assets/153179903/027e4d5d-8534-4e06-a3eb-20e6a2fccdb9)

### Environment Summary

azure-cli 2.55.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.