microsoft / microsoft/aspire

Dashboard reports ActivationFailed in ACA for ProjectResource that ran to completion

Open
#9,575 5 comments 0 reactions 0 assignees View on GitHub
area-azure-aca azure-container-apps
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Hello,

I have a one-shot / run-to-completion Project in my AppHost that works perfectly locally. The dashboard reports that it is in the Finished state when running locally.

However, when deploying my resource into ACA via the manifest publisher (azd), this resource gets stuck in Activation / ActivationFailed state even though it still runs to completion.

ACA:
![Image](https://github.com/user-attachments/assets/b2037c19-7652-40d7-9abf-cdbd3e3c93a4)

Local:

Image

AppHost:

```
var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions {
Args = args
});

var db_admin_user = builder.AddParameter("DbSchemaManagerUser", "ca_admin");
var db_admin_password = builder.AddParameter("DbSchemaManagerPassword", true);
var db_api_user = builder.AddParameter("DbApiUsername", "ca_api");
var db_api_password = builder.AddParameter("DbApiUserPassword", true);
var az_cogservices_endpoint =
builder.AddParameterFromConfiguration("AzureCognitiveServices-Endpoint", "AzureCognitiveServices:Endpoint");
var az_cogservices_apikey =
builder.AddParameterFromConfiguration("AzureCognitiveServices-ApiKey", "AzureCognitiveServices:ApiKey",
true);
var oidc_metadata_address = builder.AddParameterFromConfiguration("OidcMetadataAddress", "OidcMetadataAddress");
var oidc_audience = builder.AddParameterFromConfiguration("OidcAudience", "OidcAudience");

var storage_account = builder.AddAzureStorage("storage");
var blob_storage = storage_account.AddBlobs("ContentAnalyzerStorage");

var db = builder.AddPostgres("db", db_admin_user, db_admin_password)
.AddDatabase("ContentAnalyzerDb", "content_analyzer");

var db_manager = builder.AddProject("db-schema-manager")
.WithEnvironment("ApiDbUserConfig__Username", db_api_user)
.WithEnvironment("ApiDbUserConfig__Password", db_api_password)
.WithReference(db)
.WaitFor(db);

var core_api = builder.AddProject("coreapi")
.WithEnvironment("AzureCognitiveServices__Endpoint", az_cogservices_endpoint)
.WithEnvironment("AzureCognitiveServices__ApiKey", az_cogservices_apikey)
.WithEnvironment("ApiDbUserConfig__Username", db_api_user)
.WithEnvironment("ApiDbUserConfig__Password", db_api_password)
.WithEnvironment("Authentication__Schemes__Bearer__ValidAudience", oidc_audience)
.WithEnvironment("ASPNETCORE_ENVIRONMENT", builder.Environment.EnvironmentName)
.WithReference(db)
.WithReference(blob_storage)
.WaitFor(storage_account)
.WaitForCompletion(db_manager)
.WithHttpHealthCheck("/health", 200)
.WithExternalHttpEndpoints();

if (builder.ExecutionContext.IsPublishMode) {
core_api.WithEnvironment("Authentication__Schemes__Bearer__MetadataAddress", oidc_metadata_address);
}

builder.Build().Run();
```

### Expected Behavior

I expect the db-schema-manager resource to reach Finished state

### Steps To Reproduce

N/A

### Exceptions (if any)

N/A

### .NET Version info

9.0.4

### Anything else?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.