Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add azure cli usage #121

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ This guide us how to use the `devops-toolkit` with serveral usecases

- Check [**helm_usage**](./helm_usage.md)

## AWSCli
## AwsCLI

- Check [**awscli_usage**](./awscli_usage.md)

## AzureCLI

- Check [**azurecli_usage**](./azurecli_usage.md)

## Troubleshooting

- For any issues, check [this document](../troubleshooting/TROUBLESHOOTING.md)
67 changes: 67 additions & 0 deletions docs/usage/azurecli_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Use azurecli in the devops-toolkit

## Prerequisite

An Azure account

## azurecli document

Some document to help you start with azurecli

- <https://learn.microsoft.com/en-us/cli/azure/>

## Note

To use the existing container instead of creating one, use `docker exec` command instead of `docker run`

```bash
docker exec -it my_devops_toolkit /bin/bash
```

## Use case 1: Az login and run command

```bash
docker run --rm -it devops-toolkit:latest
## To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <SHOWN_IN_SCREEN> to authenticate
az login
# List all resource groups
az group list
```

## Use case 2: Using Azure config from the host

Mount the `.azure` folder from host when running toolkit container

```bash
docker run --rm -it -v ~/.azure:/root/.azure devops-toolkit:latest
###############################################
# Now we are in the docker container terminal #
###############################################
# List all resource groups
az group list
```

Sample Result

```bash
➜ ~ docker run --rm -it -v ~/.azure:/root/.azure devops-toolkit:latest
root@f097467db632:~# az group list
[
{
"id": "/subscriptions/xxxxxxxx-yyyy-zzzz-ttttttttt/resourceGroups/your_resource_group",
"location": "centralindia",
"managedBy": null,
"name": "your_resource_group",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
},
...
]
```

## Troubleshooting

- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)