Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Si applica a:✅ Analisi incorporata di Power BI per i tuoi clienti (App-owns-data)
Questo articolo spiega come incorporare contenuto di Power BI che usa OLS (sicurezza a livello di oggetto) in uno scenario di Power BI App owns data (incorporamento per i propri clienti).
In questo scenario, il fornitore di software indipendente ha una tabella con dati sensibili e metadati che vuole nascondere ai clienti del report.
Per altre informazioni sulla sicurezza a livello di oggetto, vedere Sicurezza a livello di oggetto (OLS).
Prerequisiti
Questo articolo presuppone che si disponga di un report che usa OLS e che si desideri incorporarlo in un'app. Per creare un report che usa OLS, vedere Sicurezza a livello di oggetto (OLS).
Il report può essere compilato usando uno dei modelli seguenti:
- Cloud OLS
- Report connesso in tempo reale ad Azure Analysis Services con ruoli di sicurezza a livello di oggetto
- Report con connessione live a SQL Server Analysis Services con ruoli OLS
Incorporare un report che usa la sicurezza a livello di oggetto
Il processo di generazione dei token di incorporamento per gli elementi che utilizzano la sicurezza a livello di oggetto è lo stesso di quello per la sicurezza a livello di riga statica. Sono necessari il ruolo e il nome utente.
Se il report da incorporare usa uno degli scenari seguenti, potrebbe essere necessario eseguire alcuni passaggi aggiuntivi:
- Generazione di token OLS cloud
- Generazione di token di SQL Server Analysis Services SSAS
- Generazione di token di Microsoft Entra ID
L'esempio seguente mostra come generare un token per nascondere una tabella con informazioni riservate utilizzando OLS:
public EmbedToken GetEmbedToken(Guid reportId, IList<Guid> datasetIds, [Optional] Guid targetWorkspaceId)
{
PowerBIClient pbiClient = this.GetPowerBIClient();
// Defines the user identity and roles.
var olsIdentity = new EffectiveIdentity(
username: "All",
roles: new List<string>{ "SensitiveTableOLS" }, // Role created to hide a table that has sensitive information
datasets: new List<string>{ datasetId.ToString()}
);
// Create a request for getting an embed token for the OLS identity defined above
var tokenRequest = new GenerateTokenRequestV2(
reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(reportId) },
datasets: datasetIds.Select(datasetId => new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),
targetWorkspaces: targetWorkspaceId != Guid.Empty ? new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(targetWorkspaceId) } : null,
identities: new List<EffectiveIdentity> { olsIdentity }
);
// Generate an embed token
var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);
return embedToken;
}
Considerazioni e limitazioni
Vedi le restrizioni per i modelli OLS.
Contenuto correlato
Sicurezza a livello di oggetto in Azure Analysis Services
Altre domande? Provare a rivolgersi alla Community di Power BI.