Deploying the to azure static web app

Deploying Blazor Web Assembly App To Azure Static Web Apps

At Build 2020, a new Azure Static Web Apps service was announced as a public preview. This service means a lot to front-end development because the front- end applications take responsibilities for user interactions more than ever. Only if necessary, it calls back-end API for data or messages. Especially JAM Stack has become more popular for over the last few years. Therefore, to host those JAM Stack applications, this Azure Static Web App service has been launched. At the time of this writing, it predominantly supports JavaScript- based applications. In order to

deploy the Blazor Web Assembly application to the Azure Static Web Apps instance, we need a few extra steps. Let's find them > My colleague Tim Heuer wrote an awesome post about this. My post extends his > one. Please refer to the page to deploy an app to Azure Static Web App instance. At the time of this writing, the deployment, in fact, fails. This is because the action used for deployment, Azure/static-web-apps- deploy@v0.0.1-preview, uses Oryx. Currently, the latest version of .NET Core SDK that Oryx supports is 2.2, which

doesn't support Blazor Web Assembly yet. Therefore, we can't 100% rely on the action. The auto-generated GitHub Actions workflow should be accommodated to sort out this issue. Add the following action right after the `actions/checkout@v2` action. We need to set the SDK version to `3.1.300` for Blazor Web Assembly (line #4). | \- name: Setup .NET SDK | uses: actions/setup-dotnet@v1 | dotnet-version: '3.1.300' Then, build the Blazor app outside the Oryx action and create the artifact to the `published` directory (line #4). Of course, we can add more steps before this

step, like testing, but let's hold this for now. | \- name: Publish Blazor WASM app | dotnet publish BlazorNpmSample -c Release -o published We've got the Blazor app. Let's update the existing `Build And Deploy` step. Change the values of `app_location`, `api_location` and `app_artifact_location` properties (line #6-8). | \- name: Build And Deploy | id: builddeploy | uses: Azure/static-web-apps-deploy@v0.0.1-preview | ... | app_location: "published/wwwroot" | api_location: "" | app_artifact_location: "published/wwwroot" Save the workflow and push it back to the repository. Then the workflow will successfully run, and the Blazor app

will be deployed successfully. But there's still the same error occurs. As I mentioned earlier, it's OK for now.

To deploy static web application with Tomcat, all you need to do is copy your project folder to tomcat web-apps directory. For linux : ~$ sudo cp -a StaticWebProject/ /usr/share/tomcat8-root/ ~$ cd /usr/share/tomcat8-root/ /usr/share/tomcat8-root$ ls default_root StaticWebProject /usr/share/tomcat8-root$ cd StaticWebProject/ /usr/share/tomcat8-root/StaticWebProject$ ls another_page.html index.html Now restart Tomcat for the changes to take effect. Open a broswer, and hit the url, http://localhost:8080/StaticWebProject.

1. Navigate to the Azure portal 2. Click `Create a Resource` 3. Search for Static Web Apps 4. Click `Static Web Apps (Preview)` 5. Click Create 6. Fill the details and click `Sign in with GitHub` button Create the Static WebApp resource You will be prompted to authorise the Azure Static WebApp to GitHub. Make sure you `Grant` access to organisation that has the repo. Complete the steps in the popup and you will see the below screen where you will select the `repository` and `organisation`. My values look as below. > ⚠️ If for any reason, you missed granting access to the right organisation, > you have to Revoke that Authorisation from GitHub by going to `Applications` > section in the `Settings` and Revoking for `Azure Static Web Apps` as shown > below


Deploying Proxy Api To Azure Static Web Apps

Share this post:


Professional niche blogs with track record over 1M+ blog posts, Still counting.

Connect: View All Posts

0 replies

Write a reply