How to Build Scalable Document Signing by Integrating BoldSign with .NET Aspire
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 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. 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. 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 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. 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 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. 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 Visual Studio 2022 or Rider (which is free for noncommercial use) Docker or Podman 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. 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: Open Visual Studio and select .NET Aspire Starter App. Give the project a name and specify where you want to store it. Choose thetargeted framework (you can leave it as the latest version) and ensure that the Configure for HTT

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
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.
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.
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
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.
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
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.
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
- Visual Studio 2022 or Rider (which is free for noncommercial use)
- Docker or Podman 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.
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:
- Open Visual Studio and select .NET Aspire Starter App.
- Give the project a name and specify where you want to store it.
- 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
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
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<Projects.AspireApp1_ApiService>("apiservice");
builder.AddProject<Projects.AspireApp1_Web>("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.
To learn more about dashboard features, check dashboard overview.
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 offered by Syncfusion that enable users to sign documents digitally and allow developers to integrate e-signature functionalities into their applications using its APIs.
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.
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 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.

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.
- Go to the .Web project.
- Inside the Components folder, go to the Layout–NavMenu.razor and remove all navigation bar items except Home_._
class="top-row ps-3 navbar navbar-dark">
type="checkbox" title="Navigation menu" class="navbar-toggler" />
class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
Then, go to Pages-Home.razor and add the next code.
@page "/"
@rendermode InteractiveServer
<PageTitle>HomePageTitle>
<button class="btn btn-primary" @onclick="SendDocument">Send document
<p class="pt-3">@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 .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
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 and then go to the API - API key page.
7. Click 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
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.
You can download a sample file for signing here.
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<BoldSignApiClient>(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
When the app is open, click Sign document.
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
When Review and Sign is clicked, it should redirect you to the BoldSign portal, where signing can be done.
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
Conclusion
In this blog, I've explored the process of building a scalable document signing service by integrating the BoldSign API 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