> For the complete documentation index, see [llms.txt](https://docs.stoik.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoik.io/help/help-center-en-es/herramientas-de-prevencion/cloud-scan/azure/bad-tenant.md).

# Error de "Bad Tenant"

El `TENANT INCORRECTO` el error aparece cuando la configuración de Azure del escaneo en la nube se ejecuta en un tenant distinto del que autorizó.

## Causa

Al ejecutar el script automático para el escaneo en la nube de Azure, puede aparecer el siguiente error:

`TENANT INCORRECTO - No se encuentra la aplicación Stoïk Cloud Scanner; consulte este enlace para obtener más información`

Este error ocurre cuando la **aplicación Stoïk no se ha registrado correctamente en su entorno de Azure**. La razón principal es que se seleccionó un entorno diferente durante la primera etapa de la configuración y cuando se ejecutó el script.

## Ejemplo

El siguiente ejemplo ilustra una configuración problemática:

{% stepper %}
{% step %}

### Seleccionar el proveedor

El usuario selecciona el proveedor `Microsoft Azure`.

<figure><img src="https://content.gitbook.com/content/aDGGQ49Oui29Ft0kJjSm/blobs/NWPK4gXD1wKs8U1vuOPE/image%20png%20Oct%2003%202024%2009%2016%2002%204325%20AM.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Elegir la cuenta

El usuario selecciona su `xavier@bar.test` cuenta asociada al tenant `bar.test`.

<figure><img src="https://content.gitbook.com/content/aDGGQ49Oui29Ft0kJjSm/blobs/IJMiaLxdwfQvqyMiueVz/image%20png%20Oct%2003%202024%2009%2014%2025%204762%20AM.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Solicitar el registro de la aplicación

La aplicación Stoïk Cloud Scanner solicita registrarse en el tenant `bar.test`.

<figure><img src="https://content.gitbook.com/content/aDGGQ49Oui29Ft0kJjSm/blobs/V2k0lLoguK5BYclSqEXW/image%20png%20Oct%2003%202024%2009%2021%2042%203314%20AM.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Ejecutar el script en un tenant diferente

El usuario intenta ejecutar el script en el tenant `foo.test` (mostrado en la esquina superior derecha de la imagen). Como la aplicación Stoïk Cloud Scanner fue autorizada en un tenant diferente (`bar.test`), el script no puede asignar los roles necesarios en `foo.test`.

<figure><img src="https://content.gitbook.com/content/aDGGQ49Oui29Ft0kJjSm/blobs/9xq9gyyZ3EhqYwuXS0B8/image%20png%20Oct%2003%202024%2009%2034%2044%202548%20AM.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Solución

* Ejecute el script en el mismo tenant de Azure que se usó al autorizar la aplicación Stoïk (el tenant seleccionado en el paso 2 anterior).
* Si no está seguro de qué tenant se utilizó:
  * Desconéctese de todas sus cuentas en <https://portal.azure.com>.
  * Luego reinicie la instalación de la herramienta en Stoïk Protect.

{% hint style="info" %}
Si el problema persiste, contacte a Stoïk en <protect@stoik.io> para obtener más ayuda.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stoik.io/help/help-center-en-es/herramientas-de-prevencion/cloud-scan/azure/bad-tenant.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
