Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I get the error on my browser, while trying to run my .NET MVC App.
OptionsValidationException: IDW10106: The Instance option must be provided
I have followed the PowerBI Developer in a Day Tutorial to get this setup. There are no errors showing up in my code. Any guidance on where to look for errors. This is how my Program.cs and Startup.cs file looks like.
Program.cs
var builder = WebApplication.CreateBuilder(args);
var startup = new SalesReporting.Startup(builder.Configuration);
startup.ConfigureServices(builder.Services);
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
Startup.cs
using Microsoft.Identity.Web;
using PowerBiEmbed.Services;
namespace SalesReporting
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
string[] scopes = new string[] { PowerBiApiService.PowerBiDefaultScope };
services.AddMicrosoftIdentityWebAppAuthentication(Configuration)
// Enable token acquisition from ITokenAcquisition
.EnableTokenAcquisitionToCallDownstreamApi(scopes)
// Enable token caching
.AddInMemoryTokenCaches();
// Allow injecting the custom class in controllers
services.AddScoped(typeof(PowerBiApiService));
}
}
}
Solved! Go to Solution.
This is how my appsettings.json file is setup. I have just masked the values.
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "*****",
"TenantId": "*****",
"ClientId": "*****",
"ClientSecret": "*****"
},
"PowerBI": {
"ServiceRootUrl": "https://api.powerbi.com",
"WorkspaceId": "*****"
},
"CurrentUser": {
"Region": ""
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
This is how my appsettings.json file is setup. I have just masked the values.
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "*****",
"TenantId": "*****",
"ClientId": "*****",
"ClientSecret": "*****"
},
"PowerBI": {
"ServiceRootUrl": "https://api.powerbi.com",
"WorkspaceId": "*****"
},
"CurrentUser": {
"Region": ""
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |