Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic deploy blazor sample app to azure (Read 176 times)
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: Dec 3rd, 2007
deploy blazor sample app to azure
May 30th, 2025 at 2:05pm
Print Post  
Hi,
I am trying to deploy one of the sample Blazor apps to the free tier of Azure. The app builds & runs locally after I installed wasm-tools.

In Azure, I can't get past the error:
   To build this project, the following workloads must be installed: wasm-tools-net8    [D:\a\NodeList\NodeList\NodeList.csproj]

Even though the YAML includes:
- name: Install wasm-tools workload
        run: dotnet workload install wasm-tools

And the .NET version is .NET 8, so I think this will get the right SDK. the YAML is a little weird as it was created by Azure. The entire file is below.

Any suggestions?
Thanks, David

----------------------
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy ASP.Net Core app to Azure Web App - NodeList
on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:

  build:
    runs-on: windows-latest
    permissions:
      contents: read #This is required for actions/checkout
    steps:
      - uses: actions/checkout@v4


      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'
         
      - name: Install wasm-tools workload
        run: dotnet workload install wasm-tools

      - name: Build with dotnet
        run: dotnet build --configuration Release

      - name: dotnet publish
        run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"

      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: .net-app
          path: ${{env.DOTNET_ROOT}}/myapp

  deploy:
    runs-on: windows-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
    permissions:
      id-token: write #This is required for requesting the JWT
      contents: read #This is required for actions/checkout

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v4
        with:
          name: .net-app
      
      - name: Login to Azure
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.boo}}
          tenant-id: ${{ secrets.foo}}
          subscription-id: ${{ secrets.moo}}

      - name: Deploy to Azure Web App
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'NodeList'
          slot-name: 'Production'
          package: .
         
--------------------------
  
Back to top
 
IP Logged
 
davidl
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: Dec 3rd, 2007
Re: deploy blazor sample app to azure
Reply #1 - May 30th, 2025 at 7:48pm
Print Post  
well, it started working. I made many, many changes to the YAML, but I really don't think they were the reason: I suspect changes to the Azure environment that finally allowed wasm-tools to load.

Anyway, here is the part of the YAML that worked (in case anyone else needs this):
name: Build and deploy ASP.Net Core app to Azure Web App - NodeList
on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:

  build:
    runs-on: windows-latest
   
    permissions:
      contents: read #This is required for actions/checkout
    steps:
      - uses: actions/checkout@v3
       
      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'

      - name: Install wasm-tools workload
        run: dotnet workload install wasm-tools

      - name: Install wasm-tools workload 8
        run: dotnet workload install wasm-tools-net8

      - name: list workload
        run: dotnet workload list

      - name: search workload
        run: dotnet workload search
       
      - name: Build with dotnet
        run: dotnet build --configuration Release

      - name: dotnet publish
        run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"

      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v4
        with:
          name: .net-app
          path: ${{env.DOTNET_ROOT}}/myapp


  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint