1

I have recently migrated from Azure Cloud Service to Azure Web App. Earlier I use to Disable the rapidFailProtection from my Webrole class. After the migration to Web App, I have remove the webrole class and added the code of rapidFail in the Application startup routine of the global.asax file. But it gave an error: role discovery data is unavailable

at the following line:

       Dim mainSite =  serverManager.Sites(RoleEnvironment.CurrentRoleInstance.Id + "_Web")

How can I achieve the same functionality for my Azure Web App?

user2561997
  • 443
  • 1
  • 6
  • 18

1 Answers1

1

How can I achieve the same functionality for my Azure Web App?

As far as I know, the rapidFailProtection is a application pool setting which you could set it in the ApplicationHost.config file in app service.

So if you want to set the rapidFailProtection to false in the azure web app, I suggest you could try to use XML Document Transformation (XDT) declarations to transform the ApplicationHost.config file in your web app in Azure App Service.

I suggest you could try below steps to add the XDT file to your web app to change the ApplicationHost.config settings.

1.Access the KUDU console.Find the Advanced Tools in DEVELOPMENT TOOLS click go. enter image description here

2.Click dubug console's cmd. enter image description here

3.Locate the D:\home\site and add below xdt file. Notice: Change the name as your web app service name

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.applicationHost>
    <applicationPools>
      <add name="testforapppool" xdt:Locator="Match(name)">
        <failure rapidFailProtection="false" xdt:Transform="InsertBefore(/configuration/system.applicationHost/applicationPools/add[(@name='testforapppool')]/*[1])" />
      </add>
      <add name="~1testforapppool" xdt:Locator="Match(name)">
        <failure rapidFailProtection="false" xdt:Transform="InsertBefore(/configuration/system.applicationHost/applicationPools/add[(@name='~1testforapppool')]/*[1])" />
      </add>
    </applicationPools>
  </system.applicationHost>
</configuration>

Image: enter image description here

Besides, you could also install Site Extension called IIS Manager which lets you very easily create XDT files simply by editing your applicationhost.config.

More details, you could refer to this article: Azure App Service web app advanced config and extensions

Xdt transform samples

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65