Veselin Vasilev
Veselin Vasilev

Reputation: 3793

Azure App Service in .NET stack can execute PHP code

We created an App Service from the older Azure Portal UI where you could set both .NET framework and PHP version.

They've since changed the Azure Portal UI and we no longer see the PHP part.

We can only see that the App Service is using the .NET Stack, which is fine and correct.

enter image description here

But, the issue is that indeed PHP is still enabled in the App Service and PHP code can be executed and we do not want that.

How can we disable PHP?

One of the less privileged users of the portal can see the PHP version, but none of the admin users can. If we could switch to that old UI we would be able to disable PHP, but no idea how to do that.

enter image description here

Upvotes: 3

Views: 1204

Answers (1)

Peter Pan
Peter Pan

Reputation: 24138

Actually, even you can switch to the old UI of Azure portal, you also can not disable PHP runtime of Azure WebApp, because it is enabled via defined in environment variable PATH as the figure below which you can access the Kudu Environment page of your webapp (https://.scm.azurewebsites.net/Env.cshtml#path) to see it.

enter image description here

And all files and directories except D:\home\ under D:\ that you can not remove them, because of lack administrator permission. But you may try to change the web.config file in the path D:\home\site\wwwroot to make your webapp not handle the .php files.

Upvotes: 3

Related Questions