title: Publish ASP.NET Core 2.1 and Angular 6 project to Azure
body: <p>I've been trying to publish project to Azure web service. I generated the project using dotnet cli tool, when it generated the project i deleted the provided ClientApp folder and generated a new Angular project using Angular CLI. Now I have Angular 6 on frontend and Asp.NET core 2.1 on the backend with Entity Framework Core. I coded a simple website  that works perfectly on my localhost. Now i want to publish it to Azure. The publish process itself is successful i can see a message below, but when the url opens in the browser it says the following: 
  <a href="https://i.stack.imgur.com/tIQsw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tIQsw.png" alt="enter image description here"></a>
  Then I tried Diagnose and solve problems on Azure here's what i got:
  <a href="https://i.stack.imgur.com/1AUam.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1AUam.png" alt="enter image description here"></a>
  Full report:
  <a href="https://i.stack.imgur.com/iJOGk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iJOGk.png" alt="enter image description here"></a></p>
  
  <p>During the publish i configured some settings:</p>
  
  <p><a href="https://i.stack.imgur.com/v59QT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v59QT.png" alt="enter image description here"></a></p>
  
  <p>But still no luck. Previously i used the same approach with core 2.0 and angular 5 that worked fine. Now i'm having issues with core 2.1 and angular 6</p>
  
  <p>Here's Startup.cs:</p>
  
  <pre><code>using Microsoft.AspNetCore.Authentication.Cookies;
  using Microsoft.AspNetCore.Authentication.JwtBearer;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Http;
  using Microsoft.AspNetCore.Identity;
  using Microsoft.AspNetCore.SpaServices.AngularCli;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.IdentityModel.Tokens;
  using MovieApp.Models;
  using System.IO;
  using System.Text;
  
  namespace MovieApp
  {
  public class Startup
  {
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public IConfiguration Configuration { get; }
  
      public void ConfigureServices(IServiceCollection services)
      {
          services.AddCors(options =&gt;
          {
              options.AddPolicy("EnableCORS", builder =&gt;
              {
                  builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials().Build();
              });
          });
  
          services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options =&gt;
          {
              options.TokenValidationParameters = new TokenValidationParameters
              {
                  ValidateIssuer = true,
                  ValidateAudience = true,
                  ValidateLifetime = true,
                  ValidateIssuerSigningKey = true,
                  ValidIssuer = "http://localhost:63269",
                  ValidAudience = "http://localhost:63269",
                  // ValidIssuer = "https://nqmoviesng.azurewebsites.net",
                  //  ValidAudience = "https://nqmoviesng.azurewebsites.net",
                  IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("superSecretKey@345"))
              };
          });
          services.AddSingleton&lt;IHttpContextAccessor, HttpContextAccessor&gt;();
  
          services.AddMvc();
  
  
          services.AddSpaStaticFiles(configuration =&gt;
          {
              configuration.RootPath = "ClientApp/dist";
          });
      }
  
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          app.UseAuthentication();
          app.UseCors("EnableCORS");
  
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseDefaultFiles();
          app.UseStaticFiles();
  
          app.UseMvcWithDefaultRoute();
  
          app.UseSpaStaticFiles();
  
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller}/{action=Index}/{id?}");
          });
  
          app.UseSpa(spa =&gt;
          {
  
  
              spa.Options.SourcePath = "ClientApp";
  
              if (env.IsDevelopment())
              {
                  spa.UseAngularCliServer(npmScript: "start");
              }
          });
      }
   }
  }
  </code></pre>
  
  <p>.csproj file:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
  &lt;PropertyGroup&gt;
  &lt;TargetFramework&gt;netcoreapp2.1&lt;/TargetFramework&gt;
  &lt;TypeScriptCompileBlocked&gt;true&lt;/TypeScriptCompileBlocked&gt;
  &lt;TypeScriptToolsVersion&gt;Latest&lt;/TypeScriptToolsVersion&gt;
  &lt;IsPackable&gt;false&lt;/IsPackable&gt;
  &lt;SpaRoot&gt;ClientApp\&lt;/SpaRoot&gt;
  &lt;DefaultItemExcludes&gt;$(DefaultItemExcludes);$(SpaRoot)node_modules\** 
  &lt;/DefaultItemExcludes&gt;
  
  &lt;!-- Set this to true if you enable server-side prerendering --&gt;
  &lt;BuildServerSideRenderer&gt;false&lt;/BuildServerSideRenderer&gt;
  &lt;/PropertyGroup&gt;
  
  &lt;ItemGroup&gt;
  &lt;PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.1" /&gt;
  &lt;PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.1" /&gt;
  &lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" /&gt;
  &lt;PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" /&gt;
  &lt;PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" /&gt;
  &lt;PackageReference Include="Newtonsoft.Json" Version="11.0.2" /&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>Any ideas?</p>