Pre-requirements:
Permissions of Owner or Contributor on On-Boarded Azure Subscription
Azure CloudShell register
Script Breakdown:
The script involves several steps, including the creation of an App registration, a Storage Account, and the setup of Cost Management and Billing export. Below is a summary of the script's key functionalities:
1. Login to Azure:
- The script initiates by logging into the Azure account and retrieves the current subscription and tenant IDs.
2. Subscription Verification:
- The script verifies the correct subscription ID is set. If not, it exits with an error message.
3. Resource Provider Registration:
- The script checks if the Microsoft.Storage resource provider is registered. If not, it registers the provider.
4. Resource Group Setup:
- The user is prompted to enter a resource group name and select a region from a predefined list. The script then checks if the resource group exists, creates it if necessary, and verifies its existence.
5. App Registration and Service Principal:
- The script checks if a service principal for the app (wiv_account) exists. If not, it creates one and generates a new client secret.
6. Role Assignments:
- The script assigns the necessary roles to the service principal:
- Cost Management Reader
- Monitoring Reader
- Directory Readers (Optional)
8. Admin Consent:
- The script grants admin consent for the application to access required permissions.
9. Completion and Outputs:
- Upon successful completion, the script provides the following details:
- Application Display Name
- Application (Client) ID
- Directory (Tenant) ID
- Client Secret Value
This script ensures that all necessary components and permissions are correctly configured to onboard a new subscription to the Wiv platform.
Integration:
Run the following command:
curl -sO https://raw.githubusercontent.com/wiv-ai/AzureOnBoarding/main/.cloudshell/startup.sh && chmod +x startup.sh && ./startup.sh
Follow script prompt instructions
Take note of the script output
- Application (Client) ID
- Directory (Tenant) ID
- Client Secret Value
Login to Wiv Platform
Navigate Integrations Page
Click on Azure
click on New Azure Integration
Provide an integration name
Complete the App ID, Client Secret and Tenant ID which were noted from script output:
Click Save
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article