Azure / Azure/azure-functions-core-tools

`func azure functionapp publish` needs to be executed twice for it to work properly.

Open
#4,140 8 comments 1 reaction 0 assignees View on GitHub
needs-investigation potential-bug
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

### Version

4.0.6543

### Description

I've to execute` func azure functionapp publish` twice to make it work. The first time, it said following but didn't provide any invoke URL.

```
Upload completed successfully.
Deployment completed successfully.
Functions in myFunctionName:
```

Then, I immediately executed ` func azure functionapp publish` for second time and I got an actual invoke url:

```
Getting site publishing info...
[2024-11-01T06:32:18.712Z] Starting the function app deployment...
Creating archive for current directory...
Uploading 633,74 KB [#########################################################################]
Upload completed successfully.
Deployment completed successfully.
Functions in myFunctionName:
FuncFromCli - [httpTrigger]
Invoke url: https://efzzgfjrmefcw.azurewebsites.net/api/funcfromcli
```

### Steps to reproduce

Created a function using Terraform v1.9.7 and and AzureRM provider v4.6.0 with following settings:

```
resource "azurerm_linux_function_app" "example" {
name = random_string.random_name.result
resource_group_name = data.azurerm_resource_group.rg.name
location = data.azurerm_resource_group.rg.location
service_plan_id = azurerm_service_plan.example.id

storage_account_name = azurerm_storage_account.example.name
storage_account_access_key = azurerm_storage_account.example.primary_access_key

site_config {
application_stack {
node_version = "20"
}
}
}
```

After successful deployment from Terraform, I went to my function's code folder and ran this ` func azure functionapp publish myFunctionName`

Contributor guide

Open the contributing guide

Research direction

Start with the `func azure functionapp publish` command and reproduce the first and second deployments using the Terraform configuration and AzureRM settings shown. Compare the deployment logs and function discovery results; done means the first successful publish reports the function and its invoke URL without requiring a second run.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, node.js, terraform
Domain
cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.