AdminUI configuration is set using environment variables and appsettings.json. The structure of AdminUIs settings is defined in AdminUI Settings.
Configuring via Environment Variables
Environment variables may be set in many different way depending on you deployment strategy, this could be via any cloud hosting platform, docker compose files, etc... Examples of this can be
Note: Environments variables are nested with either __ (Linux environments) or : (Windows environments). E.g: DataProtection__Persistence__Type
or DataProtection:Persistence:Type
Running AdminUI On a Different Port
If you need to configure the ports for the website you can add the following section to your appsettings.json file:
"Kestrel": {
"Endpoints": {
"Http": {
//Your new Url Here
"Url": "http://localhost:5020"
}
}
}
If you would like to see all possible config options for the Kestrel property you can find them here.
Running AdminUI On a Different Path
If you are not running AdminUI from the root URL (e.g., using a path like https://generalweb/myadminui), an additional step is required. This is necessary because the index.html file, from which the SPA starts running, has a default reference to the root of the URL:
<base href="/">
This refers to an HTML path, so adding a full stop before the slash will not work in all the cases. Instead, you need to update the href with the AdminUI path. The specific steps for this vary depending on how you deploy AdminUI:
Using Nuget package
You need to include the
<Project>
<PropertyGroup>
<AdminUiPath>/myadminui/</AdminUiPath>
</PropertyGroup>
</Project>
Remember to include a slash at the end of the path. This has to be done from the csproj (build pipeline) as the Nuget AdminUI will replace the html files on build.
Using Zips or installer
In this case, manually change the path in the index.html file located in the wwwroot folder of your AdminUI. Do not confuse it with the parent wwwroot that holds the AdminUI folder and other apps. Following the example (https://generalweb/myadminui), the updated line should be:
<base href="/myadminui/">
Remember to include a slash at the end of the path.
Using Docker
In the AdminUI Dockerfile, include the following command changing "myadminui" with your own path:
sed -i 's/<base href="\/">/<base href="\/myadminui\/">/' /wwwroot/admin/index.html
This has to be done from Docker as the Nuget AdminUI will replace the html files on build. Remember to include a slash at the end of the path. Also, notice the forward slashes are escaped with a backslash.
Example appsettings.json:
{
"UiUrl": "http://localhost:5000",
"AuthorityUrl": "https://localhost:5003",
"AzureAppServiceLogging": false,
"LoggingMinimumLevel": "Info",
"EFLoggingMinimumLevel": "Warning",
"DbProvider": "SqlServer",
"IdentityConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
"IdentityServerConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
"AuditRecordsConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
"DataProtectionConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
"RequireHttpsMetadata": false,
"LicenseKey": "",
"PasswordPolicy": {
"RequireDigit": true,
"RequireLowercase": true,
"RequireNonAlphanumeric": true,
"RequireUppercase": true,
"RequiredLength": 6,
"RequiredUniqueChars": 1
},
"UsernamePolicy": {
"AllowedUserNameCharacters": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+",
"RequireUniqueEmail": false
},
"ReferenceTokens": {
"UseReferenceTokens": false,
"Secret": ""
},
"TargetIdentityServer4": false,
"DisableBootstrap": false,
"ServeUi": true,
"FeatureFlags": {
"DefaultUserValidation": true,
"AddUserPassword": false,
"EnableEnforcerAuthorization": false,
"EnableSharedScopes": false,
"EnableSessionManagement": true,
"EnableDynamicAuthentication": "Duende"
},
"DataProtection": {
"Persistence": {
"Type": "Database",
"DbProvider": "SqlServer",
"DataProtectionConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;"
},
"Protection": {
"Type": "Certificate",
"CertificateType": "Thumbprint",
"Thumbprint": "c09fb8e928ef97fbd2a78be9bfe99341a2175af4"
}
}
}