This function app is used to manage CUI app registrations consumed by the Composite Shell, which are persisted in a Cosmos database collection.
This is a self-contained Visual Studio 2019 solution containing a number of projects (azure function app with associated unit test project).
Clone the project and open the solution in Visual Studio 2019.
Item | Purpose |
---|---|
DFC.Compui.Cosmos | Cosmos repository nuget |
DFC.Compui.Subscriptions | Composite UI Subscription API client |
DFC.Swagger.Standard | DFC Swagger generator |
Once you have cloned the public repo you need to remove the -template part from the configuration file names listed below.
Location | Filename | Rename to |
---|---|---|
DFC.Api.AppRegistry | local.settings-template.json | local.settings.json |
The project contains a "local.settings-template.json" file which contains appsettings for the function app project. To use this file, copy it to "local.settings.json" and edit and replace the configuration item values with values suitable for your environment.
By default, the appsettings include local Azure Cosmos Emulator configurations using the well known configuration values for app registration storage. These may be changed to suit your environment if you are not using the Azure Cosmos Emulator.
This app subscribes to change events in Event Grid. To make use of it you will need to configure the Subscriptions service which will require an APIM API key for that service.
App setting | Value |
---|---|
ApiSuffix | dev |
Configuration__CosmosDbConnections__AppRegistry__AccessKey | CosmosAccessKey |
Configuration__CosmosDbConnections__AppRegistry__EndpointUrl | CosmosEndpoint |
Configuration__CosmosDbConnections__AppRegistry__DatabaseId | composition |
Configuration__CosmosDbConnections__AppRegistry__CollectionId | appregistry |
Configuration__CosmosDbConnections__AppRegistry__PartitionKey | /PartitionKey |
PagesClientOptions__BaseAddress | ContentApiEndpoint/api/execute/ |
SubscriptionSettings__Endpoint | ThisFunctionAppBaseAddress/pages/webhook |
SubscriptionSettings__SubscriptionServiceEndpoint | SubscriptionServiceEndpoint |
SubscriptionSettings__ApiKey | SubscriptionServiceApimKey |
SubscriptionSettings__Filter__BeginsWith | /dfc-app-pages/ |
SubscriptionSettings__Filter__IncludeEventTypes__0 | published |
SubscriptionSettings__Filter__IncludeEventTypes__1 | unpublished |
SubscriptionSettings__Filter__IncludeEventTypes__2 | deleted |
To run this product locally, you will need to configure the list of dependencies, once configured and the configuration files updated, it should be F5 to run and debug locally.
To run the project, start the function app. Once running, use a tool such as Postman to initiate requests.
This function app will be deployed as an individual stand-alone deployment.
- Microsoft Visual Studio 2019
- .Net Core 3.1
Please refer to https://github.com/SkillsFundingAgency/dfc-digital for additional instructions on configuring individual components like Cosmos.