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

Deploy fails with no feedback, application is not deployed, stuck in "Uploading" forever

Open Peter-Juhasz opened this issue 1 year ago • 4 comments

Describe the bug

Deploy fails with no feedback.

To Reproduce

swa deploy --deployment-token REDACTED

Output:

Welcome to Azure Static Web Apps CLI (1.1.7)

Deploying front-end files from folder:
  C:\REDACTED\dist

Consider providing api-language and version using --api-language and --api-version flags,
    otherwise default values apiLanguage: node and apiVersion: 16 will apply

Deploying to environment: preview

Deploying project to Azure Static Web Apps...

The CLI exits here without any other message, no error either.

Azure Portal shows "Uploading":

image

Expected behavior Like any feedback from the app why it fails?

Device info (if applicable):

  • SWA: 1.1.7
  • OS: Windows 11 23H2 22631.3296
  • Node: 20.5.0

Additional context The application is very simple, consists of an html file, and a css file.

The SWA resource was just created, completely new, there was nothing deployed earlier.

Peter-Juhasz avatar Mar 17 '24 09:03 Peter-Juhasz

Had the exact same problem and when I investigated the logs, one line caught my eye: ℹ Current directory cannot be identical to or contained within artifact folders.

So I just navigated one directory up and then ran: swa deploy --env production -a .\frontend and now it was successfully deployed 😃

lstorka avatar Mar 19 '24 09:03 lstorka

@lstorka Thanks for the workaround! It worked!

Peter-Juhasz avatar Mar 19 '24 19:03 Peter-Juhasz

The workaround works.

If you run the successful command but with --dry-run added you will see information still suggesting an error:

i Could not get event info. Proceeding i The content server has rejected the request with: BadRequest i Reason: Missing request content.

Also, if you navigate up two directories: swa deploy --env production -a .\dist\frontend it stops working again. The CLI just returns to command prompt without writing the success message "Project deployed". No warning or errors are given.

coder925 avatar Mar 25 '24 16:03 coder925

Setting the variables in the config file and having the proper folder structure is key. BTW, I'd recommend always running the cli with the --verbose silly switch.

I just wrapped up a blog post that could help shed some light on this. Using Azure Functions with Astro and Entra ID Authentication

conradagramont avatar Apr 23 '24 02:04 conradagramont