Connecting to databases
Connect to Analysis Services
List of databases supported by the native ADOMD.NET data provider and how to load them
On this page
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.
To add the ADOMD.NET extension, reference the package DubUrl.Adomd.
List of databases supported by ADOMD.NET data provider
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.