---
title: "Integrate BoldSign with .NET Aspire for Secure & Scalable Signing"
description: "Learn to build a scalable, secure document-signing service by integrating BoldSign with .NET Aspire."
url: "https://boldsign.com/blogs/boldsign-net-aspire/"
---

1. [Blog](https://boldsign.com/blogs.md)
2. [API](https://boldsign.com/category/api.md)

# How to Build Scalable Document Signing by Integrating BoldSign with .NET Aspire

[Pavle Davitkovic](https://boldsign.com/author/pavle-davitkovic/) December 31, 2024 Updated April 20, 2026 10 min read

Cloud computing is becoming more and more central to the way modern businesses work, enabling organizations to innovate, scale, and operate efficiently. Thus, the need for robust, scalable, and high-performing solutions has never been greater. Knowing this, Microsoft has created Aspire—a cloud-ready stack for building observable, production-ready, distributed applications.

In this blog, we’ll explore:

- What is .NET Aspire and what features does it have?
- How to integrate BoldSign with Aspire

Let’s dive in!

## What is .NET Aspire?

Distributed applications are programs where different parts run on different computers or servers connected through a network. These parts work together, making the system feel like one seamless application to the user.

Aspire fits here perfectly, because it’s a stack of tools and components designed to simplify the development of resilient, observable, and maintainable distributed applications.

![An overview of .NET Aspire](https://boldsign.com/images/blogs/boldsign-net-aspire/an-overview-of-.net-aspire.svg)

An overview of .NET Aspire

Aspire aims to enhance the development experience for building cloud-native applications in .NET. It’s designed to assist you with:

- Orchestration
- Integration
- Tooling

## Orchestration

Orchestration refers to the process of coordinating and managing different components of distributed applications to ensure they work together efficiently.

![The relationship between the projects in the .NET Aspire Starter Application template.](https://boldsign.com/images/blogs/boldsign-net-aspire/the-relationship-between-the-projects-in-the-.net-aspire-starter-application-template.svg)

The relationship between the projects in the .NET Aspire Starter Application template.

With orchestration, .NET Aspire allows applications to:

- Run and manage multiple services consistently, both locally and in the cloud.
- Coordinate microservices without requiring major code changes.
- Support deployments and service discovery, making it easy for services to find and interact with one another.
- Facilitate scaling and monitoring by integrating with tools such as OpenTelemetry for observability.

One of the core benefits is that the local environment is the same as production. There’s no need for extra configuration or NuGet packages. You can have a smooth transition at any point.

For more information, see [orchestration overview](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/app-host-overview).

## Integrations

When we talk about integration here, we mean the process of connecting various components needed to build cloud-native applications.

![A Diagram representing hosting integrations](https://boldsign.com/images/blogs/boldsign-net-aspire/a-diagram-representing-hosting-integrations.svg)

A Diagram representing hosting integrations

Aspire offers ready-to-use templates, libraries, and configuration patterns for integration with popular services like:

- SQL Server
- RabbitMQ
- Containerized environments: Docker or Podman

And not just that. There are also integrations for:

- Health checks
- Observability
- Dependency injection patterns

For more information, see [integration overview](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/integrations-overview).

## Tooling

Tooling offers developers a unified experience through Visual Studio and the .NET CLI, providing preconfigured project templates and the seamless integration of common components.

![Search for a new .NET Aspire project](https://boldsign.com/images/blogs/boldsign-net-aspire/search-for-a-new-.net-aspire-project.svg)

Search for a new .NET Aspire project

### **Tooling includes:**

- **Project Templates**: Out-of-the-box templates for apps, APIs, and services, from minimal setups to starter applications, including ASP.NET Core and Blazor solutions.
- **CLI Integration**: Developers can create, list, and manage Aspire projects via .NET CLI commands, such as dotnet new aspire.
- **Visual Studio Support**: Aspire extends Visual Studio’s capabilities by enabling direct integration of Aspire components through a graphical interface.
- **Containerized Development**: Aspire encourages running projects inside containers, supporting tools like Docker and Podman.

For more information, see the [tooling overview](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/setup-tooling?tabs=linux\&pivots=visual-studio#net-aspire-project-templates).

All that’s left now is to see how to implement the BoldSign service with Aspire.

Let’s write some code!

## Prerequisites

To follow along, you will need:

- [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or [Rider](https://www.jetbrains.com/rider/) (which is free for noncommercial use)
- [Docker](https://www.docker.com/products/docker-desktop) or [Podman](https://podman.io/) for container runtime

## Implementation

In this example, we are going to have three applications:

- **Frontend**: Blazor web app
- **Backend**: Minimal API
- **Aspire** (Host and service defaults)

Aspire offers various templates out of the box. If you already have the application up and running, and you just need orchestration and service management, you can use the standalone.NET Aspire App Hosttemplate. Or, to manage configuration that is reused across projects, go with the .NET Aspire Service Defaultstemplate. But if you are starting from scratch, you have the .NET Aspire Empty App and .NET Aspire Starter Application.

You can learn more about templates [here](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/setup-tooling?tabs=linux\&pivots=visual-studio#net-aspire-project-templates).

For the sake of simplicity and blog length, I will choose a Starter application. And don’t worry; I will explain the code along the way.

## Create Aspire application

I mentioned that you can use Visual Studio or Rider. For this demonstration, I will use Visual Studio 2022:

1. Open Visual Studio and select **.NET Aspire Starter App.**
2. Give the project a name and specify where you want to store it.
3. Choose thetargeted framework (you can leave it as the latest version) and ensure that the Configure for HTTPS is selected. You don’t need to enable the cache or testing for now.

![Creating an .NET Aspire Starter App](https://boldsign.com/images/blogs/boldsign-net-aspire/creating-an-.net-aspire-starter-app.svg)

Creating an .NET Aspire Starter App

After completing setup, you should see four projects in the solution:

- **ApiService**: Minimal API project.
- **AppHost**: Orchestrator project designed to connect and configure the different projects and services.
- **ServiceDefaults**: Shared project to manage configurations that are reused across the projects.
- **Web**: Blazor App project.

![Project Solution Explorer with four projects](https://boldsign.com/images/blogs/boldsign-net-aspire/project-solution-explorer-with-four-projects.svg)

Project Solution Explorer with four projects

In Program.cs in the AppHost project, you will see how the frontend and backend parts are connected.

```
var builder = DistributedApplication.CreateBuilder(args);
var apiService = builder.AddProject("apiservice");
builder.AddProject("webfrontend")
WithExternalHttpEndpoints()
WithReference(apiService)
WaitFor(apiService);
builder.Build().Run();
```

Before continuing, let’s demystify a few Aspire terms that I will use throughout the rest of the blog:

- **App model:** collection of resources that make up a distributed application.
- **Resource**: a dependent part of an application (project, container, executable, etc.).
- **Reference**: defines a connection between resources, expressed as a dependency using the WithReference API.

With that cleared up, let’s run the application. You should see a dashboard like this the following one.

![AspirePlayground Dashboard](https://boldsign.com/images/blogs/boldsign-net-aspire/aspireplayground-dashboard.svg)

AspirePlayground Dashboard

To learn more about dashboard features, check [dashboard overview](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/overview?tabs=bash).

Congratulations! You have run your first Aspire application!

Now let’s move to eSignature API implementation.

## BoldSign eSignature API implementation

BoldSign is an e-signature platform and [SDK](https://boldsign.com/electronic-signature-sdk.md) offered by Syncfusion that enable users to sign documents digitally and allow developers to integrate e-signature functionalities into their applications using its APIs.

![BoldSign By Syncfusion](https://boldsign.com/images/blogs/boldsign-net-aspire/boldsign-by-syncfusion.svg)

BoldSign By Syncfusion

### When is BoldSign a good choice?

It’s not unusual anymore for companies to hire fully remote positions globally. But how do they manage signing employee contracts, NDAs, or policy acknowledgments?\
One solution is to send paper documents via some worldwide shipping company, but we can agree that this is time- and money-consuming.\
So, the better solution would be to use a digital signing program like BoldSign.

To learn why, check out the [BoldSign website](https://boldsign.com/index.md).

### Implementation

For this example, I will use the eSignature API that easily embeds the entire eSignature process within any application.

Let’s start by creating an account and a sandbox:

- Go to the [BoldSign](https://boldsign.com/index.md) site and click **Login**.
- You can either log in with a Google account or to create a new (my preference is to go with Google).
- Once you finish registration, you should see the following dashboard.

![BoldSign Web Application Dashboard](https://boldsign.com/images/blogs/boldsign-net-aspire/boldsign-web-application-dashboard.svg)

BoldSign Web Application Dashboard

The next steps are to adjust the frontend and backend services.

In the frontend application, there will be a button that will invoke the endpoint on the backend and will display a signed document identifier.

Let’s start with the Blazor app.

1. Go to the \<Project_name>.**Web** project.
2. Inside the Components folder, go to the **Layout**–**NavMenu.razor** and remove all navigation bar items except Home.

```
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">AspireApp1</a>
</div>
</div>
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
<nav class="nav flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill" aria-hidden="true"></span> Home
</NavLink>
</div>
</nav>
</div>
```

Then, go to Pages-Home.razor and add the next code.

```
@page "/"
@rendermode InteractiveServer
Home
Send document
@DocumentText
@code {
    private string DocumentText = string.Empty;
    [Inject]
    private BoldSignApiClient Client { get; set; }
    private async Task SendDocument()
    {
        CancellationToken cancellationToken = new();
        string documentId = await Client.GetDocumentId(cancellationToken);
        DocumentText = $"Document with Id: {documentId} Sent";
    }
}
```

3\. Once that is done, remove all the pages from that folder except Home and Error.

You are done with the Blazor setup for now.

Next is the endpoint that will consume the BoldSign API.

4\. Go to **\<project_name>.ApiService** in **Program.cs** and remove the out-of-the-box endpoint and accompanying code.

5\. Next, install the BoldSign.API NuGet package.

![Install BoldSign.API NuGet Package](https://boldsign.com/images/blogs/boldsign-net-aspire/install-boldsign.api-nuget-package.svg)

Install BoldSign.API NuGet Package

Now let’s return to the BoldSign dashboard to grab the API keys that will be used to authorize clients against API endpoints.

6\. Go to the [portal](https://app.boldsign.com/api-management/api-key/) and then go to the **API** - **API** **key** page.

7\. Click **Generate API Key**.

![Generate API Key](https://boldsign.com/images/blogs/boldsign-net-aspire/generate-api-key.svg)

Generate API Key

8\. You will see a pop-up where you need to add a token name and expiration date. Give it any name you want, set validity for a year, and then generate a token.

![A dialog box to generate a Token](https://website-static.boldsign.com/2024/12/3ee1ead9-a-dialog-box-to-generate-a-token.webp)

A dialog box to generate a Token

9\. Save the API key somewhere for further use, and that is it.

Let’s return to Visual Studio.

Instead of the API endpoints you removed in the previous step, let’s add new endpoints.

```
app.MapGet("/sign-document", async () =>
{
    ApiClient client = new("https://api.boldsign.com", "Your_API_Key");
    DocumentClient documentClient = new(client);
    DocumentFilePath documentFilePath = new()
    {
        ContentType = "application/pdf",
        FilePath = "Your File Path"
    };
    FormField signatureField = new(
        id : "signature",
        isRequired: true,
        type: FieldType.Signature,
        pageNumber: 1,
        bounds: new Rectangle(550, 900, 150, 50));
    List formFields = [signatureField];
    DocumentSigner signer = new()
    {
        EmailAddress = "pavle.davitkovic@yopmail.com",
        Name = "Pavle Davitkovic",
        FormFields = formFields
    };
    SendForSign sendForSign = new()
    {
        Message = "Please sign this document",
        Title = "Freelance Contract",
        Signers = [signer],
        Files = [documentFilePath]
    };
    var response = await documentClient.SendDocumentAsync(sendForSign);
    return response.DocumentId;
});
```

In summary, this code sets up the necessary objects to send a PDF document for signing using the BoldSign API. It creates an API client (where you need to provide a URL and API key from the previous step as parameters), a document client, and the necessary objects to specify the document, the signature field, and the signer. It then sends the document for signing and returns the ID of the document.

With this you have completed the API setup. Before we run and test the whole process, there are a few adjustments that need to be made in the Blazor project.

In the web project, remove WeatherApiClient and add BoldsignApiClient with the following code.

```
public class BoldSignApiClient(HttpClient httpClient)
{
    public async Task$lt;string> GetDocumentId(CancellationToken cancellationToken)
    {
        var result = await httpClient.GetStringAsync("/sign-document", cancellationToken);
        return result ?? string.Empty;
    }
}
```

Then, register that client in the DI container

```
builder.Services.AddHttpClient(client =>
{
    // This URL uses "https+http://" to indicate HTTPS is preferred over HTTP.
    // Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes.
    client.BaseAddress = new("https+http://apiservice");
});
```

And the last thing is to add logic that will invoke the endpoint when the button on the home page is clicked.

```
private string DocumentText = string.Empty;
[Inject]
private BoldSignApiClient Client { get; set; }
private async Task SendDocument()
{
    CancellationToken cancellationToken = new();
    string documentId = await Client.GetDocumentId(cancellationToken);
    DocumentText = $"Document with Id: {documentId} Sent";
}
```

Let’s run the application.

The first thing you will see is the Aspire dashboard. Find the **webfronted** project and open the app.

![Aspire Dashboard containing a webfronted project](https://boldsign.com/images/blogs/boldsign-net-aspire/aspire-dashboard-containing-a-webfronted-project.svg)

Aspire Dashboard containing a webfronted project

When the app is open, click **Sign document**.

![Click Sign document in Aspire Application](https://boldsign.com/images/blogs/boldsign-net-aspire/click-sign-document-in-aspire-application.svg)

Click Sign document in Aspire Application

After a few moments, the invitation for document signing should be delivered to the email address that is set in the DocumentSign object in the API project.

![An email message to review and sign the document](https://boldsign.com/images/blogs/boldsign-net-aspire/an-email-message-to-review-and-sign-the-document.svg)

An email message to review and sign the document

When Review and Sign is clicked, it should redirect you to the BoldSign portal, where signing can be done.

![BoldSign Signing Page](https://boldsign.com/images/blogs/boldsign-net-aspire/boldsign-signing-page.svg)

BoldSign Signing Page

Add your signature in the yellow rectangle and click **Finish**.

To be sure that everything was done successfully, go to the BoldSign dashboard and check whether there is a completed document in the Recently Revoked, Declined and Completed column.

![BoldSign Dashboard to view the completed document](https://boldsign.com/images/blogs/boldsign-net-aspire/boldsign-dashboard-to-view-the-completed-document.svg)

BoldSign Dashboard to view the completed document

## Conclusion

In this blog, I’ve explored the process of building a scalable document signing service by integrating the [BoldSign API](https://boldsign.com/esignature-api.md) with a .NET Aspire application. One of the key benefits of this approach is the scalability it provides. As a user base grows and the volume of documents increases, the service can handle the load without causing bottlenecks in our applications. The cloud-based nature of BoldSign ensures that our document signing capabilities can scale up to meet the demands of modern businesses.

In conclusion, the integration of BoldSign with a .NET Aspire application can be a game-changer for document signing workflows. The ease of implementation, scalability, and feature-rich capabilities of the BoldSign service allow businesses to deliver a robust and reliable document signing solution to customers

Topics [API integration](https://boldsign.com/blogs/tag/api-integration.md)

## Sign documents 3x faster

Send, sign and manage documents securely and efficiently.

[Try it today](https://account.boldsign.com/signup?planId=1018\&utm_source=boldsignblogs\&utm_medium=redirect\&utm_campaign=boldsign)

## Pavle Davitkovic

Pavle Davitkovic is a software engineer with over 5 years of experience. He has developed various types of applications, from web to mobile. Pavle has a passion for books and martial arts.

[More posts by Pavle Davitkovic](https://boldsign.com/author/pavle-davitkovic/)

## Related posts

- [API](https://boldsign.com/category/api.md) September 29, 2026 10 min read

  ## [How to Migrate from Docusign Without Losing Templates or Workflow Continuity](https://boldsign.com/blogs/migrate-from-docusign.md)

  Learn how to migrate from Docusign while protecting templates, signed records, and active workflows. Explore key risks, a practical checklist, and next steps.

- [API](https://boldsign.com/category/api.md) September 25, 2026 10 min read

  ## [Build vs Buy an eSignature API: What Should You Choose?](https://boldsign.com/blogs/build-vs-buy-esignature-api-guide.md)

  Compare the real cost, compliance risk, launch speed, and maintenance burden of building vs buying an eSignature API before you commit.

- [API](https://boldsign.com/category/api.md) September 22, 2026 9 min read

  ## [What Are the Common Challenges When Using Signature APIs in Software Development](https://boldsign.com/blogs/common-signature-api-challenges.md)

  Explore the common challenges developers face with a Signature API, from authentication issues to PDF rendering, webhooks, templates, and rate limits.

Get started

## Sign up for your free trial today!

[Start free trial](https://account.boldsign.com/signup?planId=1018)

- 30-day free trial
- No credit card required

*Picture: A completed employment contract: signed by John Doe on 11/03/2026, all parties have signed*
