@Enrico Rossini Thanks for reaching out. Currently APIM doesn't support HSTS header.
You can configure each API to listen on http, https or both but this does not support redirection, if you configure an API to only listen on https and sends http request you will get 404 from APIM.
However, please find the below way to enforce Https as below—
1) You can add an input policy which can redirect all HTTP calls to HTTPS. This is the most recommended approach.
<inbound>
<choose>
<when condition="@(context.Request.OriginalUrl.Scheme.Equals("http"))">
<return-response>
<set-status code="302" reason="Requires SSL" />
<set-header exists-action="override" name="Location">
<value>@("https://" + context.Request.OriginalUrl.Host + context.Request.OriginalUrl.Path)</value>
</set-header>
</return-response>
</when>
</choose>
</inbound>
Note: even with the above steps, when a security scan runs, you will still see the message “HSTS header is missing”.
You can also leave your feedback on our APIM feedback page for feature request - aka.ms/apimwish.
To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.