# SubscriptionNotFound: The subscription 'x' could not be found

**Code:** `SubscriptionNotFound` · **Category:** Azure · **Seen on:** Azure

The subscription ID doesn’t exist in the current tenant or the identity has no access to it.

## Meaning

Logging in to the wrong tenant, using a subscription ID from another environment, or a service principal without any role on the subscription.

## Common causes

- Wrong tenant in az login
- Subscription ID typo or from another directory
- No role assignment for the identity
- Subscription disabled/cancelled

## Quick fix

1. az account list --all to see accessible subscriptions
2. az login --tenant <id>
3. Assign a role on the subscription to the principal

## Detailed fix by platform

### Azure CLI

1. 

```bash
az account list --all -o table
az login --tenant <tenant-id>
az account set --subscription <id>
```


## How to diagnose

1. **Tenant** — Current tenant
2. **Access** — Role assignments
3. **State** — Enabled?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/azure/subscriptionnotfound)
