title: AADSTS70001: Application with identifier 'guid' was not found in the directory
body: <p>Azure AD authentication works fine locally through Visual Studio. But after publishing; I go to URL (<a href="https://mydomain.azurewebsites.net/" rel="nofollow noreferrer">https://mydomain.azurewebsites.net/</a>) and it gets redirected to the login page. At this time the address bar has below data(note:some sensitive data has been removed).</p>
  
  <p><a href="https://login.microsoftonline.com/guid/oauth2/authorize?response_type=code" rel="nofollow noreferrer">https://login.microsoftonline.com/guid/oauth2/authorize?response_type=code</a> id_token&amp;redirect_uri=<strong><a href="https://mydomain.azurewebsites.net/.auth/login/aad/callback" rel="nofollow noreferrer">https://mydomain.azurewebsites.net/.auth/login/aad/callback</a></strong>&amp;client_id=<strong>myclientid</strong>&amp;scope=openid profile email&amp;response_mode=form_post&amp;nonce=noncevalue&amp;state=redir=%2F</p>
  
  <p>Now two problems with the above data</p>
  
  <p>First issue, client_id=<strong>myclientid</strong> mentioned here is not there anymore, I have removed it from the directory. I search my code (find-in-file) for this client Id just to make sure I am not referencing it by mistake. I found no references in code.</p>
  
  <p>Then I copied the correct client_id, replaced to above url and retried. At this time it get me logged in and shows a bad request message. </p>
  
  <p>Second issue redirect url <strong><a href="https://mydomain.azurewebsites.net/.auth/login/aad/callback" rel="nofollow noreferrer">https://mydomain.azurewebsites.net/.auth/login/aad/callback</a></strong> is not what I have configured!!!(I have set it up as <a href="https://mydomain.azurewebsites.net" rel="nofollow noreferrer">https://mydomain.azurewebsites.net</a>) Azure has appended <strong>.auth/login/aad/callback</strong> part</p>
  
  <p>This definitely seems to be a configuration issue.</p>
  
  <p>Has anyone faced this kind of a problem before?</p>