Azure Active Directory with Azure App Service ASP.NET

Mikaela Caron 41 Reputation points
2020-03-04T13:45:01.9+00:00

Using the Azure portal -> Azure Active Directory -> App Registrations. I created a new app registration and connected it to my Azure App Service (ASP.NET Web Forms website).

Why does the redirect URI have to always be changed from localhost/ to my azure app service URL when I develop vs when I want the changes to be live?

This makes it so anytime I'm developing the web app is down because it's trying to connect to localhost rather than the live instance of the azure app

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,913 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,116 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,866 Reputation points Microsoft Employee
    2020-03-05T00:26:44.43+00:00

    Hi Mikaela,

    It needs to be changed so that the connection is made between Azure and your application for authentication purposes. Registering the application means that you and your developers can use Azure AD to authenticate users and request access to user resources.

    If you want to test using both, you just need to add more than one reply URL in the registration and just toggle your app configuration.

    https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app

    https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/developer-guidance-for-integrating-applications


  2. Ryan Hill 28,636 Reputation points Microsoft Employee
    2020-03-05T15:23:11.077+00:00

    Hi @Mikaela Caron ,

    @MarileeTurscak is referring to the Web Redirect URI that you mentioned. You'll have to toggle that between localhost and your deployed app or you can create a separate app registration for your localhost environment. That doesn't mean adding an app registration here will be automatically linked your app. Think of the App Registration as a registry of entries where the entry says for applications that have this GUID, the Application (client) id, send the token of an authenticated user back to this URI.

    Now, from the app service standpoint, you'll use the Authentication/Authorization blade to say my app will use this app registration entry because this app has the URI that will receive the token. You can also create app registration from the app service from this blade and see it appear in the App Registration blade of the Azure Active Directory because your saying I want my app to receive the token from my tenant when a user successfully signs in.

    Hope that clears up the confusion of why you can't configure app service registration from AAD in the portal. If you have any further questions, let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.