I’m encountering an issue in Azure Functions where class names like Workflows or WorkflowTemplates seem to be causing problems. Specifically, functions within these classes are not being exposed or recognized by Azure Functions. However, when I move these functions to a different class, they work as expected.
Has anyone else experienced this issue, and is there a solution or workaround? I’m curious about why specific class names might cause functions to not be exposed in Azure Functions.
Any insights or guidance would be greatly appreciated.
[RequestHttpHeader(“Authorization”, isRequired: true)]
public class Workflows
{
private readonly IPhoenixLogger _logger;
public Workflows(IPhoenixLogger logger)
{
_logger = logger;
}
[ProducesResponseType(typeof(IEnumerable<Workflow>), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest)]
[ProducesResponseType((int)HttpStatusCode.Unauthorized)]
[Function("GetWorkflows")]
public async Task<IActionResult> RunGetWorkflows(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "Workflows")] HttpRequest req
)
{
return await Middleware.Run(async () => await GetWorkflows(req), req, _logger);
}
}
**HttpRequest: Get /api/Workflows – Not found 404 **
[RequestHttpHeader(“Authorization”, isRequired: true)]
public class WorkflowFunctions
{
private readonly IPhoenixLogger _logger;
public WorkflowFunctions(IPhoenixLogger logger)
{
_logger = logger;
}
[ProducesResponseType(typeof(IEnumerable<Workflow>), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest)]
[ProducesResponseType((int)HttpStatusCode.Unauthorized)]
[Function("GetWorkflows")]
public async Task<IActionResult> RunGetWorkflows(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "Workflows")] HttpRequest req
)
{
return await Middleware.Run(async () => await GetWorkflows(req), req, _logger);
}
}
**HttpRequest: Get /api/Workflows – OK 200 **
Deeptha Kuppusamy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.