Access Kudu for Azure Web App Configuration
To begin the process, access Kudu for your Azure Web App. Kudu provides diagnostic and management tools for Azure App Service.
A shortcut to your Kudu dashboard is to append scm to the Azure Web App hostname:
https://<yourapp>.scm.azurewebsites.net
Open the CMD Console in Kudu
After accessing Kudu, open the Debug console and select CMD for the next steps.
Kudu debug console for an Azure App Service.
Locate the applicationhost.config File
Access the root directory by clicking the Site root icon. From the listed directories, open the config folder.
Navigate to the configuration directory in Kudu.
Inside the folder, locate applicationhost.config. Kudu provides actions next to the file that let you download or edit it.
The IIS applicationhost.config file in Kudu.
Adjust application host's config GZIP Compression Settings
To enable dynamic compression:
Click the edit icon next to
applicationhost.config.Within the
<system.webServer>section, make sure the required compression settings are present.
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<httpCompression directory="C:\local\IIS Temporary Compressed Files" noCompressionForProxies="false">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/atom+xml;charset=utf-8" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="image/svg+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
Tip
Make sure the response types you want to compress are included under either <dynamicTypes> or <staticTypes>. After saving the configuration, restart the app so the change takes effect.
Troubleshooting: When HTTP Compression Doesn't Work
If compression is not working as expected, monitor application metrics such as CPU utilization and memory usage. High CPU usage can cause IIS to disable dynamic compression automatically.
The two important IIS attributes are dynamicCompressionDisableCpuUsage and dynamicCompressionEnableCpuUsage. They define the upper and lower CPU thresholds used to disable and re-enable dynamic compression.
Attribute | Behavior |
| Specifies the CPU utilization percentage at which dynamic compression is disabled. The default value is 90. |
| Specifies the CPU utilization percentage below which dynamic compression is enabled again. The default value is 50. IIS calculates average CPU utilization every 30 seconds. |
In practice, this means compression may disappear under sustained CPU load and return automatically once utilization falls below the configured enable threshold.
Official References
For current product behavior and configuration details, use the Microsoft documentation below.
https://learn.microsoft.com/en-us/azure/app-service/resources-kudu
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/urlcompression
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/httpcompression/
https://learn.microsoft.com/en-us/iis/web-hosting/web-server-for-shared-hosting/dynamic-compression
Summary
For a Windows Azure App Service running on IIS, Kudu gives you direct access to the underlying IIS configuration. Enabling both static and dynamic compression can reduce transferred response sizes, while the IIS CPU thresholds help prevent dynamic compression from adding too much load when the server is busy.
If compression appears to stop working, verify the MIME type configuration first, then check CPU usage and the dynamicCompressionDisableCpuUsage and dynamicCompressionEnableCpuUsage settings.