@Youssef CHTOUROU Thank you for your question. We apologize for the frustration that you have encountered.
Firstly, please ensure that you have a custom domain added to your web app and that it is protected via an SSL cert. This is required to get HSTS to work.
Secondly, the link you provided uses a different web.config file snippet than what we have in our internal notes. Can you please try to use the below snippet to see if it's successful?
Edit web.config file and update this tag : <system.webServer> by adding the following:
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"
redirectType="Permanent" />
</rule>
</rules>
<outboundRules>
<rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
<match serverVariable="RESPONSE_Strict_Transport_Security"
pattern=".*" />
<conditions>
<add input="{HTTPS}" pattern="on" ignoreCase="true" />
</conditions>
<action type="Rewrite" value="max-age=31536000" />
</rule>
</outboundRules>
</rewrite>