Connect your Azure account to Yasu by creating a Service Principal with read-only permissions. This enables Yasu to analyze your cloud costs and provide optimization recommendations.Documentation Index
Fetch the complete documentation index at: https://docs.yasu.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Security First: Yasu uses a Service Principal with read-only permissions. We cannot modify, create, or delete any Azure resources.
Subscription-Level Setup (All Billing Account Types)
This guide covers connecting Azure subscriptions to Yasu using subscription-level RBAC roles. This setup method works for all Azure billing account types, including:- Pay as You Go (Individual subscriptions)
- Microsoft Customer Agreement (MCA)
- Enterprise Agreement (EA)
- Azure Cloud Solution Provider (CSP)
Universal Setup: Subscription-level RBAC roles provide access to cost data and resources for all billing account types. Simply create a Service Principal and assign roles at the subscription scope - no billing account ID or enrollment number is required.
Prerequisites
Before connecting your Azure account, ensure you have:- Administrative access to your Azure subscription (or permissions to create Service Principals and assign RBAC roles)
- Subscription Owner or User Access Administrator role to assign permissions
- Access to Azure Portal or Azure CLI
- PowerShell or Azure CLI installed (for automated setup)
Quick Setup via Azure CLI
The fastest way to connect your Azure account is through Azure CLI commands.Open Azure Connection Dialog
- Log in to your Yasu dashboard at app.yasu.cloud
- Create a workspace (if you haven’t already):
- After logging in, you’ll be prompted to create a new workspace
- Enter your workspace name and click Create
- You’ll be redirected to the Onboarding page
- On the Onboarding page, Click the Connect button next to Azure
Step 1: Create Service Principal
In the dialog, you’ll see an Azure CLI command to create a Service Principal:
- Copy the command from the dialog (it is pre-filled with your account ID)
- Open Azure Cloud Shell or your local terminal with Azure CLI installed
- Paste and run the command
yasu-cost-optimizer-{your-account-id} and returns a JSON output like:- Copy the entire JSON output and paste it into the text box in the dialog — the credentials will be auto-filled from it
- Click Next
Step 2: Assign Roles
The dialog will prompt you to enter the subscription ID where your Azure resources are hosted:
- Enter your Azure Subscription ID in the provided field
- The dialog will automatically regenerate the three role assignment commands with your subscription ID and App ID filled in
- Copy the commands for your platform (Bash/Linux/macOS or PowerShell)
- Run the commands in your Azure terminal and wait for a successful response — they assign the following roles to your Service Principal:
- Reader — read access to subscription resources
- Cost Management Reader — access to cost and billing data
- Advisor Reviews Reader — access to Azure Advisor recommendations
Multiple subscriptions: If your resources span more than one subscription, change the subscription ID in the dialog to your second subscription and run all three commands again. Repeat for each additional subscription.
Role assignments may take up to 5 minutes to propagate. Wait a few minutes before proceeding.
Step 3: Connect
Your credentials have been auto-filled from the JSON output you pasted in Step 1. Review the pre-filled values:
- Tenant ID
- Service Principal App ID (Client ID)
- Client Secret
Wait for Verification
Yasu will automatically verify your connection:
- ✅ Authentication test - Verifies Service Principal credentials
- ✅ Permission check - Confirms required roles are assigned
Manual Setup via Azure Portal
If you prefer to set up the Service Principal manually through the Azure Portal:Create Application Registration
- Navigate to Azure Portal → Microsoft Entra ID (Azure Active Directory)
- Go to App registrations → + New registration
- Set Name:
yasu-cost-optimizer-{your-account-id} - Select Accounts in this organizational directory only
- Click Register
- Copy the following values (you’ll need them later):
- Application (client) ID
- Directory (tenant) ID
Generate Client Secret
- In the app registration, go to Certificates & secrets
- Click + New client secret
- Enter a Description:
Yasu Access Key - Select Expires: Choose 24 months (recommended)
- Click Add
- Copy the secret Value immediately - it won’t be shown again
Assign RBAC Roles
The Service Principal needs the following roles at the Subscription scope:
- Navigate to Subscriptions → Select your subscription
- Go to Access control (IAM) → + Add → Add role assignment
-
Assign each role one by one:
Role 1: Reader
- Role: Select Reader
- Assign access to: User, group, or service principal
- Select members: Search for and select your
yasu-cost-optimizer-*app - Click Review + assign
- Repeat the process with Cost Management Reader role
- Repeat the process with Monitoring Reader role
Role assignments may take up to 5 minutes to propagate. Wait a few minutes before testing the connection.
Complete Connection in Yasu
- Return to the Onboarding page in Yasu
- Click Connect next to Azure to open the connection dialog
- Follow Steps 1-3 in the dialog:
- Create Service Principal using the provided Azure CLI command
- Assign roles using the provided commands (replace placeholders)
- Enter credentials: Tenant ID, Service Principal App ID, and Client Secret
- Click Connect Azure to complete the connection
What the Service Principal Needs
The Service Principal is granted the following read-only RBAC roles at the subscription scope:| Role | Purpose | Permissions |
|---|---|---|
| Reader | Read all Azure resources | */read |
| Cost Management Reader | Access cost and billing data | Microsoft.Consumption/*/read, Microsoft.CostManagement/*/read |
| Advisor Reviews Reader | Access Azure Advisor recommendations | Microsoft.Advisor/*/read |
Troubleshooting
Authentication failed
Authentication failed
Common causes:
- Wrong tenant ID - Verify you’re using the correct Directory (tenant) ID
- Wrong client ID - Check the Application (client) ID matches your app registration
- Wrong client secret - The secret may have expired or been regenerated
- Secret expired - Create a new client secret and update it in Yasu
Access denied or insufficient permissions
Access denied or insufficient permissions
What to check:
- Missing role assignments - Verify all three roles are assigned (Reader, Cost Management Reader, Advisor Reviews Reader)
- Role propagation delay - Azure role assignments can take up to 5 minutes to propagate
- Wrong scope - Ensure roles are assigned at the Subscription level, not Resource Group level
Subscription not found
Subscription not found
What to check:
- Wrong subscription ID - Verify the subscription ID is correct
- Service Principal not granted access - The SP needs Reader role at subscription scope
- Subscription disabled - Check subscription state in Azure Portal
Missing cost data
Missing cost data
What to check:
- Cost Management API access - Verify Cost Management Reader role is assigned at subscription scope
- Data delay - Cost data may take 24-48 hours to appear after first connection
- Subscription billing - Ensure the subscription has active billing and resources
- Role propagation - Wait 5 minutes after assigning roles before testing the connection
- Verify Cost Management Reader role is assigned at the subscription level
- Wait 24-48 hours for initial cost data sync
- Check that the subscription has incurred charges (not in free/trial period)
- For organization-wide cost visibility, consider using the MCA/EA/CSP setup guides
Rate limiting (429 errors)
Rate limiting (429 errors)
What it means: Too many API calls in a short time period.Solution:
- Yasu automatically implements exponential backoff
- Large subscriptions may take longer to fully scan
- Wait for the full sync cycle (up to 6 hours for large subscriptions)
Client secret expiration
Client secret expiration
What to do:
- Create a new client secret in Azure Portal (App Registration → Certificates & secrets)
- Update the secret in Yasu before the old one expires:
- Go to Settings → Integrations → Your Azure connection
- Click Update Client Secret or Retry connection
- Enter the new secret value along with Tenant ID and Client ID
- Save changes
Cost data delay
Cost data delay
What it means: Cost data may take time to appear after connecting.Common causes:
- Cost data typically takes 24-48 hours to appear after subscription creation
- Cost Management API may require additional time for first-time access
- Subscription may not have incurred any charges yet
- Wait 24-48 hours after connecting for initial cost data sync
- Verify the subscription has active resources and billing activity
- Check that Cost Management Reader role is correctly assigned at subscription scope
- Ensure the subscription is not in a trial or free tier period