Closed Peter-Juhasz closed 2 months ago
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 Thanks for the workaround! It worked!
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.
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
🤦♂️In my case it was because I had a "*" in a path in the "staticwebapp.config.json" file and I just can saw
"routes": [
{
"route": "*",
"allowedRoles": ["authenticated"]
},
...
I replace it with :
"routes": [
{
"route": "/",
"allowedRoles": ["authenticated"]
},
...
By the way, in the documentation it says that we can use "/*" but this causes it to fail too
(I could only realize because I recorded the screen in slow motion, the log that appears in the console too quickly)
I see that this is now resolved - thanks for the community for jumping in!
Describe the bug
Deploy fails with no feedback.
To Reproduce
Output:
The CLI exits here without any other message, no error either.
Azure Portal shows "Uploading":
Expected behavior Like any feedback from the app why it fails?
Device info (if applicable):
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.