title: .NET Core API not working after deploying on Azure
body: <p>I have a simple .net core web api with angular app on the client side. </p>
  
  <p>When I call my api locally (<a href="http://localhost:5000/api/auth/register" rel="nofollow noreferrer">http://localhost:5000/api/auth/register</a>) it works without any problems. After deploying app to azure and calling it (<a href="https://myapp.azurewebsites.net/api/auth/register" rel="nofollow noreferrer">https://myapp.azurewebsites.net/api/auth/register</a>), I get a 400 Bad Request error without any message.</p>
  
  <p>I was trying to configure app service and sql server on azure portal but I'm not sure what to change.</p>
  
  <p>AuthController.cs</p>
  
  <pre><code>        [HttpPost("register")]
          public async Task&lt;IActionResult&gt; Register(UserToRegisterDto userToRegister)
          {
              if (await AuthService.UserExists(userToRegister.UserName))
              {
                  return BadRequest("Username already exists");
              }
  
              var userToCreate = new User() { UserName = userToRegister.UserName };
  
              await AuthService.Register(userToCreate, userToRegister.Password);
  
              // TODO: Change to return CreatedAtRoute
              return StatusCode(201);
          }
  </code></pre>
  
  <p>AuthService.cs</p>
  
  <pre><code>        public async Task&lt;User&gt; Register(User user, string password)
          {
              GenerateHashedPassword(user, password);
  
              await usersRepository.Create(user);
  
              return user;
          }
  </code></pre>
  
  <p>auth.service.ts</p>
  
  <pre><code>  private baseUrl = environment.apiUrl + 'auth/';
  
    public register(userToRegister: UserToRegister) {
      return this.http.post(this.baseUrl + 'register', userToRegister);
    }
  </code></pre>
  
  <p>environment.ts</p>
  
  <pre><code>export const environment = {
    production: false,
    apiUrl: 'http://localhost:5000/api/'
  };
  </code></pre>
  
  <p>environment.prod.ts</p>
  
  <pre><code>export const environment = {
    production: true,
    apiUrl: 'api/'
  };
  </code></pre>