Open Closed

Deploying to App Service #4266


User avatar
0
marketbus created
  • ABP Framework version: v6.0.2
  • UI type: Angular
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am unable to deploy to Azure. I am using an Azure App Service for both the front and the back. Deploying the backend seems to working fine. I had to generate certificates in order to get it working after deployment. However when I try to login from the UI, I am getting a 400 error.

If I test the front end code locally, while having the backend pointed to the deployed in Azure web service, it works fine....

I noticed when I test locally, the url is in the form "/Account/Login?ReturnUrl=connect/authorize&response_type=code&client_id..."

However, deployed the deployed version has a url starting with "/connect/authorize&response_type=code&client_id"

Also it looks for the endpoint /getEnvConfig which needs to get redirected... as it only works with nginx, so I had to create a web.config and create rewrite rules to map to dynamic-env.json?

Here is my web.config for the frontend

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <customErrors mode="On"/>
    </system.web>
    <system.webServer>
		<staticContent>
		  <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00"/>
		  <remove fileExtension=".woff" />
		  <remove fileExtension=".woff2" />
		  <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
		  <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
		  <mimeMap fileExtension=".json" mimeType="application/json" />
		</staticContent>
        <rewrite>
            <rules>
		          <rule name="Angular Routes" stopProcessing="true">
         			<match url=".*" />
				     <conditions logicalGrouping="MatchAll">
					<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
					<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
					<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
					<add input="{REQUEST_URI}" pattern="^/(getEnvConfig)" negate="true" />
				     </conditions>
          			<action type="Rewrite" url="/" redirectType="Found" />
        		</rule>
                <rule name="getEnvConfig" enabled="true" patternSyntax="ExactMatch" stopProcessing="true">
                    <match url="getEnvConfig" />
                    <action type="Redirect" url="dynamic-env.json" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the backend error logs of this error.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13