Azure / Azure/azure-functions-core-tools

Azure Functions Core Tools v4 requires AzureWebJobsStorage for "publish" command

Open
#2,915 1 comment 0 reactions 0 assignees View on GitHub
investigate
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

Since Gitlab pipeline doesn't have a job for deploying Azure Function unlike Azure DevOps, I use bash scripts to deploy our Azure Function from Gitlab pipeline.

```yaml
script:
- curl -sL https://aka.ms/InstallAzureCLIDeb | bash
- wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
- mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
- wget -q https://packages.microsoft.com/config/debian/11/prod.list
- mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
- chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
- chown root:root /etc/apt/sources.list.d/microsoft-prod.list
- apt-get update && apt-get -y install --no-install-recommends azure-functions-core-tools-3
- az login --service-principal -u $APPLICATION_ID -p $APPLICATION_SECRET --tenant $TENANT_ID
- func azure functionapp publish $FUNCTION_APP --custom
```
(The entire pipeline code is [here](https://github.com/Azure-Samples/azure-function-custom-handler-with-golang/blob/main/pipelines/.gitlab-ci.yml).)

However when I change the version of azure-function-core-tools from **3** to **4**, I start to have `Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid`. (azure-function-core-tools-3 works well without `AzureWebJobStorage`)

In my case, since I use this command in the pipeline I can not have local.settings.json.

This is the pipeline screenshot with azure-function-core-tools-4 (ERROR)
![image](https://user-images.githubusercontent.com/53926778/150239203-c4fbad56-7fc1-4f71-8b0a-1af0d912f202.png)

And this is the pipeline screenshot with azure-function-core-tools-3 (SUCCESS)
![image](https://user-images.githubusercontent.com/53926778/150239248-68b771ee-f523-470e-b590-0637b3687213.png)

Contributor guide

Open the contributing guide

Research direction

Start with the pipeline in pipelines/.gitlab-ci.yml and compare the azure-function-core-tools-3 and -4 installation and func azure functionapp publish commands. Reproduce the v4 failure in the GitLab pipeline and determine why publishing requires AzureWebJobsStorage; done means the documented publish workflow works without local.settings.json.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, gitlab, shell
Domain
cli, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.