https://github.com/boltops-tools/azure_check
Check Azure access
https://github.com/boltops-tools/azure_check
Last synced: 11 months ago
JSON representation
Check Azure access
- Host: GitHub
- URL: https://github.com/boltops-tools/azure_check
- Owner: boltops-tools
- Created: 2020-06-02T21:36:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-25T19:49:34.000Z (over 4 years ago)
- Last Synced: 2025-03-09T23:46:36.634Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azure Check
Simple script to check azure access with `ARM_CLIENT_ID` and `ARM_CLIENT_SECRET`.
## Usage
Export the `ARM_CLIENT_ID` and `ARM_CLIENT_SECRET` variables. It's recommended to put it in your `~/.bashrc`
export ARM_CLIENT_ID=REPLACE_ME
export ARM_CLIENT_SECRET=REPLACE_ME
Make sure you run `source ~/.bashrc` or open a new terminal. Then run:
bundle install
ruby azure_check.rb
## Example
Success looks like this:
$ ruby azure_check.rb
Successfully connected to Azure with your ARM_CLIENT_ID and ARM_CLIENT_SECRET
$
Failure looks like this:
$ ruby azure_check.rb
Failed to connected to Azure with your ARM_CLIENT_ID and ARM_CLIENT_SECRET
{
"message": "Couldn't login to Azure, please verify your tenant id, client id and client secret",
"request": null,
"response": null
}
## Additional Env Vars
The `ARM_SUBSCRIPTION_ID` and `ARM_TENANT_ID` can also be optionally set. By default, this script infers their values from your `az` CLI setup using [azure_info](https://github.com/boltops-tools/azure_info). It essentially uses:
az account show