Azure / Azure/static-web-apps

CLI deployment fails without error message

Open
#999 0 comments 0 reactions 0 assignees View on GitHub
swa-cli
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

A clear and concise description of what the bug is.

I have static web content in `web` folder and a TypeScript function api in `api` folder.

If I set `swa-cli.config.json` to

```json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"link-shortener-demo": {
"appLocation": "web"
}
}
}
```

and then run `swa deploy --verbose silly` (with the deployment token set in environment variable) then the deployment succeeds (I see the updated time in the Azure portal) and I get the following output:

```
ℹ Verbose logging enabled
ℹ Build timeout not specified, defaulting to 15 minutes
ℹ App Directory Location: '/workspaces/link-shortener-demo' was found.
ℹ config_file_location: config file '/workspaces/link-shortener-demo/web/staticwebapp.config.json' was found.
ℹ Looking for event info
ℹ Event info parsed from action options.
ℹ Could not get repository branch. Proceeding
ℹ Could not get repository url. Proceeding
ℹ Skipping step to build /workspaces/link-shortener-demo with Oryx
ℹ No Api directory specified. Azure Functions will not be created.
ℹ Didn't find Oryx manifest file under location: /workspaces/link-shortener-demo/ss-oryx/app-manifest/oryx-manifest.toml
ℹ Determined default file to be: index.html
ℹ Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
ℹ Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
ℹ Zipping App Artifacts
ℹ App Zip will be created from directory: /workspaces/link-shortener-demo/web
ℹ Done Zipping App Artifacts
ℹ Uploading build artifacts.
ℹ Skipping function upload as functions are identical to last successful deployment.
ℹ Finished Upload. Polling on deployment.
ℹ Status: InProgress. Time: 0.0814267(s)
ℹ Status: Succeeded. Time: 15.1236171(s)
ℹ Deployment Complete :)
ℹ Thanks for using Azure Static Web Apps!
✔ Project deployed to https://brave-glacier-0483ec803-preview.westeurope.2.azurestaticapps.net 🚀
```

If I add the api to the `swa-cli.config.json`:

```json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"link-shortener-demo": {
"appLocation": "web",
"apiLocation": "api",
"outputLocation": ".",
"apiBuildCommand": "npm run build --if-present"
}
}
}
```

and re-run the `swa deploy --verbose silly` step then I see the following output:

```
ℹ Verbose logging enabled
ℹ Build timeout not specified, defaulting to 15 minutes
ℹ App Directory Location: '/workspaces/link-shortener-demo/web' was found.
ℹ config_file_location: config file '/workspaces/link-shortener-demo/web/staticwebapp.config.json' was found.
ℹ Looking for event info
ℹ Event info parsed from action options.
ℹ Could not get repository branch. Proceeding
ℹ Could not get repository url. Proceeding
ℹ Skipping step to build /workspaces/link-shortener-demo/web with Oryx
ℹ Api Directory Location: '/workspaces/link-shortener-demo/api' was found.
ℹ Didn't find Oryx manifest file under location: /workspaces/link-shortener-demo/ss-oryx/app-manifest/oryx-manifest.toml
ℹ Determined default file to be: index.html
ℹ Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
ℹ Skipping step to build /workspaces/link-shortener-demo/api with Oryx
ℹ Function Runtime Information. OS: linux, Functions Runtime: ~4, node version: 16
ℹ Zipping Api Artifacts
ℹ Api Zip will be created from directory: /workspaces/link-shortener-demo/api
ℹ Api Content Hash: 033f89ce006af1392f07dcc6a045ab26
ℹ Done Zipping Api Artifacts

ℹ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
ℹ If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
```

Note that there is no output indicating that the content has been uploaded (and the site has _not_ been updated).

**To Reproduce**
Steps to reproduce the behavior:
see description above

Source repo: https://github.com/stuartleeks/link-shortener-demo

**Expected behavior**
I expect the `swa deploy` command to complete successfully with the api configuration included, and for the update to show in the Azure Portal.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Device info (if applicable):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

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.