Azure static web apps deploy fails via swa deploy

Sofia Louisy 40 Reputation points
2023-05-24T12:50:01.63+00:00

Hi!

I have a problem when running swa deploy that I don't manage to go around. As a start, the deployment doesn't seem to recognize that I have existing projects already. I have swa resources in azure. Before, this would prompt me a list to choose which of the swa apps to deploy to. Now, the deploy asks me if I want a new project, and if I prompt yes, it freezes.

I have tried logout login, destroying the swa and creating a new one, uninstalling and reinstalling the swa cli, but none of this have solved my issue.

Is there a cached file somewhere that I should remove?

I am using node version 16.20.0. I have to downgrade to 16 due to other bugs I bumped in to, where the solution was to downgrade node.

(.venv) sof... ..._swa$ swa deploy

Welcome to Azure Static Web Apps CLI (1.1.2)

Using configuration "rot...wa" from file:
  ..._swa/swa-cli.config.json

Deploying front-end files from folder:
  ..._swa/src

Deploying API from folder:
  ..._swa/api

Checking Azure session...
resolved tenant = 78...3af
tenantId = 78...3af
resolved tenant = 78...3af
tenantId = 78...3af
✔ Successfully logged into Azure!

Checking project settings...
resolved tenant = 78...3af
tenantId = 78...3af
resolved tenant = 78...3af
tenantId = 78...3af
✔ Would you like to create a new Azure Static Web Apps project? … yes
✔ Choose a project name: … ...-swa
⠋ Creating a new project...resolved tenant = 78...3af
tenantId = 78...3af
resolved tenant = 78...3af
tenantId = 78703d3c-b907-432f-b066-88f7af9ca3af
⠙ Creating a new project...✖ RestError
⠴ Creating a new project...


Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,174 questions
{count} votes

Accepted answer
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2023-05-25T08:47:19.6733333+00:00

    @Sofia Louisy ,

    Thanks for posting the question. Firstly, apologies for the inconvenience and frustration with this issue. I understand you have been experiencing multiple issues and tried several steps including (uninstalling and reinstalling the swa cli).

    To dig deep into this, we may need additional information about your Static WebApp, for this, and follow up offline.

    In the interim, you may try these to further isolate the issue:

     

    1.    Try running the swa login command to log in to your Azure account again. This will refresh your Azure session and ensure that the CLI is using the correct credentials.

    2.    If the issue persists, you may try deleting the .azure directory in your project's root directory. This directory contains cached authentication tokens and other configuration files that the CLI uses. Deleting it will force the CLI to recreate these files with fresh data.

     

    I understand you have checked/logs these already- post that, please review again that the swa-cli.config.json file in your project directory is correctly configured with the correct app_location and api_location paths.

     

    Review the logs for more info:

    Troubleshooting deployment and runtime errors

    Static WebApps CLI - Troubleshooting

    Review the Configuration of the Azure Static Web Apps CLI :

    Configuration file || Azure Static Web Apps CLI

     
    Kindly let us know, I'll follow-up with you further.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.