Azure / Azure/functions-action

functions-action hangs when /api/deployments/latest returns stale incomplete deployment

Open
#300 0 comments 0 reactions 0 assignees View on GitHub
need-to-triage
Dominant language
TypeScript
Stars
184
Forks
92
PR merge metrics
No merged PRs in 30d

Description

### Description

We encountered a case where `Azure/functions-action@v1` hung indefinitely during ZIP deploy, even though the Azure Function deployment had completed successfully.

After investigation, the root cause was a stale, incomplete deployment record in Kudu. The action appears to rely on `/api/deployments/latest` for polling deployment status. In our case, that endpoint returned an older, incomplete deployment (status = 1, complete = false) instead of the newly triggered deployment, causing the action to wait forever.

### Environment

- Azure Functions (Linux Consumption plan)
- Deployment method: ZIP Deploy via `Azure/functions-action@v1`
- Remote build disabled:
- `scm-do-build-during-deployment: false`
- `enable-oryx-build: false`

### Symptoms

GitHub Action output:

`Package deployment using ZIP Deploy initiated.`

However, the job never completed.

Meanwhile, Azure showed the deployment as successful:

```json
{
"status": 4,
"complete": true,
"end_time": "...",
"last_success_end_time": "..."
}
```

The root cause was found by calling: `GET https://.scm.azurewebsites.net/api/deployments/latest
`, which returned an older deployment:

```json
{
"status": 1,
"progress": "Running oryx build...",
"complete": false,
"end_time": null
}
```

This was a stale Oryx deployment that had never completed.

The new deployment (status = 4, complete = true) existed in `/api/deployments`, but `/latest` continued to return the incomplete record.

Because the action seems to poll `/latest`, it waited indefinitely for completion.

### How we fixed it

Deleting the stale deployment record via:

`DELETE /api/deployments/`

immediately resolved the issue.

After deletion:

`/api/deployments/latest` returned the correct (successful) deployment, and then the GitHub Action completed normally.

### Expected Behavior

The action should not hang indefinitely if `/latest` resolves to a stale, non-terminal deployment record unrelated to the currently triggered deploy.

#### Possible improvements:

Poll the specific deployment ID returned from the ZIP deploy call instead of relying on `/latest`

Or ignore unrelated stale incomplete deployments.

I am happy to provide any additional logs if helpful.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.