An open API service indexing awesome lists of open source software.

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

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