ヒトリ歩き

愚痴とかいろいろ書きます

ACRレジストリとAKSクラスターの削除でつまづいた

絶賛、勉強中。

無料枠を使用しているが、週末しか操作できないこともありレジストリクラスターを削除しようとしたところ、エラーが発生したのでメモしておく。

オプションが正しくない

下記のコマンドを実行するとエラーになる。

```sh
az group delete -name $ACR_RES_GROUP
```

パラメータがおかしいとのこと。

```
UnrecognizedArgumentError: unrecognized arguments: k8sSampleKozo
Try this: 'az group delete --resource-group '
Still stuck? Run 'az --help' to view all commands or go to 'https://docs.microsoft.com/cli/azure/reference-index' to learn more
```

helpを見ていると ```-name``` ではなく、```--name```だった。

```sh
az group delete --help

Command
az group delete : Delete a resource group.

Arguments
--name --resource-group -g -n [Required] : Name of resource group. You can configure the default

```

[解決策] —nameオプションで実行

実行できた。

```
az group delete --name $ACR_RES_GROUP
Are you sure you want to perform this operation? (y/n): y

```

最後に

正誤表を確認したが、オプションの誤りは書かれていなかった。
画面からも削除できるので、特に不便ではないがエラーが発生したら、コマンドヘルプは確認するようにしよう。