ADOMD.NET data provider connects to an analytics data source such as Power BI Premium, Power BI Desktop or SQL Server Analysis Services and provides a way to execute queries against that data source in a consistent manner that is independent of the data source and data source-specific functionality.

Before you connect

To add the ADOMD.NET extension, reference the package DubUrl.Adomd.

List of databases supported by ADOMD.NET data provider

Database Aliases Package name / Provider invariant name        
Azure Analysis Services asazure, asa Microsoft.AnalysisServices.AdomdClient Go to Nuget repository      
Power BI Desktop pbidesktop, pbix, powerbidesktop Microsoft.AnalysisServices.AdomdClient Go to Nuget repository      
Power BI Premium powerbi, pbi, pbiazure, pbipremium, powerbipremium Microsoft.AnalysisServices.AdomdClient Go to Nuget repository      
SQL Server Analysis Services - Multidimensional ssasmultidim, ssasmdx Microsoft.AnalysisServices.AdomdClient Go to Nuget repository      
SQL Server Analysis Services - Tabular ssastabular, ssasdax Microsoft.AnalysisServices.AdomdClient Go to Nuget repository      

Example

Install DubUrl and DubUrl.Adomd, and configure access to your Power BI Premium dataset. The extension supplies both its mappings and its factory wrapper:

using System.Data.Common;
using DubUrl;
using DubUrl.Adomd.Mapping;
using DubUrl.Adomd.Wrappers;
using DubUrl.Mapping;

DbProviderFactories.RegisterFactory(
    "Microsoft.AnalysisServices.AdomdClient", AdomdFactory.Instance);
var registry = new ProviderCatalogBuilder()
    .AddModule(new AttributeProviderModule([.. new AssemblyTypesProbe().Assemblies, typeof(PowerBiPremiumMapper).Assembly]))
    .Build();
var url = Environment.GetEnvironmentVariable("DUBURL_POWERBI_URL")
    ?? throw new InvalidOperationException("Set DUBURL_POWERBI_URL first.");
using var connection = new ConnectionUrl(url, registry).Open();

Use a URL such as powerbi://api.powerbi.com/v1.0/myorg/{dataset}, replacing the dataset placeholder and configuring authentication for your environment. powerbi, pbi, pbiazure, pbipremium, and powerbipremium select the same Power BI mapping.