Server Error in '/' Application while deploying a Angular App on Azure

Viewed 290

I am new to Azure. I am trying simple Azure cloud deployments. I have this basic demo Angular app which is perfectly working in local environment. I did all the Azure setup & its successfully deploying. But when i browse the website its giving server error. Any inputs please. Thanks

enter image description here

2 Answers

You need to add a web.config which tell Azure that you are using a Node application and you need to start it.

<configuration>
    <system.webServer>
      <rewrite>
        <rules>
          <rule name="Angular" stopProcessing="true">
            <match url=".*" />
            <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="/" />
          </rule>
        </rules>
      </rewrite>
    </system.webServer>
</configuration>

If you are deploying your code in the App service, please check its Default documents.
It's available in the Appservice's Settings -> Configuration -> Default documents.
If index.html is not listed in the document list, please add it.

Screenshot for reference:

index.html

Related