You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add new flags for Function runtime and Function version (#562)
* feat: Add new flags for Function runtime and Function version
* feat: add func language and version support in swa init
* test: modify tests for new flags
* nit changes
* feat: add select option for apiLanguage flags
* more changes
* fix tests
* Change flag to av
* refactor: moved functions versions to core
* Merge main to current branch
* chore: resolve comments
* nit: revert const changes
* chore: merge main to current
* chore: resolve merge conflicts
* fix: index.ts in tests
* feat: Added support for new languages and versions
* nit: resolve comments
* fix: dotnetIsolated naming
* refactor: added utils functions
* nit: add default versions
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -362,6 +362,7 @@ Breaking Change section should start with the phrase "BREAKING CHANGE: " followe
362
362
Similarly, a Deprecation section should start with "DEPRECATED: " followed by a short description of what is deprecated, a blank line, and a detailed description of the deprecation that also mentions the recommended update path.
363
363
364
364
### Merging Pull requests (For Code owners)
365
+
365
366
While merging pull requests, the following guidelines should be followed:
366
367
367
368
- Before merging, make sure there is at least one approval from the Code-owners.
Copy file name to clipboardExpand all lines: docs/www/docs/cli/swa-deploy.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,13 @@ To deploy both the front-end app and an API to Azure Static Web Apps, use the fo
72
72
73
73
1. If your front-end application requires a build step, run [`swa build`](./swa-build) or refer to your application build instructions.
74
74
75
-
2. Make sure the[ API language runtime version](https://docs.microsoft.com/en-us/azure/static-web-apps/configuration#platform) in the `staticwebapp.config.json` file is set correctly, for example:
75
+
2. Use the flags `--api-language` and `--api-version` to specify the language and the runtime version of the backend api.
Alternatively you can [configure](https://docs.microsoft.com/en-us/azure/static-web-apps/configuration#platform) the `apiRuntime` in the `staticwebapp.config.json` file
76
82
77
83
```json
78
84
{
@@ -157,6 +163,8 @@ Here are the options you can use with `swa deploy`:
157
163
-`-a, --app-location <path>`: the folder containing the source code of the front-end application (default: "`.`")
158
164
-`-i, --api-location <path>`: the folder containing the source code of the API application
159
165
-`-O, --output-location <path>`: the folder containing the built source of the front-end application. The path is relative to `--app-location` (default: "`.`")
166
+
-`--api-language <apiLanguage>`: the runtime language of the function (default: "`node`")
167
+
-`--api-version <apiVersion>`: the version of the function runtime language (default: "`16`")
160
168
-`-w, --swa-config-location <swaConfigLocation>`: the directory where the staticwebapp.config.json file is located
161
169
-`-d, --deployment-token <secret>`: the secret token used to authenticate with the Static Web Apps
162
170
-`-dr, --dry-run`: simulate a deploy process without actually running it (default: `false`)
Copy file name to clipboardExpand all lines: docs/www/docs/contribute/99-troubleshooting.md
+197Lines changed: 197 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ This page lists frequently-asked questions and solutions to help troubleshoot co
14
14
15
15
### Context
16
16
17
+
`swa deploy` currently has a small bug which is being actively worked on by the team. When a user tries to `swa deploy` from within the `app-location`, the deploy command currently fails with an unknown error. This is being tracked in GitHub issue #[514]((https://github.com/Azure/static-web-apps-cli/issues/514).
17
18
`swa deploy` currently has a small bug which is being actively worked on by the team. When a user tries to `swa deploy` from within the `app-location`, the deploy command currently fails with an unknown error. This is being tracked in GitHub issue #[514]((https://github.com/Azure/static-web-apps-cli/issues/514).
18
19
19
20
### Solution
@@ -24,6 +25,7 @@ While the team is currently working on the fix, we recommend users to use the ot
24
25
25
26
### Context
26
27
28
+
When using `swa login`, the flag `--use-keychain` is enabled by default because we encrypt and store your credentials in your native Keychain (aka. the built-in password manager of your operating system). This operation depends on a system dependency called `libsecret`. If your system doesn't come bundled `libsecret` (most systems do provide it by default), you will then encounter this error.
27
29
When using `swa login`, the flag `--use-keychain` is enabled by default because we encrypt and store your credentials in your native Keychain (aka. the built-in password manager of your operating system). This operation depends on a system dependency called `libsecret`. If your system doesn't come bundled `libsecret` (most systems do provide it by default), you will then encounter this error.
28
30
29
31
### Why do I need to `swa login`?
@@ -45,6 +47,201 @@ In order to avoid this issue, you have a few options:
45
47
46
48
If you are having trouble accessing SWA CLI, the following domains need to be allowed an access in your firewall:
47
49
50
+
- blob.core.windows.net
51
+
- azurestaticapps.net
52
+
- swalocaldeploy.azureedge.net
53
+
54
+
## `Unable to download StaticSitesClient binary (File Not Found 404 - 403)`
55
+
56
+
### Context
57
+
58
+
SWA CLI uses an external binary `StaticSitesClient` to deploy apps to Azure Static Web Apps. This binary is downloaded on demand when users run `swa deploy` for the first time. SWA CLI then detects the host OS in order to download the right binary version from https://swalocaldeploy.azureedge.net/downloads/versions.json.
59
+
60
+
It can happen that the host firewall can block downloading these binaries. If users can't configure the firewall rules to allow SWA CLI accessing https://swalocaldeploy.azureedge.net/, as a workaround, they can manually download `StaticSitesClient`.
"checksum": SH256 CHECKSUM OF THE BINARY SEE BELOW
116
+
}
117
+
```
118
+
119
+
**IMPORTANT: Make sure the `StaticSitesClient.json#checksum` and `StaticSitesClient.json#metadata.files.[OS].sha` values match!** 6. For Linux and macOS, run `chmod +x /home/USER/.swa/deploy/1.0.020761/StaticSitesClient` 7. Run `swa deploy --verbose silly` and make sure `SWA_CLI_DEPLOY_BINARY` is set correctly. If everything was configured correctly, the deploy should work.
If you are having trouble accessing SWA CLI, the following domains need to be allowed an access in your firewall:
146
+
147
+
- blob.core.windows.net
148
+
- azurestaticapps.net
149
+
- swalocaldeploy.azureedge.net
150
+
- dataapibuilder.azureedge.net
151
+
152
+
## `Unable to download StaticSitesClient binary (File Not Found 404 - 403)`
153
+
154
+
### Context
155
+
156
+
SWA CLI uses an external binary `StaticSitesClient` to deploy apps to Azure Static Web Apps. This binary is downloaded on demand when users run `swa deploy` for the first time. SWA CLI then detects the host OS in order to download the right binary version from https://swalocaldeploy.azureedge.net/downloads/versions.json.
157
+
158
+
It can happen that the host firewall can block downloading these binaries. If users can't configure the firewall rules to allow SWA CLI accessing https://swalocaldeploy.azureedge.net/, as a workaround, they can manually download `StaticSitesClient`.
"checksum": SH256 CHECKSUM OF THE BINARY SEE BELOW
214
+
}
215
+
```
216
+
217
+
**IMPORTANT: Make sure the `StaticSitesClient.json#checksum` and `StaticSitesClient.json#metadata.files.[OS].sha` values match!** 6. For Linux and macOS, run `chmod +x /home/USER/.swa/deploy/1.0.020761/StaticSitesClient` 7. Run `swa deploy --verbose silly` and make sure `SWA_CLI_DEPLOY_BINARY` is set correctly. If everything was configured correctly, the deploy should work.
Copy file name to clipboardExpand all lines: docs/www/docs/use/1-install.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ sidebar_position: 1
7
7
You can install the Static Web Apps CLI using [`npm`](https://docs.npmjs.com/cli/v6/commands/npm-install), [`yarn`](https://classic.yarnpkg.com/lang/en/docs/cli/install/) or [`pnpm`](https://pnpm.io/cli/install).
8
8
9
9
:::info Note
10
-
SWA CLI currently only supports runtime Node versions 16 and below. Kindly check and set your runtime to the same in order to have a smooth SWA CLI experience.
10
+
SWA CLI currently only supports runtime Node versions 16 and below. Kindly check and set your runtime to the same in order to have a smooth SWA CLI experience.
0 commit comments