Hi @Martin Kallukalam Apologies for the delay in getting back to you. While I could not find a direct way to achieve this use case through the portal, you can certainly use other approaches such as using PowerShell, Azure CLI or a Rest API to add the new healthcheck
operation.
Below is a sample approach I tested using the PowerShell and added the operation on all the available API endpoints.
$resourceGroupName = "<ResourceGroupName>"
$serviceName = "<APIMInstanceName>"
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName
foreach ($api in $apis) {
$apiId = $api.ApiId
# Define the operation details
$operationId = "healthcheck"
$operationName = "Health Check"
$method = "GET"
$urlTemplate = "/healthcheck"
$description = "Health check operation to return a 200 OK response."
# Add the operation to the API
New-AzApiManagementOperation -Context $apimContext -ApiId $apiId -OperationId $operationId -Name $operationName -Method $method -UrlTemplate $urlTemplate -Description $description
}
Running the above set of statements added a healthcheck
end point to all the APIs in the instance and can be accessed as you need through https://fqdn/apibasepath/heathcheck
If you prefer to use Azure CLI, you can use the commands az apim api list to get all the APIs in the instance and run the command az apim api operation create against each App Id to create the operation.
Similarly, if you prefer to use a Rest API end point, you can leverage the end points Api - List By Tags and Api Operation - Create Or Update to create the operation.
Hope this helps! Please let us know if you have any additional questions or need further assistance.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.