1

What is the right syntax for running git clone command on an Azure function powershell 7.0?

Im trying with: git clone <repo https>

and also adding the path at the end git clone <repo https> /.

i get the following error message:

`Command 'starter.cmd git clone https ...' was aborted due to no output nor CPU activity for 60 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.`

*Update:

Also tried with git clone https://username:password@github.com/username/repository.git

Cloning into ''... fatal: unable to access 'https://github.com//.git/': URL using bad/illegal format or missing URL

I haven't found any documentation on this... is it even possible?

ecraig12345
  • 2,328
  • 1
  • 19
  • 26
  • Regarding your first error message - https://stackoverflow.com/questions/26596968/azure-webjob-timeout-configuration-settings – Daniel Jul 02 '21 at 04:42

1 Answers1

1

I'd first ask what you're trying to achieve by doing this as it's a bit of an odd scenario and there may be a better way of cloning a repo as part of a pipeline and publishing the content with your Function.

If you really must go this route I would look at downloading the repo/branch content with Invoke-RestMethod/Invoke-WebRequest instead and unpacking to the underlying directory structure.

Invoke-WebRequest -Uri 'https://github.com/$owner/$repo/archive/$branch.zip' -OutFile '$repo.zip'

or using the .NET approach like Matthias pointed out in this response: https://stackoverflow.com/a/48547954/12040634

BrettMiller
  • 946
  • 2
  • 5
  • 12