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
- You create a connection with
providerazure. It gets an id likeccn_06gk3x9tq7m2v8r4y1c5d0zp8w, the status awaiting role, and asetupwith an Azure CLI script. - 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, audiencepantech-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.Allapplication permission (read-only), so a scan can list your people.
- an app registration,
- 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.
- The connection is connected, ready to scan, or failed, with a reason and what to do.
Create the connection
$ 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 field | What it is |
|---|---|
access | federated |
issuer_url, audience, subject | Pantech's issuer, pantech-migrate, and this connection's id: what the federated credential matches |
template | The Azure CLI setup script, written for this connection (template_format is shell) |
files | The custom role on its own: pantech-migrate-reader-role.json |
permissions | Every 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:
$ SUBSCRIPTIONS="<subscription-id> <subscription-id>" INCLUDE_PEOPLE=true \ bash pantech-migrate-azure.shA 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:
{"azure":{"tenant_id":"<tenant-id>","client_id":"<application-client-id>","subscription_ids":["<subscription-id>"]}}Send it to Pantech
$ 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:
| Actions | What for |
|---|---|
Microsoft.Resources/subscriptions/read, Microsoft.Resources/subscriptions/resourceGroups/read | The subscriptions and resource groups |
Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/instanceView/read, Microsoft.Compute/locations/vmSizes/read | Virtual machines, their state and their sizes |
Microsoft.Compute/disks/read | Managed disks |
Microsoft.Compute/sshPublicKeys/read | SSH public keys |
Microsoft.Network/virtualNetworks/read, Microsoft.Network/networkInterfaces/read | Virtual networks, subnets and network interfaces |
Microsoft.Network/networkSecurityGroups/read | Network security groups |
Microsoft.Network/publicIPAddresses/read | Public addresses |
Microsoft.Network/loadBalancers/read | Load balancers |
Microsoft.DBforPostgreSQL/flexibleServers/read, Microsoft.DBforMySQL/flexibleServers/read | PostgreSQL and MySQL flexible servers |
Microsoft.Sql/servers/read, Microsoft.Sql/servers/databases/read | Azure SQL servers and databases |
Microsoft.Storage/storageAccounts/read | Storage account names |
Microsoft.Authorization/roleAssignments/read, Microsoft.Authorization/roleDefinitions/read | Who holds which role, for people |
Microsoft.CostManagement/query/action | Three 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
| Code | What it means | What to do |
|---|---|---|
assume_role_denied | Pantech couldn't sign in as the app | Check the setup script finished, and that the tenant and application (client) ids you sent are the ones it printed. Then retry |
permission_missing | The app is missing its role on a subscription | Run the latest setup script again for every subscription you chose, then retry |
provider_unavailable | Azure did not answer in time | Retry in a few minutes |
internal | Something went wrong on Pantech's side | Retry; 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
- 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. - In Azure, delete the app registration and the custom role. Deleting the app alone already cuts access.