Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/claranet/claranet-azure-pre-configuration
Claranet Azure pre-configuration script
https://github.com/claranet/claranet-azure-pre-configuration
azure claranet
Last synced: about 1 month ago
JSON representation
Claranet Azure pre-configuration script
- Host: GitHub
- URL: https://github.com/claranet/claranet-azure-pre-configuration
- Owner: claranet
- License: apache-2.0
- Created: 2021-08-31T14:40:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-05T10:38:29.000Z (2 months ago)
- Last Synced: 2024-12-05T11:36:32.313Z (2 months ago)
- Topics: azure, claranet
- Language: Shell
- Homepage:
- Size: 250 KB
- Stars: 4
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Claranet Azure pre-configuration script
The purpose of this script is to execute all necessary high privileges actions
needed by Claranet for Azure subscriptions management.This includes:
* Creation of a "claranet-tools" (or any other given name) [service principal](https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals)
* Creation of a "claranet-deploy" (or any other given name) [service principal](https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals)
* Rights assignment of Reader service principal on selected Subscription(s) with following rights:
* [_Reader_](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#reader) for inventory and monitoring purposes
* [_Cost Management Reader_](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#cost-management-reader) for FinOps purposes
* [_Log Analytics Reader_](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#log-analytics-reader) for monitoring purpose
* Specific right assignment at the tenant level to read Reservations for FinOps purposes
* [_Reservation Reader_](https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/view-reservations#view-reservations-with-azure-rbac-access)
* Rights assignment of Deployment service principal on selected Subscription(s) with following rights:
* [_Contributor_](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) for Claranet deployment tools
* [_User Access Administrator_](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) for Claranet deployment tools
* Optional creation of a "Claranet DevOps" user group and rights assignment on subscriptionsA report is generated at the end of the script and needs to be provided to Claranet **in a secure way**.
# Prerequisites
In order to play this script, you'll need:
* Azure Active Directory privileges for creating Service Principals
* A terminal with the Azure CLI configured (it can be [Azure Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/overview))
* Azure Subscriptions to configure rights on them# Important notes
If the given service principal name already exists, the script will re-use the existing one.
# How to use it
## With Azure Cloud Shell (recommended)
You can find Azure Cloud Shell documentation here: [https://docs.microsoft.com/en-us/azure/cloud-shell/overview](https://docs.microsoft.com/en-us/azure/cloud-shell/overview)
Open Azure Cloud Shell from the Azure portal in Bash mode and launch the following command:
```shell
bash <(curl -s https://raw.githubusercontent.com/claranet/claranet-azure-pre-configuration/master/setup.sh)
```![Azure Cloud Shell usage](azure-cloud-shell.png)
## From your terminal
Either clone this repository or download the script `setup.sh` locally and launch it in your terminal or launch the
following command locally:```shell
bash <(curl -s https://raw.githubusercontent.com/claranet/claranet-azure-pre-configuration/master/setup.sh)
```# Troubleshooting
## I can't see my subscription in the list
If the subscription has been recently created, be sure to you've logged in with the Azure CLI after the subscription creation.
This issue should not occur when using the Azure Cloud Shell method.You can do this with the following command:
```shell
az login
```