Hi @marc3137
These are some suggestions from AI if any of these help you?
1. Trigger via the Umbraco Deploy Management API (Recommended)
Umbraco Deploy exposes a REST API you can call as part of your deployment pipeline (e.g. a post-deployment script, GitHub Action, Azure DevOps task, etc.).
POST to trigger a schema update from UDA files:
POST https://{your-environment}.umbraco.io/umbraco/deploy/api/v1/deploy
Authorization: Bearer {token}
Content-Type: application/json
{
"type": "schema"
}
You’ll need to authenticate using an Umbraco Cloud API key or a backoffice user token. The Deploy Management API uses the same auth as the Umbraco Management API (/umbraco/management/api/v1/security/back-office/token).
2. Auto-restore on Startup via appsettings.json
Umbraco Deploy has a setting to automatically apply UDA files on application startup:
json
"Umbraco": {
"Deploy": {
"Settings": {
"AllowRestoreOnStartup": true
}
}
}
This is the most “hands-off” approach — every time the app starts after a deployment, it will automatically process pending schema changes. Be aware this adds startup time and could be a concern on shared/slow environments.
3. Programmatically via a Notification Handler
If you need more control (e.g. only run it under certain conditions), you can hook into UmbracoApplicationStartedNotification and call the Deploy service directly:
csharp
public class DeployOnStartupHandler
: INotificationAsyncHandler<UmbracoApplicationStartedNotification>
{
private readonly IDeployService _deployService;
public DeployOnStartupHandler(IDeployService deployService)
=> _deployService = deployService;
public async Task HandleAsync(
UmbracoApplicationStartedNotification notification,
CancellationToken cancellationToken)
{
await _deployService.DeployAsync(
new[] { "$all" }, // deploy all schema
DeploySelector.SchemaAndContent, // or SchemaOnly
cancellationToken: cancellationToken);
}
}
Register it in Startup.cs / Program.cs:
csharp
builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddDeliveryApi()
.AddCompose()
.AddNotificationAsyncHandler<UmbracoApplicationStartedNotification, DeployOnStartupHandler>()
.Build();
I don’t know if any of these suggestions would work for you?
Justin