I have imported an Azure Function app into Azure API Management service, which automatically generates a host key on the Function app for authorizing calls against it.
I would like to inspect the associated policy (if one exists) and edit it, but I can’t find it anywhere – it’s not shown in "Policy fragments".
How can I view/edit the policy that adds the generated function key to calls against the Function app?
2
Answers
I would start with checking
Effective policy view
to check if it’s added by the policy. I’m guessing this is the case.Select
All operations
or any operation, select the code view for policies and then select "calculate effective policy", this should show all the policies related to that operations.I’m guessing that’s either API level policy or Product level. Product policies can be checked and changed from Products-view and API lelve from "All operations" -level. There are also global policies but I don’t think tis’ there.
</>
.APIs --> Backends
blade of APIM instance.Click on the backend name and then navigate to Authorization credentials to access the x-function-key which is being passed in request header when you invoke an operation in APIM test console.
This is how APIM is storing the function key after importing a function app and using it via
set-backend-service
policy.