Nomirun Host Extensions are a simple way to extend the functionality of Nomirun Hosts. They are supported from the version of Nomirun Host 1.5.0 and above.
From that version onwards, the Nomirun Host also has fewer base dependencies, which makes it run better, fewer dependencies conflicts and easier to maintain.
To build your own host extensions, check the Create your own Host Extensions guide for more information.
There is a command that shows you all available host extensions that you can use.
❯ nomirun host list-extensions
The output is like this:
❯ nomi host list-extensions
Name Version
Nomirun.Host.OpenTelemetry 0.0.9
Now you can check what versions are available for the selected host extension.
❯ nomirun host list-extension-versions -e Nomirun.Host.OpenTelemetry
The output is like this:
❯ nomirun host list-extension-versions -e Nomirun.Host.OpenTelemetry
Name Version Hash
Nomirun.Host.OpenTelemetry 0.0.5 7DE818395D24A9C85AF3AA66967E47E258B291075A194305D6391E33410EEEFC7FEB30DBA102FAEDEB2EDE017B6F2E4D9DBF71C9D55DE40
AF070A5D115D22B88
Nomirun.Host.OpenTelemetry 0.0.6 FBFB9CF1528470B95978FBBF47C4F68A6CC3FCC550C3A6B59620D1932FCD4CF6E7635D4809F0E4A795D94D03CFE66190C13742159CC2A1D
8256A602F1A429B43
Nomirun.Host.OpenTelemetry 0.0.7 D3D7CF2B592A4C233E27CAB56A5C77D065567DF2DDB9C95B7E2B66835CEAF928A2638B5E777DB7CBEFA3109CDB623381D1DF829BE8A0418
7F2CC7CC15B851B13
Nomirun.Host.OpenTelemetry 0.0.8 0FA9D41EBAD53577BB6C452EA2C45DFB19787FEAA53376B70B1CE6FEACFB3397B501F582B1DE788EA5897F51C1435C7492626B341D1E25D
F8DC769120A6BB622
Nomirun.Host.OpenTelemetry 0.0.9 AADBA34379EF4AB49C1E49E1A141B71B8DC771FEE0ED1F4605E6226714D31BBA8168231C258CD6EFE52CBC0838207ECE295F4EA510AC0D2
D0953337CB13AD0D6
Now you can pick the version of the host extension that you want to add to the Nomirun Host in the cluster.
❯ nomirun cluster add-host-extensions --cluster-name MyCluster --host-name Host1 -e "Nomirun.Host.OpenTelemetry@0.0.7"
To remove the Nomirun Host extension from the host, use:
❯ nomirun cluster remove-host-extensions --cluster-name MyCluster --host-name Host1 -e "Nomirun.Host.OpenTelemetry"
Below is a list of officially supported Nomirun host extensions.
This is a host extension that allows you to use OpenTelemetry collection in Nomirun Hosts. Previously it was part of the Nomirun Host, but it was moved to a separate package.
Configuration contains three properties that can be configured:
otel:
hostUrl: http://otel-collector.localhost:4317
protocol: Grpc
headers:
HostUrl is the Url to the Otel collector.Protocol is the Grpc (default) or HttpProtobuf and is optional.Headers is a string of HTTP headers that can be defined for sending data to the collector. It’s optional.This is a host extension that allows you to add Azure KeyVault secrets to a configuration collection in Nomirun Hosts. Previously it was part of the Nomirun Host, but it was moved to a separate package.
Configuration contains two properties that can be configured:
clusters:
hosts:
configuration:
configurationStores:
azureKeyVault:
name:
managedIdentityId:
Name is the name of the Azure Key Vault.ManagedIdentityId is the Azure Managed Identity Id that can be used to access the Azure Key Vault.Extension uses DefaultAzureCredential credential to access the Azure Key Vault. This means it uses default chained credentials, from AZCLI, Visual Studio Credential, Worfklow Credential, Managed Identity,…
If ManagedIdentityId is provided it will override the default Managed Identity credential.
Extension uses prefixes to load configuration from Azure KeyVault. Prefixes are
Nomirun:Host:for host configuration andNomirun:Host:Module:<ModuleName>for modules. We recommend that you only configure module configurations with prefixesNomirun:Host:Module:<ModuleName>, as the prefixNomirun:Host:will set the same values for all hosts connecting to same KeyVault instance. If you are using separate KeyVaults for every service, then this will not happen.
This is a host extension that allows you to add Azure App Configuration configurations to a configuration collection in Nomirun Hosts. Previously it was part of the Nomirun Host, but it was moved to a separate package.
Configuration contains three properties that can be configured:
clusters:
hosts:
configuration:
configurationStores:
azureAppConfig:
name:
managedIdentityId:
label:
Name is the name of the Azure App Configuration.ManagedIdentityId is the Azure Managed Identity Id that can be used to access the Azure App Configuration.Label is an optional label filter that can be used to filter configurations. It can be a Host name, environment name or any other label.Extension uses DefaultAzureCredential credential to access the Azure Key Vault. This means it uses default chained credentials, from AZCLI, Visual Studio Credential, Worfklow Credential, Managed Identity,…
If ManagedIdentityId is provided it will override the default Managed Identity credential.
Extension uses prefixes to load configuration from App Configuration. Prefixes are
Nomirun:Host:for host configuration andNomirun:Host:Module:<ModuleName>for modules. We recommend that you only configure module configurations with prefixesNomirun:Host:Module:<ModuleName>, as the prefixNomirun:Host:will set the same values for all hosts connecting to same App Configuration instance. If you are using a separate App Configuration instance for every service, or you use labels, then this will not happen.
If you want to use basic JWT Bearer authentication in your Nomirun Host, you can use this host extension.
For any advanced authentication and authorization scenarios you can build your own host extension. Check the Create your own Host Extensions guide for more information.
Configuration contains three properties that can be configured:
clusters:
hosts:
configuration:
authentication:
audience:
authority:
requireHttpsMetadata:
Audience is the client id of the application that uses JWT token. Empty by default.Authority this is the issuer or authority url of the JWT token. Empty by default.RequireHttpsMetadata is a flag that indicates if the authority url should use http or https (useful for local development). Default is true.To protect controllers or endpoints with JWT Bearer authentication, you can use the [Authorize] attribute.
[Route("api")]
public class AccountsController : NomirunApiController
{
private readonly ILogger<AccountsController> _logger;
public AccountsController(ILogger<AccountsController> logger) : base(logger)
{
_logger = logger;
}
[HttpGet("accounts/{accountId}")]
[ProducesResponseType(typeof(Account), 200)]
[Authorize]
public async Task<IActionResult> GetAccount([FromRoute] long accountId)
{
return Ok(new Account
{
FirstName = "Miha",
LastName = "Jakovac",
SolarInverterIds = new List<long>()
{
100
}
});
}
}