Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
bytesizetrainer
New Member

OptionsValidationException: IDW10106: The Instance option must be provided

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));
        }
    }
}

 

 

 

1 ACCEPTED SOLUTION
bytesizetrainer
New Member

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": "*"
}

 

 

View solution in original post

1 REPLY 1
bytesizetrainer
New Member

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": "*"
}

 

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors