elsa-core/src/modules/Elsa.ProtoActor.Cluster.AzureContainerApps
Marko Lahma bc3d6d9bbc Convert to use Central Package Management
* Add GitHubActionsTestLogger
2024-02-04 13:49:54 +02:00
..
Actors Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
ArmClientProviders Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
ClusterProviders Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Contracts Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Extensions Merge scope change into main (#4738) 2024-01-02 14:52:53 +01:00
Messages Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Models Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Options Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Services Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Stores Merge scope change into main (#4738) 2024-01-02 14:52:53 +01:00
Utils Remove WorkflowStateStore (#4374) 2023-08-30 15:42:16 +02:00
Elsa.ProtoActor.Cluster.AzureContainerApps.csproj Convert to use Central Package Management 2024-02-04 13:49:54 +02:00
FodyWeavers.xml
logo.png Implement stale member handling (#4369) 2023-08-28 22:26:44 +02:00
Readme.md Merge scope change into main (#4738) 2024-01-02 14:52:53 +01:00

Azure Container Apps cluster provider

Use this cluster provider when you're hosting your application in an Azure Container Apps cluster.

The provider stores cluster member information using Azure Resource Tags on the container application and uses these tags to discover other cluster members within the same Azure Container Application Managed Environment.

Installation

To install the provider, add the following code to your program:

services.AddAzureContainerAppsProvider(ArmClientProviders.DefaultAzureCredential, options =>
{
   options.ResourceGroupName = "{the resource group name containing your container application}";
   
   // Optionally, you can specify the subscription ID. If not specified, the provider will use the default subscription.
   options.SubscriptionId = "{your subscription id}";
});

Appsettings.json

Instead of hardcoding the options above, you should instead bind the options using your app's configuration. For example, consider the following appsettings.json:

{
  "AzureContainerApps": {
    "ResourceGroupName": "{the resource group name containing your container application}",
    "SubscriptionId": "{your subscription id}"
  }
}

You can then bind the options using the following code:

services.AddAzureContainerAppsProvider(ArmClientProviders.DefaultAzureCredential, options => configuration.Bind("AzureContainerApps", options));

Custom member store

By default, the provider will store cluster member information using Azure Resource Tags on the container application. If you want to use a custom storage mechanism, you can do so by implementing the IClusterMemberStore interface and registering it with the service collection.

For example, consider the following implementation:

public class RedisClusterMemberStorage : IClusterMemberStore
{
  ...
}

You can then register the implementation with the service collection:

services.AddScoped<IClusterMemberStore, RedisClusterMemberStore>();