HomeDocsCreate a Service Principal
    Setup Guide

    Create an Azure Service Principal

    AtestoCloud uses a Service Principal (SPN) with read-only access to discover and visualize your Azure resources. Follow these steps to create one in under 5 minutes.

    Faster: no Service Principal needed

    In AtestoCloud, click Connect with Microsoft, sign in and pick your subscriptions — AtestoCloud gets the built-in Reader role automatically. Use this guide if you prefer to manage your own Service Principal.

    What you'll need:

    • • An Azure account with Owner or User Access Administrator role on the subscription
    • • Access to the Azure Portal or Azure CLI
    • • Your Azure Subscription ID (find it in the Azure Portal under Subscriptions)
    Option A — Azure Portal (recommended)
    1

    Register a new application

    Go to Azure Portal → App registrations, then click + New registration.

    • • Name: AtestoCloud (or any name you prefer)
    • • Supported account types: Accounts in this organizational directory only (single tenant)
    • • Redirect URI: leave blank

    Click Register.

    2

    Copy the Application credentials

    On the app's Overview page, copy and save these two values — you'll need them in AtestoCloud:

    • • Application (client) ID — this is your Client ID
    • • Directory (tenant) ID — this is your Tenant ID
    3

    Create a client secret

    In the left menu, go to Certificates & secrets → Client secrets → + New client secret.

    • • Description: atestocloud
    • • Expires: 24 months (or your preferred duration)

    Click Add, then immediately copy the Value column — it is only shown once.

    ⚠️ Copy the secret value now. Once you navigate away, it will be hidden and you'll need to create a new one.
    4

    Grant Reader access on your subscription

    Go to Azure Portal → Subscriptions, select your subscription, then click Access control (IAM).

    • 1. Click + Add → Add role assignment
    • 2. Role tab: select Reader, click Next
    • 3. Members tab: click + Select members, search for AtestoCloud (the app you just created), select it
    • 4. Click Review + assign → Assign
    AtestoCloud only needs Reader (read-only) access. It cannot create, modify, or delete any Azure resources.
    5

    Add the SPN to AtestoCloud

    Go to Settings → Service Principals → Add SPN in AtestoCloud and enter:

    • • Tenant ID — from Step 2
    • • Client ID — from Step 2
    • • Client Secret — from Step 3
    • • Subscription ID — from your Azure Subscriptions page

    Click Save & Test — AtestoCloud will verify the connection immediately.

    Option B — Azure CLI (faster)

    If you have the Azure CLI installed, run these two commands to create the SPN and assign the role in one step:

    1. Set your subscription ID:

    SUBSCRIPTION_ID="your-subscription-id-here"

    2. Create SPN with Reader role:

    az ad sp create-for-rbac \
      --name "AtestoCloud" \
      --role Reader \
      --scopes /subscriptions/$SUBSCRIPTION_ID

    The command outputs JSON with all four values you need:

    {
      "appId":       "<-- this is your Client ID",
      "displayName": "AtestoCloud",
      "password":    "<-- this is your Client Secret (copy now!)",
      "tenant":      "<-- this is your Tenant ID"
    }
    Enter these values in AtestoCloud Settings → Service Principals → Add SPN, along with your Subscription ID.

    Multiple subscriptions

    To visualize multiple Azure subscriptions, repeat Step 4 (portal) or run the CLI command for each subscription ID. You can use the same Service Principal across all subscriptions — just assign the Reader role on each one. In AtestoCloud, add a separate SPN entry per subscription.

    Troubleshooting

    "AuthenticationFailed" or "InvalidClientSecret"

    The client secret is wrong or has expired. Go to App registrations → Certificates & secrets and create a new secret.

    "The client does not have authorization"

    The Reader role assignment hasn't propagated yet (can take up to 2 minutes), or was assigned to the wrong subscription. Verify in Access control (IAM) → Role assignments.

    "TenantNotFound"

    Double-check the Tenant ID. It should be a UUID like 00000000-0000-0000-0000-000000000000 found on the app's Overview page.

    No resources appear after scanning

    Confirm the Subscription ID is correct and that resources exist in that subscription. Try running the scan again from the dashboard.

    Ready to visualize your Azure infrastructure?

    Add your first Service Principal and start a scan in under a minute.

    Get started free