Azure / Azure/static-web-apps-cli

Deploy failing without any additional info

Open
#781 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
668
Forks
156
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When I try to deploy static files to a SWA that have been deployed to before via Azure DevOps the CLI fails (silently unless I add `--dry-run`). I tried to detach the SWA but got the same result.

```pwsh
C:\repos\Arkitektur> swa deploy --env production --deployment-token $env:SWA_CLI_DEPLOYMENT_TOKEN --dry-run --verbose=silly
```


```pwsh
Welcome to Azure Static Web Apps CLI (1.1.6)

Getting config file options from "swa-cli.config.json"...
(node:18256) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Changed directory to C:\repos\Arkitektur
Using configuration "arkitektur" from file:
C:\repos\Arkitektur\swa-cli.config.json

***********************************************************************
* WARNING: Running in dry run mode. This project will not be deployed *
***********************************************************************

Resolving outputLocation=Site full path...
Deploying front-end files from folder:
C:\repos\Arkitektur\Site

Consider providing api-language and version using --api-language and --api-version flags,
otherwise default values apiLanguage: node and apiVersion: 16 will apply
Deployment token provided via flag
- --deployment-token:

Deploying to environment: production

Trying to read workflow config with values:
- appLocation: C:\repos\Arkitektur\Site
- outputLocation: C:\repos\Arkitektur\Site
- apiLocation:
- dataApiLocation:
No workflow config folder found at C:\repos\Arkitektur\Site\.github\workflows
Validating user workflow config (BEFORE):
- appLocation: C:\repos\Arkitektur\Site
- outputLocation: C:\repos\Arkitektur\Site
- apiLocation:
- dataApiLocation:
Validating user workflow config (AFTER):
- appLocation: C:\repos\Arkitektur\Site
- apiLocation:
- outputLocation: C:\repos\Arkitektur\Site
- dataApiLocation:
Loading staticwebapp.config.json schema...
Schema loaded successfully from https://json.schemastore.org/staticwebapp.config.json
Compiling schema...
Reading content from staticwebapp.config.json...
Parsing staticwebapp.config.json...
Validating staticwebapp.config.json...
File validated successfully. Continuing with configuration!
Content parsed successfully

Found configuration file:
C:\repos\Arkitektur\Site\staticwebapp.config.json

Deploying project to Azure Static Web Apps...
Fetching release metadata for version: stable. Please wait...
- version: stable
- buildId: 1.0.024941
- publishDate: 2023-10-31T04:54:50.5527205Z
- files:
- linux-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/linux/StaticSitesClient
- sha: bea23499732d615698baf4c9dcafe717fdd4ba8344f2d96740233b0380df79b6
- win-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/windows/StaticSitesClient.exe
- sha: a93aa5ec2a17280f3c9c8252948f8c68050c8852770322758ffa3187b6bce1dd
- osx-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/macOS/StaticSitesClient
- sha: 57ea66c930aafbf4dea82216e51128b3315ec2db3ab385d41e8d912a3adab2c0
Local client binary is up to date. Skipping download.
Deploying using C:\Users\oskkli\.swa\deploy\1.0.024941\StaticSitesClient.exe@1.0.024941
Deploying using the following options:
- env:
- SWA_CLI_DEBUG: silly
- SWA_RUNTIME_WORKFLOW_LOCATION:
- SWA_RUNTIME_CONFIG_LOCATION: C:\repos\Arkitektur\Site
- SWA_RUNTIME_CONFIG: C:\repos\Arkitektur\Site\staticwebapp.config.json
- SWA_CLI_VERSION: 1.1.6
- SWA_CLI_DEPLOY_DRY_RUN: true
- SWA_CLI_DEPLOY_BINARY: C:\Users\oskkli\.swa\deploy\1.0.024941\StaticSitesClient.exe@1.0.024941
- DEPLOYMENT_ACTION: close
- DEPLOYMENT_PROVIDER: SwaCli
- REPOSITORY_BASE: C:\repos\Arkitektur\Site
- SKIP_APP_BUILD: true
- SKIP_API_BUILD: true
- DEPLOYMENT_TOKEN:
- APP_LOCATION: C:\repos\Arkitektur\Site
- API_LOCATION:
- DATA_API_LOCATION:
- CONFIG_FILE_LOCATION: C:\repos\Arkitektur\Site
- VERBOSE: true
- FUNCTION_LANGUAGE: node
- FUNCTION_LANGUAGE_VERSION: 16
ℹ DeploymentId: 2e4e99b7-0432-43d5-b266-1ae631c67d1f
ℹ Verbose logging enabled
ℹ Looking for event info
ℹ Could not get event info. Proceeding
ℹ The content server has rejected the request with: BadRequest
ℹ Reason: Missing request content.
ℹ 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/
```

The only thing that I notice is that `REPOSITORY_BASE` is `C:\repos\Arkitektur\Site` when the repo is actually at `C:\repos\Arkitektur`.

swa-cli.config.json

```json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"arkitektur": {
"appLocation": "Site",
"outputLocation": "Site",
"subscription": "",
"resourceGroup": "",
"appName": ""
}
}
}
```

**Desktop (please complete the following information):**

- OS: Windows
- Version 10

**Additional context**
I didn't try to deploy manually before I already had deployed from Azure DevOps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.