Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit beffa6f

Browse files
authored
Docs - split docs on feature changes on each full release (#36)
* Docs - split docs on feature changes on each full release * pr-sug: rm available starting badges * pr-sug: remove permalink
1 parent 50a2b7e commit beffa6f

File tree

6 files changed

+251
-0
lines changed

6 files changed

+251
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Securely Receive CloudEvents"
3+
layout: default
4+
---
5+
6+
# Securely Receive CloudEvents
7+
8+
The `Arcus.BackgroundJobs.CloudEvents` library provides a collection of background jobs to securely receive [CloudEvents](https://github.com/cloudevents/spec).
9+
10+
This allows workloads to asynchronously process event from other components without exposing a public endpoint.
11+
12+
## How does it work?
13+
14+
An Azure Service Bus Topic resource is required to receive CloudEvents on. CloudEvent messages on this Topic will be processed by a background job.
15+
16+
![Automatically Invalidate Azure Key Vault Secrets](/media/CloudEvents-Job.png)
17+
18+
You can write your own background job(s) by deriving from `CloudEventBackgroundJob` which already takes care of topic subscription creation/deletion on start/stop of the job.
19+
20+
## Usage
21+
22+
You can easily implement your own job by implementing the `ProcessMessageAsync` method to prcocess new CloudEvents.
23+
24+
```csharp
25+
public class MyBackgroundJob : CloudEventBackgroundJob
26+
{
27+
public MyBackgroundJob(
28+
IConfiguration configuration,
29+
IServiceProvider serviceProvider,
30+
ILogger<CloudEventBackgroundJob> logger) : base(configuration, serviceProvider, logger)
31+
{
32+
33+
}
34+
35+
protected override async Task ProcessMessageAsync(
36+
CloudEvent message,
37+
AzureServiceBusMessageContext messageContext,
38+
MessageCorrelationInfo correlationInfo,
39+
CancellationToken cancellationToken)
40+
{
41+
// Process the CloudEvent message...
42+
}
43+
}
44+
```
45+
46+
[&larr; back](/)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Automatically Invalidate Azure Key Vault Secrets"
3+
layout: default
4+
---
5+
6+
# Automatically Invalidate Azure Key Vault Secrets
7+
8+
The `Arcus.BackgroundJobs.KeyVault` library provides a background job to automatically invalidate cached Azure Key Vault secrets from an `ICachedSecretProvider` instance of your choice.
9+
10+
## How does it work?
11+
12+
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Farcus.azure%2Farcus.backgroundjobs%2Fmaster%2Fdeploy%2Farm%2Fazure-key-vault-job.json" target="_blank">
13+
<img src="https://azuredeploy.net/deploybutton.png"/>
14+
</a>
15+
16+
17+
This automation works by subscribing on the `SecretNewVersionCreated` event of an Azure Key Vault resource and placing those events on a Azure Service Bus Topic; which we process in our background job.
18+
19+
![Automatically Invalidate Azure Key Vault Secrets](/media/Azure-Key-Vault-Job.png)
20+
21+
To make this automation opperational, following Azure Resources has to be used:
22+
* Azure Key Vault instance
23+
* Azure Service Bus Topic
24+
* Azure Event Grid subscription for `SecretNewVersionCreated` events that are sent to the Azure Service Bus Topic
25+
26+
## Usage
27+
28+
Our background job has to be configured in `ConfigureServices` method:
29+
30+
```csharp
31+
public void ConfigureServices(IServiceCollection services)
32+
{
33+
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
34+
// this will get the 'serviceBusTopicConnectionStringSecretKey' string (configured below) and has to retrieve the connection string for the topic.
35+
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
36+
37+
// An `ICachedSecretProvider` implementation which secret keys will automatically be invalidated.
38+
services.AddSingleton<ICachedSecretProvider>(serviceProvider => new CachedSecretProvider(mySecretProvider));
39+
40+
services.AddAutoInvalidateKeyVaultSecretBackgroundJob(
41+
// Prefix of the Azure Service Bus Topic subscription;
42+
// this allows the background jobs to support applications that are running multiple instances, processing the same type of events, without conflicting subscription names.
43+
subscriptionNamePrefix: "MyPrefix"
44+
45+
// Connection string secret key to a Azure Service Bus Topic.
46+
serviceBusTopicConnectionStringSecretKey: "MySecretKeyToServiceBusTopicConnectionString");
47+
}
48+
```
49+
50+
[&larr; back](/)

docs/preview/index.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: "Home"
3+
layout: default
4+
permalink: /
5+
redirect_from:
6+
- /index.html
7+
---
8+
9+
[![NuGet Badge](https://buildstats.info/nuget/Arcus.BackgroundJobs.CloudEvents?includePreReleases=true)](https://www.nuget.org/packages/Arcus.BackgroundJobs.CloudEvents/)
10+
11+
# Installation
12+
13+
The Arcus BackgroundJobs can be installed via NuGet:
14+
15+
```shell
16+
PM > Install-Package Arcus.BackgroundJobs.CloudEvents
17+
```
18+
19+
For more granular packages we recommend reading the documentation.
20+
21+
# Features
22+
23+
- **General**
24+
- [Securely Receive CloudEvents](features/cloudevent/receive-cloudevents-job)
25+
- **Security**
26+
- [Automatically invalidate cached secrets from Azure Key Vault](features/security/auto-invalidate-secrets)
27+
28+
# License
29+
This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application.
30+
31+
*[Full license here](https://github.com/arcus-azure/arcus.backgroundjobs/blob/master/LICENSE)*
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Securely Receive CloudEvents"
3+
layout: default
4+
---
5+
6+
# Securely Receive CloudEvents
7+
8+
The `Arcus.BackgroundJobs.CloudEvents` library provides a collection of background jobs to securely receive [CloudEvents](https://github.com/cloudevents/spec).
9+
10+
This allows workloads to asynchronously process event from other components without exposing a public endpoint.
11+
12+
## How does it work?
13+
14+
An Azure Service Bus Topic resource is required to receive CloudEvents on. CloudEvent messages on this Topic will be processed by a background job.
15+
16+
![Automatically Invalidate Azure Key Vault Secrets](/media/CloudEvents-Job.png)
17+
18+
You can write your own background job(s) by deriving from `CloudEventBackgroundJob` which already takes care of topic subscription creation/deletion on start/stop of the job.
19+
20+
## Usage
21+
22+
You can easily implement your own job by implementing the `ProcessMessageAsync` method to prcocess new CloudEvents.
23+
24+
```csharp
25+
public class MyBackgroundJob : CloudEventBackgroundJob
26+
{
27+
public MyBackgroundJob(
28+
IConfiguration configuration,
29+
IServiceProvider serviceProvider,
30+
ILogger<CloudEventBackgroundJob> logger) : base(configuration, serviceProvider, logger)
31+
{
32+
33+
}
34+
35+
protected override async Task ProcessMessageAsync(
36+
CloudEvent message,
37+
AzureServiceBusMessageContext messageContext,
38+
MessageCorrelationInfo correlationInfo,
39+
CancellationToken cancellationToken)
40+
{
41+
// Process the CloudEvent message...
42+
}
43+
}
44+
```
45+
46+
[&larr; back](/)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Automatically Invalidate Azure Key Vault Secrets"
3+
layout: default
4+
---
5+
6+
# Automatically Invalidate Azure Key Vault Secrets
7+
8+
The `Arcus.BackgroundJobs.KeyVault` library provides a background job to automatically invalidate cached Azure Key Vault secrets from an `ICachedSecretProvider` instance of your choice.
9+
10+
## How does it work?
11+
12+
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Farcus.azure%2Farcus.backgroundjobs%2Fmaster%2Fdeploy%2Farm%2Fazure-key-vault-job.json" target="_blank">
13+
<img src="https://azuredeploy.net/deploybutton.png"/>
14+
</a>
15+
16+
17+
This automation works by subscribing on the `SecretNewVersionCreated` event of an Azure Key Vault resource and placing those events on a Azure Service Bus Topic; which we process in our background job.
18+
19+
![Automatically Invalidate Azure Key Vault Secrets](/media/Azure-Key-Vault-Job.png)
20+
21+
To make this automation opperational, following Azure Resources has to be used:
22+
* Azure Key Vault instance
23+
* Azure Service Bus Topic
24+
* Azure Event Grid subscription for `SecretNewVersionCreated` events that are sent to the Azure Service Bus Topic
25+
26+
## Usage
27+
28+
Our background job has to be configured in `ConfigureServices` method:
29+
30+
```csharp
31+
public void ConfigureServices(IServiceCollection services)
32+
{
33+
// An 'ISecretProvider' implementation (see: https://security.arcus-azure.net/) to access the Azure Service Bus Topic resource;
34+
// this will get the 'serviceBusTopicConnectionStringSecretKey' string (configured below) and has to retrieve the connection string for the topic.
35+
services.AddSingleton<ISecretProvider>(serviceProvider => ...);
36+
37+
// An `ICachedSecretProvider` implementation which secret keys will automatically be invalidated.
38+
services.AddSingleton<ICachedSecretProvider>(serviceProvider => new CachedSecretProvider(mySecretProvider));
39+
40+
services.AddAutoInvalidateKeyVaultSecretBackgroundJob(
41+
// Prefix of the Azure Service Bus Topic subscription;
42+
// this allows the background jobs to support applications that are running multiple instances, processing the same type of events, without conflicting subscription names.
43+
subscriptionNamePrefix: "MyPrefix"
44+
45+
// Connection string secret key to a Azure Service Bus Topic.
46+
serviceBusTopicConnectionStringSecretKey: "MySecretKeyToServiceBusTopicConnectionString");
47+
}
48+
```
49+
50+
[&larr; back](/)

docs/v0.1/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "Home"
3+
layout: default
4+
---
5+
6+
[![NuGet Badge](https://buildstats.info/nuget/Arcus.BackgroundJobs.CloudEvents?packageVersion=0.1.0)](https://www.nuget.org/packages/Arcus.BackgroundJobs.CloudEvents/0.1.0)
7+
8+
# Installation
9+
10+
The Arcus BackgroundJobs can be installed via NuGet:
11+
12+
```shell
13+
PM > Install-Package Arcus.BackgroundJobs.CloudEvents -Version 0.1.0
14+
```
15+
16+
For more granular packages we recommend reading the documentation.
17+
18+
# Features
19+
20+
- **General**
21+
- [Securely Receive CloudEvents](features/cloudevent/receive-cloudevents-job)
22+
- **Security**
23+
- [Automatically invalidate cached secrets from Azure Key Vault](features/security/auto-invalidate-secrets)
24+
25+
# License
26+
This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application.
27+
28+
*[Full license here](https://github.com/arcus-azure/arcus.backgroundjobs/blob/master/LICENSE)*

0 commit comments

Comments
 (0)