{"record":{"id":"03be87cfb921e157","repo":"microsoft/aspire","slug":"azure-container-app-jobs-are-not-supported-with-azure","errorCode":null,"errorMessage":"Azure Container App Jobs are not supported with Azure Functions.","messagePattern":"Azure Container App Jobs are not supported with Azure Functions\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.AppContainers/ContainerAppJobContext.cs","lineNumber":102,"sourceCode":"    }\n\n    private ContainerAppJob CreateContainerAppJob()\n    {\n        var containerApp = new ContainerAppJob(Infrastructure.NormalizeBicepIdentifier(Resource.Name))\n        {\n            Name = NormalizedContainerAppName\n        };\n\n        var configuration = new ContainerAppJobConfiguration()\n        {\n            ReplicaTimeout = 1800,\n            TriggerType = ContainerAppJobTriggerType.Manual,\n        };\n        containerApp.Configuration = configuration;\n\n        if (Resource.HasAnnotationOfType<AzureFunctionsAnnotation>())\n        {\n            throw new NotSupportedException(\"Azure Container App Jobs are not supported with Azure Functions.\");\n        }\n\n        return containerApp;\n    }\n}\n","sourceCodeStart":84,"sourceCodeEnd":108,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.AppContainers/ContainerAppJobContext.cs#L84-L108","documentation":"Azure Container App Jobs cannot host Azure Functions. CreateContainerAppJob builds the job resource and throws NotSupportedException if the source resource carries an AzureFunctionsAnnotation, because the job model does not support the Functions hosting integration.","triggerScenarios":"A resource annotated with .WithFunctions(...) style AzureFunctionsAnnotation is also published as a Container App Job (PublishAsAzureContainerJob / job customization annotation).","commonSituations":"Combining Aspire's Azure Functions hosting with a container app job in the same AppHost; migrating a Functions-based project to job publishing without removing the Functions annotation.","solutions":["Remove the Azure Functions annotation (or the .WithFunctions call) from the resource if it should be a job","Publish the resource as a regular Container App instead of a job if Functions support is required","Split the workload: keep Functions in a container app and move non-Functions work to the job"],"exampleFix":"// before\nbuilder.AddProject<Projects.Funcs>(\"funcs\")\n    .WithAzureFunctions()\n    .PublishAsAzureContainerJob(env, job => { });\n// after\nbuilder.AddProject<Projects.Funcs>(\"funcs\")\n    .PublishAsAzureContainerApp(env, app => { });","handlingStrategy":"validation","validationCode":"if (resource.HasAnnotationOfType<AzureFunctionsAnnotation>() &&\n    resource.HasAnnotationOfType<AzureContainerAppJobCustomizationAnnotation>())\n{\n    throw new InvalidOperationException(\"Azure Functions resources cannot be published as Container App Jobs.\");\n}","typeGuard":null,"tryCatchPattern":"try { PublishAsJob(resource); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Jobs are not supported with Azure Functions\")) { /* use a container app instead */ }","preventionTips":["Decide up front whether a Functions project is hosted as a Container App or a Job — never both","Remove .WithFunctions-style annotations when converting to a job","Keep Functions workloads in regular container apps"],"tags":["azure","container-apps","jobs","azure-functions"],"backgroundTag":"unsupported-operation","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}