Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swa-cli.config.json works differently between swa start/swa build and swa deploy in .NET 9 (Blazor WASM + Azure Functions app) #910

Open
1 of 2 tasks
justinyoo opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@justinyoo
Copy link

Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.

Are you accessing the CLI from the default port :4280 ?

  • No, I am using a different port number (--port) and accessing the CLI from that port
  • Yes, I am accessing the CLI from port :4280

Make sure you are accessing the URL printed in the console when running swa start!

ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly

Describe the bug
A clear and concise description of what the bug is.

Here's my swa-cli.config.json:

{
  "$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
  "configurations": {
    "azure-easyauth-sample": {
      "appLocation": "src/EasyAuth.SwaApp",
      "apiLocation": "src/EasyAuth.FunctionApp",
      "outputLocation": "bin/wwwroot",
      "apiLanguage": "dotnetisolated",
      "apiVersion": "9.0",
      "appBuildCommand": "dotnet publish -c Release -o bin",
      "apiBuildCommand": "dotnet publish -c Release",
      "run": "dotnet watch run",
      "appDevserverUrl": "http://localhost:8080"
    }
  }
}

This works perfectly fine with swa start and swa build. But, when it comes with the command swa deploy, the apiLocation part keeps complaining. Therefore, I have to use the swa deploy command like this:

swa deploy --api-location src/EasyAuth.FunctionApp/bin/Release/net9.0 ...`

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/devkimchi/azure-easyauth-sample
  2. Provision Azure Static Web Apps (ASWA) instance.
  3. Get the deployment token from the ASWA instance.
  4. Type in command swa build
  5. Type in command swa deploy --deployment-token {{deployment_token}}
  6. See error

If I run the following command, it deploys successfully:

  1. Type in command swa deploy --api-location src/EasyAuth.FunctionApp/bin/Release/net9.0 --deployment-token {{deployment_token}}
  2. See no error

Expected behavior
A clear and concise description of what you expected to happen.

It should be deployed without having to add the --api-location parameter to alter the location.

Desktop (please complete the following information):

  • OS: Windows 11 Enterprise
  • Version: 24H2

Additional context
Add any other context about the problem here.

  • swa version: 2.0.2
  • func version: 4.0.6610
@Timothyw0 Timothyw0 self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants