Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

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

Open hydac-adameco opened 5 months ago

hydac-adameco commented 5 months ago

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

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):

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

Issue script & Debug output

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

{
  "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

Environment Summary

azure-cli 2.55.0

Additional context

No response

azure-client-tools-bot-prd[bot] commented 5 months ago

Hi @hydac-adameco,

2.55.0 is not the latest Azure CLI(2.58.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 5 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 5 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

hydac-adameco commented 5 months ago

Furthermore I am missing the ability to add username and password for the external git.

microsoft-github-policy-service[bot] commented 4 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

abdul561 commented 2 months ago

Is there any updates to this? Im having similar issues because of this? @AnatoliB @Francisco-Gamino @yonzhan