I want to build a local development environment for Azure Static Web Apps using SWA CLI. The Client is a Blazor WASM.
I installed SWA CLI successfully using the command:
npm install -g @azure/static-web-apps-cli
The Blazor client is working fine when started from Visual studio using F5
Running swa init command produced this file swa-cli.config.json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"blazor-app3": {
"appLocation": ".",
"outputLocation": "bin\wwwroot",
"appBuildCommand": "dotnet publish -c Release -o bin",
"run": "dotnet watch run",
"appDevserverUrl": "http://localhost:5050"
}
}
}```
When I run 'swa start' command I get this
`
C:UsersemadsourcereposBlazorApp3BlazorApp3>swa start
Welcome to Azure Static Web Apps CLI (1.1.8)
Using configuration "blazor-app3" from file:
C:UsersemadsourcereposBlazorApp3BlazorApp3swa-cli.config.json
***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure. *
***********************************************************************
[run] dotnet watch ???? Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
[run] ???? Press "Ctrl + R" to restart.
[run] dotnet watch ???? Building...
[swa]
[swa] Found configuration file:
[swa] C:UsersemadsourcereposBlazorApp3BlazorApp3staticwebapp.config.json
[swa]
[swa] - Waiting for http://localhost:5050 to be ready
[run] Determining projects to restore...
[run] All projects are up-to-date for restore.
[run] BlazorApp3 -> C:UsersemadsourcereposBlazorApp3BlazorApp3binDebugnet8.0BlazorApp3.dll
[run] BlazorApp3 (Blazor output) -> C:UsersemadsourcereposBlazorApp3BlazorApp3binDebugnet8.0wwwroot
[run] dotnet watch ???? Started
[swa] √ http://localhost:5050 validated successfully
[run] info: Microsoft.Hosting.Lifetime[14]
[run] Now listening on: http://localhost:5050
[swa]
[swa] Using dev server for static content:
[swa] http://localhost:5050
[swa]
[swa] Azure Static Web Apps emulator started at http://localhost:4280. Press CTRL+C to exit.
[swa]
[swa]
[run] info: Microsoft.Hosting.Lifetime[0]
[run] Application started. Press Ctrl+C to shut down.
[run] info: Microsoft.Hosting.Lifetime[0]
[run] Hosting environment: Development
[run] info: Microsoft.Hosting.Lifetime[0]
[run] Content root path: C:UsersemadsourcereposBlazorApp3BlazorApp3
[run] dotnet watch ⌚ Connecting to the browser is taking longer than expected ...
`
The browser is opening localhost:5050
The problem is : If I try to open the localhost:4280 to see the "emulated" site. I always get an error ERR_CONNECTION_REFUSED
[](https://i.sstatic.net/efEcfYvI.png)