inlets / inlets/inletsctl

Add the Azure subscription-id to the sample delete command given by `inletsctl create`

Open
#117 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Go
Stars
488
Forks
62
PR merge metrics
No merged PRs in 30d

Description

When you run `inletsctl create`, it prints a command to run in order to delete the server again. The command generated for an Azure deployment is incomplete and will not run without additional parameters.

## Expected Behaviour
* Run the `inletsctl delete` command generated by `inletsctl create`
* The inlets server is deleted.

## Current Behaviour
* The provided command fails:
```
$ inletsctl delete --provider azure --id "inlets-flamboyant-buck2|deployment-c1f95ea9-6957-4aca-be24-26274269e52d"
Using provider: azure
give a value for --access-token-file, --access-token or set the environment variable "INLETS_ACCESS_TOKEN"
```
* Adding --access-token-file with the same file used for create also fails:
```
$ inletsctl delete --provider azure --id "inlets-flamboyant-buck2|deployment-c1f95ea9-6957-4aca-be24-26274269e52d" --access-token-file az-sp.json
Using provider: azure
Deleting host: inlets-flamboyant-buck2|deployment-c1f95ea9-6957-4aca-be24-26274269e52d from azure
resources.GroupsClient#Delete: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidSubscriptionId" Message="The provided subscription identifier 'resourcegroups' is malformed or invalid."
```
* Adding the subscription id succeeds:
```
$ inletsctl delete --provider azure --id "inlets-flamboyant-buck2|deployment-c1f95ea9-6957-4aca-be24-26274269e52d" --access-token-file az-sp.json --subscription-id $SUBSCRIPTION_ID
Using provider: azure
Deleting host: inlets-flamboyant-buck2|deployment-c1f95ea9-6957-4aca-be24-26274269e52d from azure
```

## Possible Solution
Maybe including at least the --subscription-id in the generated command would be a good idea. Alternatively, the subscription ID is already in the access token file so if it's not specified from the command line it could just be read from there too.

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.