Skip to content

Commit

Permalink
fix the documents, and add an appendix for the MyEF sample project (#258
Browse files Browse the repository at this point in the history
)

* [fix]: refs #
reason:fix the documents, and add an appendix for the MyEF sample project

Signed-off-by: Kazunari Kuroda <[email protected]>

* Update 99-Appendix.md

Signed-off-by: Eric Sibly [chullybun] <[email protected]>

---------

Signed-off-by: Kazunari Kuroda <[email protected]>
Signed-off-by: Eric Sibly [chullybun] <[email protected]>
Co-authored-by: Kazunari Kuroda <[email protected]>
Co-authored-by: Eric Sibly [chullybun] <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent ba23d28 commit 71bd6db
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/MyEf.Hr/docs/10-Service-Bus-Subscribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ Now that all the moving parts have been developed and configured an end-to-end i

## Verify

The new _Security_ domain that performs a [Service Bus Subscribe](./Service-Bus-Subscribe.md) of the _Termination_ related events and proxies [Okta]() (as our identity solution) automatically _Deactivating_ the Employee's account is complete.
The new _Security_ domain that performs a [Service Bus Subscribe](./10-Service-Bus-Subscribe.md) of the _Termination_ related events and proxies [Okta]() (as our identity solution) automatically _Deactivating_ the Employee's account is complete.

<br/>

Expand Down
4 changes: 2 additions & 2 deletions samples/MyEf.Hr/docs/8-Transactional-Outbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The pluggable nature of an [`IEventPublisher`](https://github.com/Avanade/CoreEx

## Previously generated capabilities

Within [Step 2](./2-Employee-DB.md) the transactional outbox capabilities, both database and .NET, were generated and included into the solution when performing the [Event outbox](./Employee-DB.md#Event%20outbox).
Within [Step 2](./2-Employee-DB.md) the transactional outbox capabilities, both database and .NET, were generated and included into the solution when performing the [Event outbox](./2-Employee-DB.md#event-outbox).

There were two tables added to the database [`Outbox.EventOutbox`](../MyEf.Hr.Database/Migrations/20221207-004320-02-create-outbox-eventoutbox-table.sql) and [`Outbox.EventOutboxData`](../MyEf.Hr.Database/Migrations/20221207-004320-03-create-outbox-eventoutboxdata-table.sql) via the corresponding generated migration scripts; these tables provide the underlying transactional persistence.

Expand Down Expand Up @@ -75,7 +75,7 @@ services.AddNullEventPublisher();
// Add transactional event outbox services.
services.AddScoped<IEventSender>(sp =>
{
var eoe = new EventOutboxEnqueue(sp.GetRequiredService<IDatabase>(), p.GetRequiredService<ILogger<EventOutboxEnqueue>>());
var eoe = new EventOutboxEnqueue(sp.GetRequiredService<IDatabase>(), sp.GetRequiredService<ILogger<EventOutboxEnqueue>>());
//eoe.SetPrimaryEventSender(/* the primary sender instance; i.e. service bus */); // This is optional.
return eoe;
});
Expand Down
61 changes: 61 additions & 0 deletions samples/MyEf.Hr/docs/99-Appendix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Appendix

This appendix includes additional information that might be useful when developing and deploying the sample.

<br/>

## Azure Resource

If you want to deploy your app to `Azure App Service`, execute the following command.

However, you need change the variables accordingly.

```
az login
echo create resource group
az group create --name <resource group name> -- location <your location>
echo create app service
az appservice plan create -g <resource group name> -n <app plan name> --sku b1
az webapp create -g <resource group name> -p <app plan name> -n <app name>
echo create storage
az storage account create -g <resource group name> -l <your location> --sku Standard_LRS -n <storage account name>
echo get storage account connection string
az storage account show-connection-string -g <resource group name> -n <storage account name>
echo create service bus
az servicebus namespace create -g <resource group name> --name <service bus namespace> --location <your location>
az servicebus queue create -g <resource group name> --namespace-name <service bus namespace> --name <service bus queue name>
echo get servicebus primary connection string
az servicebus namespace authorization-rule keys list -g <resource group name> --namespace-name <service bus namespace> --name RootManageSharedAccessKey --query primaryConnectionString --output tsv
```

If you need to rebuild, execute the following to drop and start again.

```
az group delete --name <resource group name>
```

<br/>

## Create Azure Function project

The update project dependencies is invalid because `CoreEx.Azure` and Function project have different version of `Microsoft.Azure.Functions.Worker.Extensions.ServiceBus` .

Therefore, you need to delete the `Microsoft.Azure.Functions.Worker.Extensions.ServiceBus` before adding the `CoreEx.Azure` NuGet package as dependencies.

<br/>

## Debug Option

If you don't want to send telemetry to azure monitor using local debug or a service, you should include code similar to the following. Alternatively, remove environment variable `APPLICATIONINSIGHTS_CONNECTION_STRING`.

```csharp
// Add Azure monitor open telemetry.
if (env.IsProduction())
services.AddOpenTelemetry().UseAzureMonitor().WithTracing(b => b.AddSource("CoreEx.*", "MyEf.Hr.*", "Microsoft.EntityFrameworkCore.*", "EntityFrameworkCore.*"));
```

0 comments on commit 71bd6db

Please sign in to comment.