Documentation

esc
    Move to Pantech / Connect Azure

    Connect Azure

    Give Pantech read-only access to your Azure subscriptions with an app registration and a federated credential, without any client secret or certificate, then check, fix or remove the connection.

    Pantech reads your Azure subscriptions as an app registration in your Microsoft Entra ID tenant. The app has no client secret and no certificate: it has one federated credential that trusts Pantech's issuer for your connection only. Pantech signs a token for the connection, and Entra ID swaps it for read-only access. Nothing secret is created or stored.

    You need to be an Owner of the subscriptions you want scanned. To include people, someone who can grant admin consent in the tenant (a Privileged Role Administrator, for example) runs the setup or approves it. On Pantech you need to be an Owner or Admin of your organization.

    How it works

    1. You create a connection with provider azure. It gets an id like ccn_06gk3x9tq7m2v8r4y1c5d0zp8w, the status awaiting role, and a setup with an Azure CLI script.
    2. You run the setup script. It creates:
      • an app registration, Pantech Migrate …, for your tenant only, and its service principal;
      • one federated credential on it: issuer Pantech's (setup.issuer_url), subject this connection's id, audience pantech-migrate, all matched exactly;
      • a custom role, Pantech Migrate reader …, assigned to the app on each subscription you chose;
      • optionally, Microsoft Graph's User.Read.All application permission (read-only), so a scan can list your people.
    3. The script prints a line of JSON. You send it to Pantech, and the connection moves to verifying while Pantech signs in as the app once.
    4. The connection is connected, ready to scan, or failed, with a reason and what to do.

    Create the connection

    Terminal
    $ curl -X POST https://api.pantechdynamics.com/public/v1/cloud-connections \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"provider": "azure", "name": "Production Azure"}'
    setup fieldWhat it is
    accessfederated
    issuer_url, audience, subjectPantech's issuer, pantech-migrate, and this connection's id: what the federated credential matches
    templateThe Azure CLI setup script, written for this connection (template_format is shell)
    filesThe custom role on its own: pantech-migrate-reader-role.json
    permissionsEvery action the custom role holds, and the optional Graph permission

    Save setup.template as pantech-migrate-azure.sh, for example with jq -r .setup.template.

    Run the setup

    Run it in Azure Cloud Shell, or anywhere az login is signed in as an Owner of the subscriptions. SUBSCRIPTIONS lists the subscription ids to scan (1 to 20; it defaults to the one az account show gives). INCLUDE_PEOPLE is true unless you set it to false:

    Terminal
    $ SUBSCRIPTIONS="<subscription-id> <subscription-id>" INCLUDE_PEOPLE=true \    bash pantech-migrate-azure.sh

    A new app and role take a minute to be visible, so the script retries the role assignments for a while. With INCLUDE_PEOPLE=true it adds Graph's User.Read.All and grants admin consent; leave it false if you would rather add people to the plan by hand. It ends by printing what to send to Pantech:

    What the script prints
    {"azure":{"tenant_id":"<tenant-id>","client_id":"<application-client-id>","subscription_ids":["<subscription-id>"]}}

    Send it to Pantech

    Terminal
    $ curl -X PATCH https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w \    -H "Authorization: Bearer $PANTECH_API_KEY" \    -H "Idempotency-Key: $(uuidgen)" \    -H "Content-Type: application/json" \    -d '{"azure": {"tenant_id": "<tenant-id>", "client_id": "<application-client-id>", "subscription_ids": ["<subscription-id>"]}}'

    Poll the connection until status is connected or failed. The tenant and client ids are identifiers, not secrets. To scan more subscriptions later, run the script again for them and send the new list.

    Every permission the role holds

    A custom role rather than the built-in Reader, which allows */read on everything. Each action is named one by one:

    ActionsWhat for
    Microsoft.Resources/subscriptions/read, Microsoft.Resources/subscriptions/resourceGroups/readThe subscriptions and resource groups
    Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/instanceView/read, Microsoft.Compute/locations/vmSizes/readVirtual machines, their state and their sizes
    Microsoft.Compute/disks/readManaged disks
    Microsoft.Compute/sshPublicKeys/readSSH public keys
    Microsoft.Network/virtualNetworks/read, Microsoft.Network/networkInterfaces/readVirtual networks, subnets and network interfaces
    Microsoft.Network/networkSecurityGroups/readNetwork security groups
    Microsoft.Network/publicIPAddresses/readPublic addresses
    Microsoft.Network/loadBalancers/readLoad balancers
    Microsoft.DBforPostgreSQL/flexibleServers/read, Microsoft.DBforMySQL/flexibleServers/readPostgreSQL and MySQL flexible servers
    Microsoft.Sql/servers/read, Microsoft.Sql/servers/databases/readAzure SQL servers and databases
    Microsoft.Storage/storageAccounts/readStorage account names
    Microsoft.Authorization/roleAssignments/read, Microsoft.Authorization/roleDefinitions/readWho holds which role, for people
    Microsoft.CostManagement/query/actionThree months of spend. It is a POST, but it only reads

    Plus, only if you included people, Microsoft Graph User.Read.All (application, read-only), to turn role assignments into names and emails. Virtual machines are listed with their status only, and their user data is never asked for.

    What a scan reads

    Virtual machines, managed disks, virtual networks and subnets, network security groups, public addresses, load balancers, PostgreSQL, MySQL and SQL databases, storage accounts, SSH public keys and spend, in every subscription you listed.

    • Spend is Cost Management's actual cost for the last three whole months, added up over the subscriptions. If any subscription's spend cannot be read, the total is left unknown rather than understated.
    • People are users with a role assignment on the subscriptions, with their email (or their sign-in name when it is not a guest's). An Owner or User Access Administrator is suggested as an Admin on Pantech, anyone else as a Member. Without the Graph permission the plan has no Azure people, and the scan says users_unavailable.

    If the check fails

    CodeWhat it meansWhat to do
    assume_role_deniedPantech couldn't sign in as the appCheck the setup script finished, and that the tenant and application (client) ids you sent are the ones it printed. Then retry
    permission_missingThe app is missing its role on a subscriptionRun the latest setup script again for every subscription you chose, then retry
    provider_unavailableAzure did not answer in timeRetry in a few minutes
    internalSomething went wrong on Pantech's sideRetry; if it keeps happening, contact support

    Retry with PATCH /cloud-connections/{connection_id} and {"retry": true}. Details that do not fit Azure's shape are refused straight away with 422 VALIDATION_FAILED and INVALID_FEDERATION. Troubleshooting has every code.

    The agent, for copies

    Pantech scans this cloud itself, so a scan needs nothing installed. The copy steps that read from inside your network use the Pantech Migrate agent, which this connection can have too: copying a server from the server itself, importing a database and moving a Kubernetes cluster. Enroll it with POST /cloud-connections/{connection_id}/agent-enrollments or pantech migrate agent enroll <connection id>. Here it never scans and needs no Azure credential: only what each copy step needs, in its configuration.

    Disconnect

    1. In Pantech, disconnect the connection: DELETE /cloud-connections/{connection_id}, or ask your AI app. Its scans are deleted with it; plans stay until you delete them.
    2. In Azure, delete the app registration and the custom role. Deleting the app alone already cuts access.

    Was this page helpful?

    Updated