Blazor web assembly website not working in Azure Static WebApp - azure

I have an existing website in Blazor Web assembly and it is working fine with Azure store account (Azure Storage Static Website).
The same app, when I deployed in Azure Static WebApp through GitHub workflow action, is not working.
I can see below errors in the browser console window.
Only JavaScript files under _content and _framework folders are not able to load. I don't see any option in Azure Static WebApp to verify these files deployed successfully or not.
Updated
Visual Studio 2019 default template app with default GitHub workflow working but I cannot use default workflow file so I tried to change as per my folder structure, below is my project structure
Root/MyApp/MyApp.csproj
Root/MyAPI/MyAPI.csproj

Azure Static Web Apps are currently in preview and support JavaScript and TypeScript front-end apps including those developed with popular frameworks like Vue.js, React, Angular and more.
Since it uses Github actions to deploy the application we just need to modify the workflow file generated by azure static web app to deploy our Blazor Application.
you can refer the article to deploy Blazor WASM app:
https://www.maneu.net/blog/2020-05-deploy-blazor-client-apps-with-azure-static-apps/

Related

How can I have access to the files in a Azure Static Web App?

In my Azure subscription an external company deployed from there BitBucket an application that I commissioned. The company ran out of business and I want to get all the files in the Static Web App to continue developing the application.
The Sku is Free. There is not Kudu to explore the content nor a FTP. I found same posts on Stackoverflow but all of them are dated.
Is there a way to access the Static Web App and/or copy the files?
Check the below steps to access the files of Azure Static Web App.
We can check the branch/source details in Azure Portal at 2 places.
Way 1 :
In Azure Portal => Your Static Web App => In Overview pane
We can find a Source and Deployment history options.
We can see the Source as Git.
Irrespective of the option we select to deploy the Application (GitHub/Devops/BitBucket), all the source files are saved in the GitHub Repository.
If we click on the URL, it will be redirected to the deployed files.
Way 2 :
In Static App => Under Settings tab, click on Environments.
We can see the Production Branch details. Click on the branch URL, it will be redirected to the Source files.
There is not Kudu to explore the content nor a FTP.
KUDU option is available only for Azure Windows App Service.
Refer drware Tutorial to Publish Azure Static Web Apps with Bitbucket.

Can I run my Azure Static Web App and ASP.NET web API locally?

In Azure, I have a Static Web App and an ASP.NET web API (running in App Service).
Following this guide on Microsoft learn https://learn.microsoft.com/en-us/azure/static-web-apps/local-development, I know it's possible to run a static web app and an azure functions API locally, but I can't find anything about a different kind of API.
When I run the CLI command " swa start dist/MyApp.front-end --api-location 'C:\GIT\MyApp.Backend'" I get the error:
[api] Unable to find project root. Expecting to find one of host.json, local.settings.json in project root.
This makes sense... because my project has appsettings.development.json instead of the local.settings.json, but I was hoping it was smart enough to use the other files.
Does anyone have any experience with running a static web app and asp.net api locally with the static web app CLI?

How to deploy single cshtml file in Azure app service

I have a .Net core app developed using Visual Studio 2019 and deployed on Azure app service. I have function app as well in the same solution. I have to do couple of things and then redeploy to Azure app service.
Add one .cshtml file
Modify one .cshtml file
My question is, how to deploy the CSHTML file only to the Azure app service? Without affecting the existing functionality of application.
As per my understanding, if web app is deployed in Azure app service then the whole thing (solution) has to be deployed even though there are/is very small code modifications.
Please let me know.Thanks.
Even if you have Web App and Function App in the same solution, they should be separated units of deployment. That said, your deployment pipeline should be separately triggered for Web App and Function App.
From the technical point of view(or architecture) there's no concept of "solution". Solution(.sln) is a Visual Studio specific being and even though it's supported e.g. in VS Code, I'd never treat it as deployment unit. Especially in your scenario, when in fact two separate services are responsible for handling your code.
Even if you deploy Function App as a part of the same App Service Plan as your Web App, it's still a separate Azure service. In such a scenario they only share compute.
Yes its possible if you have access to kudu deployment center you can perform manual add/update information , please visit below URL:-
https://[yourAppName].scm.azurewebsites.net
You can also navigate to this site using the azure portal , once you open the app service blade you will find the kudu deployment center option in the bottom left of the menu.
It will provide an online file explorer of your application hosted on the app service and from there you can migrate to relevant folder and perform add/update.

Deploy Web App Azure issues

I'm new to deploying a web app to Azure (using Azure App Service). My app has about 6 web projects and we also use Umbraco CMS. When I build the web app in Visual Studio and point to any of our databases (dev, stage, etc.), the web site works locally (localhost)
When I try to publish the app to Azure or even test it locally (after "convert"), content is missing and all the links have the incorrect domain. I'm following MS docs to "Migrate and Publish a web app to Azure Cloud".
The first step in the MS docs is to right-click on the web app and select "Convert > Convert to Microsoft Azure". After this step I try to test the Web App created by this step. I point to the same databases as if i build locally (not using "convert"), content is missing and links have a different domain.
Is there a settings in the web.config or other file I need to do when building/deploying to Azure cloud service?

Azure Continuous Deployment from Visual Studio Team Services with multiple projects

While using Github (or anything other than Visual Studio Team Services) I can use the following page to customize deployment: https://github.com/projectkudu/kudu/wiki/Customizing-deployments
I'd like to customize my deployment as I currently have both a web app and a web api project. I want the web app to be deployed, as default it deploys the web api project. Using project Kudu the settings (.deployment file or even better, the app settings on Azure itself) works great, but not when you deploy from Visual Studio Team Services.
I've spoken with David Ebbo from Project Kudu, and he explained that VS Team Services doesn't use Kudu at all, but probably MS Build. So my question is, how to specifically deploy the web app.
I managed to change the Build Definition and specify the web app .csproj as the Projects To Build. This works. However, I also want to deploy my web api.
Deploying the web api project with Kudu is easy as I can create a separate website, connect to the some repository (and solution) and specify the Project App setting so that it deploys the correct .csproj. How should we do this for MS Build? When I change the Build Definition, it will always deploy the project specified in there.
Just saw another answer on Stackoverflow that looks to solve this problem: Publish Multiple Projects to Different Locations on Azure Website

Resources