Azure / Azure/static-web-apps-cli

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

オープン
#910 コメント 1 件 リアクション 0 件 担当者 1 名 @Timothyw0 が担当を希望しています GitHub で見る
主要言語
TypeScript
スター
668
フォーク
156
PR マージ指標
30日以内にマージされた PR はありません

説明

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).

**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
- [x] 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`:

```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:

```bash
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](https://github.com/devkimchi/azure-easyauth-sample)
1. Provision Azure Static Web Apps (ASWA) instance.
1. Get the deployment token from the ASWA instance.
1. Type in command `swa build`
1. Type in command `swa deploy --deployment-token {{deployment_token}}`
1. 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}}`
1. 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`

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。