# Creating embed token for accessing dataset

<figure><img src="/files/p7L9uvgUvy42KjKOiD49" alt=""><figcaption></figcaption></figure>

#### Passo 1: Conectar ao Servidor via SSMS

**1.1. Obter o Server Name**

1. Acesse o **Azure Portal**.
2. Vá até o recurso **Azure Analysis Services**.
3. No menu **Overview**, copie o **Server Name**.

<figure><img src="/files/dxogd6luYPy8gnsjvY6A" alt=""><figcaption></figcaption></figure>

**1.2. Conectar no SSMS**

1. Abra o **SQL Server Management Studio (SSMS)**.
2. Clique em **Conectar** e selecione a opção **Analysis Services**.

<figure><img src="/files/pmFi9mt9IJ2ldodDNGXk" alt=""><figcaption></figcaption></figure>

3. No campo **Server Name**, cole o valor copiado anteriormente, Insira suas credenciais no campo **Username** e clique em **Conectar**.

<figure><img src="/files/XzWPn2S3QwM9L9VTbwpE" alt=""><figcaption></figcaption></figure>

**1.3. Adicionar o Service Principal**

1. Após a conexão, clique com o botão direito sobre o servidor e selecione **Propriedades**.

<figure><img src="/files/l3rkSTdlmECgAzpVc0LF" alt=""><figcaption></figcaption></figure>

2. Na nova janela, vá até a guia **Segurança e** Clique em **Add** para adicionar um **Service Principal**.

<figure><img src="/files/RjmDV1RWnEM7zlau4ihq" alt=""><figcaption></figcaption></figure>

3. Em **Manual Entry**, insira o service principal no seguinte formato:  app:AppicationClientID\@DirectoryTenantID

<figure><img src="/files/O9yqsvC1HH8E0BtZlKb4" alt=""><figcaption></figcaption></figure>

<details>

<summary>Passo 2: Obter o Application Client ID e Directory Tenant ID</summary>

* No **Azure Portal**, acesse **Microsoft Entra ID**.

<img src="/files/LzyIvlkkT4fx14ghv0CB" alt="" data-size="original"><br>

* No menu lateral, clique em **App Registrations** (Registro de Aplicativos) e busque pelo **service principal** criado durante a instalação do portal (por padrão, o nome é **PowerEmbedded-app**).

<img src="/files/0f6XJNzIB8r4uqz0rWYH" alt="" data-size="original">

* Copie os seguintes valores:
  * **Application Client ID**
  * **Directory Tenant ID**

![](/files/OBRTaeFIKuwMmipqKqMq)

* Monte a string no formato correto:

  ```
  App<ApplicationClientID>@<DirectoryTenantID>
  ```

  Exemplo:

  ```
  app:436fed95-c8bc-4e1a-92d7-99a52c353675@ec50c6a3-b95c-4f22-8424-318f1cd459c6
  ```
* Volte ao **SSMS**, cole esse valor no campo **Manual Entry** e clique em **Add**.

![](/files/yJ7jSsrM9TNqQQRN0rQD)<br>

* Confirme as alterações clicando em **OK**.

![](/files/o7DgV6rSC2Bt2yGB5D32)

</details>

Feito esse processo nós acabamos de adicionar o PowerEmbedded-app com administrador do Azure Analysis Service, o próximo passo é acessar o portal de administração do Power Embedded e clicar em salvar, siga o passo 3.

<details>

<summary>Passo 3: Acessar o portal do Power Embedded<br></summary>

* Acesse o **Portal de Administração do Power Embedded e** vá até **Configurações** e clique no botão de salvar.&#x20;

![](/files/KZf0vb4dtGPFLI2U9Vlu)<br>

Feito isso os relatórios irão funcionar normalmente

</details>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerembedded.com.br/portal-de-relatorios/problemas-mais-comuns/creating-embed-token-for-accessing-dataset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
