I migrated a project from Azure function in-process model to isolated model.
One of the activity functions in the in-process model had the signature:
[FunctionName(nameof(GetImportProfiles))]
public async Task<IEnumerable<ImportProfile>> GetImportProfiles(
[ActivityTrigger] ILogger log)
{
return await _importProfilesRepository.GetProfiles();
}
In the isolated process model it is recommended that an ILogger<T> is injected using the constructor, hence s activity was changed into:
[Function(nameof(GetImportProfiles))]
public async Task<IEnumerable<ImportProfile>> GetImportProfiles()
{
return await _importProfilesRepository.GetProfiles();
}
When starting the function app, the following error is produced (also, none of the other Azure fuctions are found/listed):
[2023-11-08T13:30:42.167Z] A host error has occurred during startup operation '9185de92-32d5-4543-aa35-fdf1a58f2f78'.
[2023-11-08T13:30:42.167Z] Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader: At least one binding must be declared.
[2023-11-08T13:30:42.176Z] Failed to stop host instance '4c48a5dc-7c79-4c89-ae8b-3b8be6b401b8'.
[2023-11-08T13:30:42.176Z] Microsoft.Azure.WebJobs.Host: The host has not yet started.
Value cannot be null. (Parameter 'provider')
When changing the signature into the following:
[Function(nameof(GetImportProfiles))]
public async Task<IEnumerable<ImportProfile>> GetImportProfiles([ActivityTrigger] string dummy)
{
return await _importProfilesRepository.GetProfiles();
}
it works again, can someone explain? Are activity functions without arguments not supported?