1. Integrations

Start .NET middleware from scratch

This guide provides step-by-step instructions for creating a hosted middleware API using:

The complete example is available in dotnet-catalyst-examples.

Middleware requirements

Common use cases

OrderCloud applications often need middleware for:

  • Secure third-party integrations
  • Payment processor connections
  • Scheduled data synchronization
  • Product import automation
  • Custom email notifications
  • Event-driven workflows

Account setup

Required accounts

  1. OrderCloud account
  2. Azure account

Development tools

Local machine requirements:

  • .NET Framework
  • .NET Core 3.1 runtime
  • Visual Studio 2019

Code setup

Repository setup

  1. Clone example repository:
git clone https://github.com/ordercloud-api/dotnet-catalyst-examples
  1. Transfer to your version control

Azure configuration

App Configuration setup

Store application settings in Azure App Configuration:

  1. Create App Configuration resource
  2. Add settings in Configuration Explorer:
    • Match field names in AppSettings.cs
    • Use colons for nesting (e.g., OrderCloudSettings:ClientSecret)
  3. Copy connection string from Access Keys

Environment configuration

Create separate App Configuration resources for:

  • Development
  • Testing
  • Staging
  • Production

Local development

Visual Studio setup

  1. Open project in Visual Studio 2019
  2. Create debug profile:
    • Right-click WebApi project
    • Properties > Debug > New
    • Add Environment Variables
    • Key: APP_CONFIG_CONNECTION

Local testing

  1. Select Catalyst.Api project
  2. Choose debug profile
  3. Launch application
  4. Verify endpoints:
    • Browse to https://localhost:5001
    • Test GET https://localhost:5001/api/env
    • Confirm settings display

Azure deployment

App Service setup

  1. Create Azure App Service
  2. Configure settings:
    • Add APP_CONFIG_CONNECTION
    • Set in Configuration tab
    • Match local configuration

Deployment options

Visual Studio deployment

Quick start option:

Azure DevOps deployment

Recommended approach:

  1. Use provided azure-pipelines.yml
  2. Update App Service name (line 8)
  3. Push changes to deployment branch
  4. Create build pipeline:
    • Select repository
    • Configure deployment

Verification

After deployment:

  1. Access App Service URL
  2. Verify API documentation
  3. Test endpoints
  4. Confirm settings
If you have suggestions for improving this article, let us know!