I created a new ASP.NET Core MVC 6.0 web application >> and i define it to use Azure AD for authentication, as follow:-
then i were asked to create owned application, so i created one named "ad" as follow:-
and inside my application's appsetting i got these settings:-
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "*****",
"TenantId": "***",
"ClientId": "***",
"CallbackPath": "/signin-oidc"
},
so seems visual studio did all the work for us. now we want to deploy our application to our client office 365 tenant, so what need to be done on Azure to allow our application to connect to our client Azure AD instead of our Azure AD which was set using visual studio?
second question, now when i accessed All resources inside our Azure portal, i could not find the application named "ad" which was created inside visual studio 2022, so what is the reason?
Thanks
CodePudding user response:
so what need to be done on Azure to allow our application to connect to our client Azure AD...
No need to change anything in Azure Portal, when you create resource in Visual Studio, I trust you are asked to sign in first. If you signed in with the account that you used to sign in Azure portal, then the resources will appear in Azure Portal.
i could not find the application named "ad"
That's because you created Azure AD application which is not a service in Azure subscription. You can going to Azure portal --> choose the correct tenant if you had several tenants --> go to Azure Active Directory -->app registration --> owned applications, then you can see your ad
application.
CodePudding user response:
I tried to reproduce the same in my environment and got the results successfully as below:
I Registered an ASP.NET Core MVC 6.0
web application:
The ad
Application got created successfully like below:
And configured the Additional settings as below:
The appsettings.json
file looks like below:
Note that: The created Azure AD Application will be reflected in the Azure Portal in Azure Active Directory -> App registrations -> All Applications
After executing the application, I signed in and got the screen as below:
I logged in to the Azure AD Application successfully like below:
Now we want to deploy our application to our client office 365 tenant, so what need to be done on Azure to allow our application to connect to our client Azure AD instead of our Azure AD which was set using visual studio?
I created an Azure AD Application in another tenant as below:
Now, you can change the appsettings.json
file by updating the above application details like below:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "xxx.onmicrosoft.com",
"TenantId": "***",
"ClientId": "***",
"CallbackPath": "/signin-oidc"
},
And executing the application and I signed in with the tenant user like below:
I logged in to the Azure AD Application successfully like below: