Azure / Azure/static-web-apps-cli

Deploying to production environment not working as expected

Open
#785 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
668
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).

**Are you accessing the CLI from the default port `:4280` ?**

- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [ ] Yes, I am accessing the CLI from port `:4280`
- [x] Yes, default port, but I'm not using the port at all

> Make sure you are accessing the URL printed in the console when running `swa start`!

**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**
- ✅ Setting no environment with the `--env` option deploys to preview environment. **That's fine.**
- ❌ Setting environment to "Production" deploys to preview environment called "production". **NOT fine.**
- ❌ Setting environment to "production" deploys to preview environment called "production". **NOT fine.**
- ✅ Only setting environment to "prod" deploys to the production environment. **That's fine, but not documented.**

**To Reproduce**
Steps to reproduce the behavior:

1. Go to your app folder
2. Type in command 'swa deploy ./dist --env production'
3. It deploys without problem, but to a preview environment called "production"

**Expected behavior**
Looking at the documentation, I expect that setting the environment to "production" deploys the app to the production environment. I also expect that setting the environment to "Production" produces the same outcome (see #518). I'm fine with using "prod" as environment option, but this should be clearly documented then, otherwise I consider this is a bug, that cost me many hours debugging.

**Screenshots**
See screenshots in #518

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

- OS: Docker image **node**
- Version: **lts-bullseye**

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.