Azure / Azure/static-web-apps

Not possible to add or delete multiple appsettings using CLI

Open
#1,370 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

When attempting to add or delete multiple appsettings via CLI `az staticwebapp appsettings set` or `az staticwebapp appsettings delete` only the last entry is used. In other words, its not possible to add or delete multiple appsettings.

**To Reproduce**

Attempt to add multiple:

```bash
az staticwebapp appsettings set --name my_swa --setting-names "a=1" --setting-names "b=2"
```

Attempt to delete multiple:

```bash
az staticwebapp appsettings delete --name my_swa --setting-names "a" --setting-names "b"
```

**Expected behavior**

As per https://learn.microsoft.com/en-us/azure/static-web-apps/application-settings
when multiple `--setting-name` pairs are provided then these should each be added or deleted.

The observed behaviour is that only the last `--setting-name` is actioned.

**Other notes**

According to the Tip in https://learn.microsoft.com/en-us/azure/static-web-apps/application-settings

> You can add or update multiple settings by passing multiple name-value pairs to `--setting-names`.

This is somewhat misleading as it could mean multiple things eg. multiple `--setting-names` as above or multiple key/values embedded into the same `--setting-names`.

The latter does not work either.

```bash
az staticwebapp appsettings set --name my_swa --setting-names "a" --setting-names "a=1 b=2"
```

yields

```json
{ "a": "1 b=2" }
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.