I've been looking for similar. Ideally I was looking to use ARM templates to either complete the API Import of a function app step, including creating a host key for APIM and storing this as a named value in APIM, associating that with a backend in APIM. Actually, I think when I tried the manual step, the host key was created and updated as a named value in APIM, but this wasn't actually updated in the backend for the function app. Also annoying that in the Azure Portal, where you can go to an APIM service and on the overview page get the json view of the resource, you don't get a similar view for extension resources e.g. backends, apis, products, policies, subscriptions . . etc.
Anyway, I came across a series of relevant posts on github:
https://github.com/Azure/azure-functions-host/issues/4570
https://github.com/Azure/azure-functions-host/issues/3994
Both from 2019, as a result, I found the links below for the REST API calls, if they're of any use?
https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/list-host-keys
https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-or-update-host-secret