Power BIEmbedded
Power BIEmbedded
Power BIEmbedded
•
3. Código
{
"authenticationMode": "MasterUser",
"authorityUri": "https://login.microsoftonline.com/common/",
"scope": "https://analysis.windows.net/powerbi/api",
"apiUrl": "https://api.powerbi.com/",
"clientId": "el identificador de nuestra app de AAD”,
"workspaceId": "id workspace donde tenemos el contenido a embeber",
"reportId": "id report que queremos embeber",
"pbiUsername": "cuenta del tenant con licencia PowerBI PRO y acceso
al workspace",
"pbiPassword": "Password de esa cuenta que hará de proxy",
"clientSecret": "id secreto de la app AAD",
"tenantId": "id del tenant de AAD"
}
Esquema de uso PBIE para organización
Paso a producción
3. Código
authenticate(): void {
const thisObj = this;
const msalConfig = {
auth: {
clientId: config.clientId
}
};
const loginRequest = {
scopes: config.scopes
};
accessToken = response.accessToken;
thisObj.setUsername(response.account.name);
thisObj.getembedUrl();
} else {
msalInstance.handleRedirectCallback(successCallback, failCallBack
);
// check if there is a cached user
if (msalInstance.getAccount()) {
1. Flujo de información
2. Petición del cliente
3. Servicio Express
$.ajax({
type: "GET",
url: "/getEmbedToken",
dataType: "json",
data:{"report":"area"},
success: function(embedData) {
// Embed Power BI report when Access token and Embed URL are avai
lable
let report = powerbi.embed(reportContainer, reportLoadConfig);