# AWS Source: https://docs.yasu.cloud/guides/connect-aws Complete guide to connect your AWS account to Yasu for cost analysis and optimization Connect your **AWS account** to Yasu using our secure CloudFormation template. This one-click deployment creates a read-only IAM role that enables Yasu to analyze your cloud costs and provide optimization recommendations. ## Prerequisites Before connecting your AWS account, ensure you have: * **Administrative access** to your AWS account (or permissions to create IAM roles and CloudFormation stacks) * **Cost Explorer enabled** in your AWS account * Access to the AWS Console **Security First:** Yasu uses a cross-account IAM role with read-only permissions. We cannot modify or delete any of your AWS resources. ## Quick Setup via CloudFormation The fastest way to connect your AWS account is through our pre-configured CloudFormation template. 1. Log in to your Yasu dashboard at [app.yasu.cloud](https://app.yasu.cloud) 2. Go to **Settings** → **Integrations** 3. Click **Connect AWS** You'll be redirected to AWS CloudFormation with our template pre-loaded. 1. **Review the stack name** — A unique name is generated for you (e.g., `YasuIntegration-abc123`) 2. **Review the parameters** — These are automatically filled in: * `YasuCustomerId` — Your unique Yasu customer ID * `YasuExternalId` — A secure token for cross-account access * `BucketName` — S3 bucket for Cost and Usage Reports * `ReportName` — Name for your AWS CUR report 3. **Scroll to the bottom** and check the acknowledgment box: > ☑️ I acknowledge that AWS CloudFormation might create IAM resources. 4. Click **Create stack** **Do not modify the parameters** — They are pre-configured to work with your Yasu account. The CloudFormation stack typically completes in **2-3 minutes**. You can monitor the progress in the AWS Console: * **CREATE\_IN\_PROGRESS** — Stack is being created * **CREATE\_COMPLETE** — Stack created successfully Once complete, Yasu automatically detects the connection and begins syncing your data. Return to your Yasu dashboard. You should see: * ✅ **Connection status**: Active * ✅ **AWS Account ID**: Your connected account * ✅ **Data sync**: In progress Your first cost-saving insights will appear within **5-10 minutes** after connection. ## What the CloudFormation Template Creates Our template creates the following resources in your AWS account: ### 1. Cross-Account IAM Role A read-only IAM role that allows Yasu to access your cost and resource data: ``` arn:aws:iam::YOUR-ACCOUNT-ID:role/YasuCostOptimizationRole ``` ### 2. IAM Policies with Read-Only Permissions The role includes two policies. The main policy (`YasuCostOptimizationPolicy`) grants read-only access across AWS services: | Service | Permissions | Purpose | | --------------------- | ------------------------------------------------------------- | ---------------------------------------- | | Cost Explorer | `ce:Describe*`, `ce:Get*`, `ce:List*` | Cost and usage data | | Compute Optimizer | `compute-optimizer:Describe*`, `compute-optimizer:Get*` | Right-sizing recommendations | | EC2 | `ec2:Describe*`, `ec2:List*` | Instance, volume, and snapshot info | | RDS | `rds:Describe*`, `rds:List*` | Database instance details | | EKS | `eks:Describe*`, `eks:List*` | Kubernetes cluster info | | Lambda | `lambda:Get*`, `lambda:List*` | Function configurations | | S3 | `s3:GetBucketLocation`, `s3:GetBucketTagging`, `s3:List*` | Storage bucket information | | CloudWatch | `cloudwatch:Get*`, `cloudwatch:List*`, `cloudwatch:Describe*` | Utilization metrics | | Organizations | `organizations:Describe*`, `organizations:List*` | Account structure | | Savings Plans | `savingsplans:Describe*` | Savings plan coverage | | Trusted Advisor | `trustedadvisor:Get*`, `trustedadvisor:List*`, `support:*` | AWS recommendations | | Cost Optimization Hub | `cost-optimization-hub:Get*`, `cost-optimization-hub:List*` | Consolidated AWS savings recommendations | A second policy (`YasuCloudWatchMetricsReadOnly`) grants read access to Container Insights logs and Auto Scaling metrics. The policies below are from template version `v0.0.1`. For the latest version, see the [CloudFormation template](https://yasu-public.s3.eu-central-1.amazonaws.com/root/yasu-cf-template-v0.0.1.json). Key statements: **YasuBillingReadOnly** — Read-only access to billing, cost, and resource data: ```json theme={null} { "Sid": "YasuBillingReadOnly", "Effect": "Allow", "Action": [ "application-autoscaling:Describe*", "aws-portal:ViewBilling", "aws-portal:ViewUsage", "budgets:Describe*", "budgets:View*", "ce:Describe*", "ce:Get*", "ce:List*", "cloudwatch:Get*", "cloudwatch:List*", "cloudwatch:Describe*", "cloudfront:GetDistribution", "cloudfront:GetDistributionConfig", "cloudfront:ListDistributions", "cloudfront:ListTagsForResource", "compute-optimizer:Describe*", "compute-optimizer:Get*", "cost-optimization-hub:Get*", "cost-optimization-hub:List*", "cur:Describe*", "directconnect:Describe*", "ec2:Describe*", "ec2:List*", "ecr:Describe*", "ecr:List*", "eks:Describe*", "eks:List*", "elasticache:List*", "elasticfilesystem:Describe*", "elasticloadbalancing:Describe*", "es:Describe*", "es:List*", "glacier:Describe*", "kafka:Describe*", "kafka:List*", "lambda:Get*", "lambda:List*", "organizations:Describe*", "organizations:List*", "pi:Describe*", "pi:Get*", "pi:List*", "pricing:*", "rds:Describe*", "rds:List*", "redshift:Describe*", "redshift:List*", "route53:Get*", "route53:List*", "s3:GetBucketLocation", "s3:GetBucketTagging", "s3:List*", "sagemaker:Describe*", "sagemaker:List*", "savingsplans:Describe*", "sqs:List*", "ssm:Describe*", "ssm:List*", "support:*", "tag:Get*", "tag:GetResources", "trustedadvisor:Get*", "trustedadvisor:List*" ], "Resource": "*" } ``` **YasuContainerInsightsReadOnly** — Container Insights log access: ```json theme={null} { "Sid": "YasuContainerInsightsReadOnly", "Effect": "Allow", "Action": [ "logs:List*", "logs:Describe*", "logs:StartQuery", "logs:StopQuery", "logs:Filter*", "logs:Get*" ], "Resource": "arn:aws:logs:*:*:log-group:/aws/containerinsights/*" } ``` **YasuContainerMetricsAccess** — Auto Scaling and CloudWatch metrics: ```json theme={null} { "Sid": "YasuContainerMetricsAccess", "Effect": "Allow", "Action": [ "autoscaling:Describe*", "cloudwatch:Describe*", "cloudwatch:Get*", "cloudwatch:List*" ], "Resource": "*" } ``` ### 3. Cost and Usage Report (CUR) An S3 bucket and CUR configuration for detailed billing data: * **Bucket**: `yasu-cur-{unique-id}` * **Report granularity**: Daily * **Format**: Parquet (optimized for analysis) ## What Yasu Will Scan Once connected, Yasu analyzes your AWS environment for optimization opportunities: ### Cost Optimization Insights * **Idle EC2 Instances** — Running instances with low CPU/network utilization * **Oversized Instances** — Instances that can be downsized based on usage patterns * **Unattached EBS Volumes** — Volumes not connected to any instance * **Old EBS Snapshots** — Snapshots older than retention policies * **Unused Elastic IPs** — Static IPs not associated with running resources * **Idle RDS Instances** — Databases with minimal connections or queries * **Underutilized Lambda** — Functions with excess memory allocation * **S3 Storage Classes** — Buckets that could benefit from lifecycle policies ### Savings Opportunities * **Reserved Instance Coverage** — Recommendations for RI purchases * **Savings Plans** — Compute and EC2 Savings Plan opportunities * **Spot Instance Candidates** — Workloads suitable for Spot pricing ## Cost Optimization Hub Recommendations Yasu surfaces recommendations from **AWS Cost Optimization Hub (COH)** — AWS's own consolidated recommendation engine. COH brings rightsizing, idle-resource, Reserved Instance, and Savings Plans recommendations across your organization into one place, each with an estimated monthly saving. COH recommendations are read through the AWS Cost Optimization Hub API. Enabling it does not add to your AWS bill. Two things must be true for COH recommendations to appear in Yasu: 1. **Cost Optimization Hub is enabled** (opted in) in your AWS account. 2. The **Yasu IAM role has `cost-optimization-hub` read permissions** — included in the current CloudFormation template. ### Enroll in Cost Optimization Hub Cost Optimization Hub is an opt-in AWS service. Enable it once from your **management (payer) account** so recommendations cover your whole organization. 1. Open the **AWS Billing and Cost Management** console 2. In the left navigation, select **Cost Optimization Hub** 3. Click **Enable Cost Optimization Hub** (or **Get started**) 4. Confirm the opt-in ```bash theme={null} aws cost-optimization-hub update-enrollment-status \ --status Active \ --region us-east-1 ``` From your management account, add `--include-member-accounts` to enroll the entire organization: ```bash theme={null} aws cost-optimization-hub update-enrollment-status \ --status Active \ --include-member-accounts \ --region us-east-1 ``` Cost Optimization Hub is a global service — its API lives in **us-east-1**, so run the command with `--region us-east-1`. After enrolling, AWS can take up to **24 hours** to generate the first recommendations. If you're a **new customer**, that's all you need — the CloudFormation template you deployed already grants Yasu the read permission, so COH recommendations appear automatically once AWS has generated them. ## Existing Customers: Add the Cost Optimization Hub Permission If you connected your AWS account **before August 2026**, your Yasu IAM role was created from an earlier template that did **not** include Cost Optimization Hub permissions. The template has since been updated, so you need to refresh your role once to add: ``` cost-optimization-hub:Get* cost-optimization-hub:List* ``` Without these permissions, Yasu cannot read Cost Optimization Hub, and COH recommendations will not appear. Choose either option below. ### Option A — Update your CloudFormation stack (recommended) Update your existing Yasu stack to the latest template. Your parameters and role ARN stay the same; only the permissions change. 1. Open **AWS CloudFormation** 2. Select your existing Yasu stack (named `yasu-*` or `YasuIntegration-*`) 3. Click **Update** → **Replace existing template** 4. Under **Amazon S3 URL**, paste: ``` https://yasu-public.s3.eu-central-1.amazonaws.com/root/yasu-cf-template-latest.json ``` 5. Click **Next** through the parameter and options screens — **keep all existing parameter values** 6. On the review screen, check **I acknowledge that AWS CloudFormation might create IAM resources** 7. Click **Update stack** Replace `YOUR-STACK-NAME` with your stack's name (find it in the CloudFormation console): ```bash theme={null} aws cloudformation update-stack \ --stack-name YOUR-STACK-NAME \ --template-url https://yasu-public.s3.eu-central-1.amazonaws.com/root/yasu-cf-template-latest.json \ --parameters \ ParameterKey=YasuID,UsePreviousValue=true \ ParameterKey=YasuHandshakeID,UsePreviousValue=true \ ParameterKey=YasuIamRole,UsePreviousValue=true \ ParameterKey=ReportName,UsePreviousValue=true \ ParameterKey=BucketName,UsePreviousValue=true \ ParameterKey=YasuPingbackArn,UsePreviousValue=true \ ParameterKey=TemplateVersion,UsePreviousValue=true \ ParameterKey=TemplateUrl,UsePreviousValue=true \ --capabilities CAPABILITY_IAM \ --region us-east-1 ``` The update completes in **1–2 minutes**, ending in status **UPDATE\_COMPLETE**. Nothing else in your account changes — the role keeps the same ARN, and Yasu stays connected throughout. ### Option B — Add the permission manually If you'd rather not update the stack, add the two actions to the role's policy directly: 1. Open **IAM → Roles** and find `YasuCostOptimizationRole-*` 2. Open the attached **YasuCostOptimizationPolicy-**\* policy and click **Edit** 3. Add these two actions to the `Action` list: ```json theme={null} "cost-optimization-hub:Get*", "cost-optimization-hub:List*" ``` 4. Click **Save changes** A manual edit is overwritten the next time the CloudFormation stack updates. Option A keeps your role in sync with the template going forward. ### Then enroll in COH Adding the permission lets Yasu **read** Cost Optimization Hub, but AWS only generates recommendations once COH is **enabled**. If you haven't already, [enroll in Cost Optimization Hub](#enroll-in-cost-optimization-hub) as described above. ## Data Sync Schedule | Data Type | Initial Sync | Ongoing Sync | | ------------------- | --------------- | ------------- | | Cost data | Last 12 months | Daily | | Resource inventory | Current state | Every 6 hours | | Utilization metrics | Last 14 days | Daily | | Recommendations | Within 24 hours | Weekly | ## Troubleshooting **Common causes:** 1. **Insufficient permissions** — Ensure you have `cloudformation:*`, `iam:*`, and `s3:*` permissions 2. **S3 bucket name conflict** — The bucket name must be globally unique; try again to generate a new name 3. **Service limits** — Check if you've hit IAM role limits **Solution:** Delete the failed stack and try the connection again from Yasu. **What to check:** 1. Verify the CloudFormation stack status is `CREATE_COMPLETE` 2. Check that the stack wasn't rolled back 3. Ensure the callback URL is accessible (no VPN/firewall blocking) **Solution:** Wait 5 minutes, then refresh. If still pending, delete the stack and reconnect. **What to check:** 1. **Cost Explorer is enabled** — Go to AWS Billing → Cost Explorer → Enable 2. **Sufficient history** — Cost Explorer needs \~24 hours to populate after first enable 3. **IAM permissions** — Verify the role has `ce:*` permissions **Solution:** Enable Cost Explorer if needed, then wait 24 hours for data to populate. **What to check:** 1. **Regional coverage** — Some resources may be in regions not yet scanned 2. **API rate limits** — Large accounts may take longer to fully scan 3. **Missing permissions** — Verify all Describe permissions are in place **Solution:** Wait for the full sync cycle (up to 6 hours for large accounts). ## Connecting Multiple AWS Accounts If you have multiple AWS accounts (e.g., production, staging, development), you can connect each one: 1. Go to **Settings** → **Integrations** 2. Click **Connect AWS** for each additional account 3. Deploy the CloudFormation stack in each account **AWS Organizations:** If you use AWS Organizations, connect the management account first for organization-wide visibility. ## Next Steps Add your Google Cloud accounts for multi-cloud visibility. Add your Microsoft Azure accounts for multi-cloud visibility. # Azure Source: https://docs.yasu.cloud/guides/connect-azure Complete guide to connect your Microsoft Azure account to Yasu for cost analysis and optimization 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. **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. 1. Log in to your Yasu dashboard at [app.yasu.cloud](https://app.yasu.cloud) 2. **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 3. On the **Onboarding** page, Click the **Connect** button next to Azure This opens the Azure connection dialog with step-by-step instructions. In the dialog, you'll see an Azure CLI command to create a Service Principal: 1. **Copy the command** from the dialog (it is pre-filled with your account ID) 2. **Open Azure Cloud Shell** or your local terminal with Azure CLI installed 3. **Paste and run the command** The command creates a Service Principal named `yasu-cost-optimizer-{your-account-id}` and returns a JSON output like: ```json theme={null} { "appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "displayName": "yasu-cost-optimizer-...", "password": "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" } ``` 4. **Copy the entire JSON output** and paste it into the text box in the dialog — the credentials will be auto-filled from it 5. Click **Next** **Important:** Save this output securely. The `password` (client secret) is only shown once and cannot be retrieved again. The dialog will prompt you to enter the subscription ID where your Azure resources are hosted: 1. **Enter your Azure Subscription ID** in the provided field 2. The dialog will **automatically regenerate** the three role assignment commands with your subscription ID and App ID filled in 3. **Copy the commands** for your platform (Bash/Linux/macOS or PowerShell) 4. **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. 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** Click **Connect**. Yasu will validate the connection and, once confirmed, automatically advance to the **Invite Members** step. Yasu will automatically verify your connection: * ✅ **Authentication test** - Verifies Service Principal credentials * ✅ **Permission check** - Confirms required roles are assigned This typically takes **10-30 seconds**. If validation fails, check your credentials and ensure role assignments have propagated (wait 5 minutes after assigning roles). Once verified, the dialog will close and you'll see: * ✅ **Azure connection**: Active * ✅ **Onboarding progress**: Automatically advances to the next step Your first cost-saving insights will appear within **5-10 minutes** after connection. ## Manual Setup via Azure Portal If you prefer to set up the Service Principal manually through the Azure Portal: 1. Navigate to **Azure Portal** → **Microsoft Entra ID** (Azure Active Directory) 2. Go to **App registrations** → **+ New registration** 3. Set **Name**: `yasu-cost-optimizer-{your-account-id}` 4. Select **Accounts in this organizational directory only** 5. Click **Register** 6. **Copy the following values** (you'll need them later): * **Application (client) ID** * **Directory (tenant) ID** 1. In the app registration, go to **Certificates & secrets** 2. Click **+ New client secret** 3. Enter a **Description**: `Yasu Access Key` 4. Select **Expires**: Choose **24 months** (recommended) 5. Click **Add** 6. **Copy the secret Value immediately** - it won't be shown again **Important:** If this secret expires, you'll need to create a new one and update it in Yasu before expiration. Set a reminder for 30 days before expiration. The Service Principal needs the following roles at the **Subscription** scope: 1. Navigate to **Subscriptions** → Select your subscription 2. Go to **Access control (IAM)** → **+ Add** → **Add role assignment** 3. 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** **Role 2: Cost Management Reader** * Repeat the process with **Cost Management Reader** role **Role 3: Monitoring Reader** * 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. 1. Return to the **Onboarding** page in Yasu 2. Click **Connect** next to Azure to open the connection dialog 3. 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 4. 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 **Common causes:** 1. **Wrong tenant ID** - Verify you're using the correct Directory (tenant) ID 2. **Wrong client ID** - Check the Application (client) ID matches your app registration 3. **Wrong client secret** - The secret may have expired or been regenerated 4. **Secret expired** - Create a new client secret and update it in Yasu **Solution:** ```powershell theme={null} # Verify credentials work az login --service-principal \ --username {client-id} \ --password {client-secret} \ --tenant {tenant-id} # If failed, reset credentials az ad app credential reset --id {client-id} ``` **What to check:** 1. **Missing role assignments** - Verify all three roles are assigned (Reader, Cost Management Reader, Advisor Reviews Reader) 2. **Role propagation delay** - Azure role assignments can take up to 5 minutes to propagate 3. **Wrong scope** - Ensure roles are assigned at the Subscription level, not Resource Group level **Solution:** ```powershell theme={null} # Check current role assignments az role assignment list --assignee {client-id} --all # Add missing role az role assignment create \ --assignee {client-id} \ --role "Cost Management Reader" \ --scope "/subscriptions/{subscription-id}" # Wait 5 minutes for propagation ``` **What to check:** 1. **Wrong subscription ID** - Verify the subscription ID is correct 2. **Service Principal not granted access** - The SP needs Reader role at subscription scope 3. **Subscription disabled** - Check subscription state in Azure Portal **Solution:** ```powershell theme={null} # List available subscriptions az account list --output table # Verify subscription exists and is enabled az account show --subscription {subscription-id} # Grant access to subscription az role assignment create \ --assignee {client-id} \ --role "Reader" \ --scope "/subscriptions/{subscription-id}" ``` **What to check:** 1. **Cost Management API access** - Verify Cost Management Reader role is assigned at subscription scope 2. **Data delay** - Cost data may take 24-48 hours to appear after first connection 3. **Subscription billing** - Ensure the subscription has active billing and resources 4. **Role propagation** - Wait 5 minutes after assigning roles before testing the connection **Solution:** * 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 **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) **What to do:** 1. Create a new client secret in Azure Portal (App Registration → Certificates & secrets) 2. 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 **Important:** Update the secret at least 30 days before expiration to avoid service interruption. **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 **Solution:** * 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 ## Done! That's it! You have successfully connected your Azure account to Yasu. Once verified, Yasu will start analyzing your Azure billing, resource usage, and performance metrics to provide optimization insights. # Azure DevOps Source: https://docs.yasu.cloud/guides/connect-azure-devops Connect Azure DevOps to Yasu with a Personal Access Token so Yasu can post cloud cost-impact analysis on your pull requests Connect **Azure DevOps** to Yasu with a **Personal Access Token (PAT)**. Yasu uses this token to register pull request webhooks (Service Hooks) on the repositories you select, and to post the cost-impact analysis back to each PR as a comment and a status check. Comments and the status badge are authored by whichever user owns the PAT, so we recommend creating a dedicated **service-account user** (for example, `Yasu Bot`) rather than using a personal account. For Microsoft's reference, see the [Azure DevOps personal access tokens docs](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate). ## Prerequisites Before you start, make sure: * You use **Azure DevOps Services** (`https://dev.azure.com/your-org`). * You can create (or already have) a user with access to the projects whose pull requests you want analyzed. * That user can create a **Personal Access Token** in your organization. By default, comments on your PRs appear under the name of the user who owns the PAT. Using a dedicated service-account user keeps Yasu's comments under a clear bot identity instead of a teammate's name. ## Permissions Yasu requests Yasu asks for a PAT with the **minimum scopes** needed to analyze pull requests and post results. Create the token with exactly these four scopes: | Scope | Access | Why Yasu needs it | | ------------------------ | ------------ | ------------------------------------------------------------------------------- | | **Code** | Read | Read the PR diff and the source files to estimate the cost impact of the change | | **Code** | Status | Post the "Yasu cost analysis" status check on the pull request | | **Pull Request Threads** | Read & write | Post the cost-impact comment and reply to `@yasu` mentions | | **Project and Team** | Read | List the projects the user can access so you can pick repositories | **What this token cannot do.** These scopes are read- and comment-only. A leaked PAT **cannot** push code, delete branches, force-merge or complete pull requests, change repository settings, or modify pipelines — it can only read code, post PR comments, and post the status check. If your PAT screen doesn't show **Pull Request Threads** as its own checkbox, expand **Custom defined → Show all scopes**. As a fallback, **Code (Read & write)** plus **Code (Status)** also works. ## Steps 1. In Azure DevOps, open **Organization settings → Users**. 2. [Add a new user](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/add-organization-users) with a display name like `Yasu Bot`. 3. Grant it access to the projects whose pull requests you want analyzed. You can skip this step and use your own account, but PR comments will then appear under your name. 1. Sign in to Azure DevOps as the user that will own the token. 2. Click the **user-settings (gear) icon** in the top-right header and choose **Personal access tokens**. 3. Click **New Token** and set: * **Name:** `Yasu` * **Organization:** the organization you want to connect * **Expiration:** choose a date that matches your security policy * **Scopes:** select the four scopes from [Permissions Yasu requests](#permissions-yasu-requests) 4. Click **Create**. 5. Copy the token immediately and store it somewhere safe. Azure DevOps shows the token value only once. If you lose it, create a new token. 1. In Yasu, go to **Integrations → Azure DevOps**. 2. Enter your **Organization URL** (`https://dev.azure.com/your-org`) and paste the **PAT**. 3. Click **Validate**, then **Connect**. Yasu validates the token and lists the projects it can access. 1. Choose the projects and repositories you want Yasu to monitor. 2. Save the configuration. Yasu registers the required pull request **Service Hooks** on those repositories so new and updated PRs are analyzed automatically. 1. Open a pull request in one of the selected repositories. 2. Wait for the webhook to reach Yasu. 3. Confirm that Yasu posts a **cost-impact comment** and a **status check**, and that the PR appears on the **PR Analysis** page in Yasu. You can also mention `@yasu` in a PR comment to ask a follow-up question about the change. ## What Yasu does with this access Once connected, Yasu: * registers **Service Hooks** for pull request events on the repositories you selected; * reads the **PR diff and affected files** to estimate the monthly cloud cost impact of the change; * posts a **cost-impact comment** and a **status check** on the PR; * responds to **`@yasu` mentions** in PR comments; * shows every analyzed PR on the **PR Analysis** page in the Yasu dashboard. Yasu never pushes code, completes or abandons pull requests, or changes repository or pipeline settings. ## Troubleshooting Check that: * the **Organization URL** is `https://dev.azure.com/your-org` (not a project or repo URL); * the token has **not expired** or been revoked; * the token was created for the **same organization** you entered; * the token has the four scopes listed above (at minimum **Project and Team → Read** so Yasu can list projects). Usually the token is missing a scope. Confirm: * **Pull Request Threads → Read & write** (for the comment), and * **Code → Status** (for the status check). If **Pull Request Threads** isn't a separate checkbox, use **Code (Read & write)** plus **Code (Status)**. Recreate the token with the correct scopes, reconnect, and open or update the PR again. Comments are authored by the user who owns the PAT. Create a dedicated service-account user (for example `Yasu Bot`), generate the PAT as that user, and reconnect so comments appear under the bot identity. Yasu can only see projects the token owner can access. Grant the service-account user access to the project in **Organization settings → Users**, then reconnect or refresh the repository list. # Bitbucket Source: https://docs.yasu.cloud/guides/connect-bitbucket Install the Yasu Forge app to get AI-powered PR cost analysis on your Bitbucket repositories Connect **Bitbucket** to Yasu by installing the Yasu Forge app from the Atlassian Marketplace. Yasu analyzes pull requests for infrastructure cost impact and posts AI-powered review comments. ## Prerequisites Before you start, make sure: * You have **Admin** permission on the Bitbucket workspace where you want to install the app * At least one repository contains Terraform, Pulumi, or other infrastructure-as-code files ## Steps 1. Log in to your Yasu dashboard at [app.yasu.cloud](https://app.yasu.cloud) 2. Go to **Settings** → **Integrations** 3. Click **Connect** next to Bitbucket A new tab opens to the Atlassian Marketplace Forge install page. 1. Select the **workspace** you want to connect 2. Click **Install** to add the Yasu Forge app 3. Return to the Yasu tab when the installation is complete The Forge app uses Atlassian's webtrigger architecture to securely communicate between Bitbucket and Yasu. Back in Yasu, the page automatically detects the Forge app installation. When your workspace appears, click **Link Workspace** to complete the connection. Detection typically takes 10–30 seconds. If it does not appear, click **Open Install Page Again** to verify the app was installed. 1. Browse the available repositories in your connected workspace 2. Click **Add** on the repositories you want Yasu to analyze 3. Click **Save Configuration** Yasu will begin monitoring pull requests on the selected repositories. 1. Open or update a pull request that modifies infrastructure code in one of the selected repositories 2. Wait for the Yasu webhook to fire 3. Confirm the cost analysis comment appears on the PR PR analysis comments typically appear within **1–2 minutes** of opening or updating a pull request. ## Troubleshooting **Common causes:** * A popup blocker is preventing the new tab from opening * You do not have **Admin** permission on the Bitbucket workspace **Solution:** Allow popups for app.yasu.cloud in your browser settings. If you lack permissions, ask a workspace admin to install the app. **Common causes:** * The app was installed into a different workspace than expected * The installation did not complete successfully **Solution:** Verify the app is listed in **Bitbucket** → **Workspace settings** → **Installed apps**. If it is not there, click **Connect** in Yasu again to restart the installation flow. **What to check:** 1. Verify the repository is selected in Yasu's integration settings 2. Confirm the pull request modifies infrastructure-as-code files (Terraform, Pulumi, CloudFormation, etc.) 3. Check that the Forge app is listed as installed in your Bitbucket workspace settings If the issue persists, disconnect and reconnect the Bitbucket integration from **Settings** → **Integrations**. # GCP Source: https://docs.yasu.cloud/guides/connect-gcp Complete guide to connect your Google Cloud Platform account to Yasu for cost analysis and optimization Connect your **GCP account** to Yasu by granting access to Yasu's service account with the necessary permissions. This connection enables Yasu to analyze your cloud costs and provide optimization recommendations. For more detailed instructions on creating and managing Service Accounts and IAM roles in GCP, refer to the [official GCP IAM Documentation](https://cloud.google.com/iam/docs/roles-overview).