static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

Invalid environment value deploys to production

Open Ensar025 opened this issue 3 years ago • 1 comments

Using SWA version: 1.0.1

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
  • [x] Yes, I am accessing the CLI from port :4280

Describe the bug Deploying the SWA using swa deploy --app-location ./packages/frontend --api-location ./packages/api --env no-src deploys to Production even though it gives an error saying ✖ The environment name provided has invalid character(s). Valid characters are 0-9, a-z, and A-Z.

Screenshot of terminal when executing the command (I also included a date to show that it is around that timeframe. Laptop is kind of slow so it takes a bit to execute the script): image

Screenshot of Azure SWA environments: image

To Reproduce Steps to reproduce the behavior:

  1. Create SWA app
  2. Type in command swa deploy --app-location ./packages/frontend --api-location ./packages/api --env no-src
  3. See error: ✖ The environment name provided has invalid character(s). Valid characters are 0-9, a-z, and A-Z
  4. View Azure dashboard and see deployment to Production is in progress

Expected behavior A deployment to Production should not happen if the environment name variable syntax is wrong

Desktop (please complete the following information):

  • OS: macOS
  • Version 12.2.1

Ensar025 avatar May 24 '22 13:05 Ensar025

Thanks @Ensar025 for pointing this out, we will look into this.

sgollapudi77 avatar May 25 '22 20:05 sgollapudi77