Publishing Static Web App from Visual Studio and the publish says succeeded but when i go to the static web app in Azure Portal the status says waiting on deployment. Can you not directly deploy from Visual Studio for static web apps?

Rachel 5 Reputation points
2024-10-10T14:37:14.24+00:00

I have the full publish setup for the blazor web assembly to Azure static web app. The resource group deployment was successful and when i published on Visual Studio it says successful but in the status on the static web app in Azure is says waiting for deployment. If you select other for the deployment type i thought you can deploy directly from Visual Studio publish. Is there a configuration I am missing or do you still have to use Github or AzureDevOps to deploy even when using Visual Studio publish.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,105 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,346 Reputation points
    2024-10-11T07:22:50.4833333+00:00

    @Rachel Thanks for asking question! Azure Static Web Apps publishes a website to a production environment by building apps from a GitHub repository supported by a serverless backend.

    Suggest you follow this tutorial shows which how to deploy C# Blazor WebAssembly app that displays weather data returned by a serverless API.

    Note- For steps to deploy a Blazor app via Visual Studio, see Deploy a Blazor app on Azure Static Web Apps.

    Hope this helps- Let us know.


  2. Victor Wilson 0 Reputation points
    2024-12-16T15:42:06.6433333+00:00

    I was able to do this after some research. I'm not sure if all of these steps are required, but this is what I did, and it works for me now.

    First, I followed the instructions on the accepted answer to this Stack Overflow question: https://stackoverflow.com/questions/77629955/azure-static-web-apps-visual-studio-2022 - so I added the staticwebapp.config.json as instructed. Then I ran swa init and modified the resulting swa-cli.config.json to include the correct output location for my existing VS publish profile.

    Then I followed the instructions on this GitHub issue https://github.com/Azure/static-web-apps-cli/issues/885 - so I installed the Azure command line interface, and then attempted to login with az login. This failed for some reason, and I had to run it again against my particular tenant id using the --tenant flag. Lastly, I ran swa login.

    Once I did this, I was able to successfully publish from within Visual Studio.User's image

    User's image

    0 comments No comments

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.