Hello folks,
Today I want to talk about how your published applications show up to end users. And how you can configure your app to ensure that users land on the appropriate page when accessing it. Based on the feedback we’ve received this is a topic of great interest for many of you.
As you are aware, when you grant users the ability to access published applications, those applications show up in the Azure AD Access panel and the Office365 App Launcher. By default, when users launch these applications they are taken to the home page url of the published application. The home page url is, by default, set to the front-end url of the published application.
For example, consider a backend application http://ExpenseApp that is published as https://expenseApp-contoso.msappproxy.net. By default, the home page url is set to https://expenseApp-contoso.msappproxy.net and users clicking the app will be taken to that URL.
However, in some cases, we’ve heard that customers want users to land on a specific page within the application, for example https://expenseApp-contoso.msappproxy.net/login/login.aspx. This is a very common request and one that makes perfect sense in multi-page applications that have a specific logical starting point.
Today, I’m very pleased to announce that you can now do this by configuring the ‘home page url’ of the published application. The process requires you to use a PowerShell module. Don’t worry though, we are working to provide this as a UI option to make it easier :). However, rather than hold the feature until we get the UI completed we wanted to share this with you so you could use the steps below to configure your applications right away.
Ross, a Senior Program Manager in the team, has been focusing on getting this capability into your hands as soon as possible. Let me have him introduce it to you.
Go on, give this a try! And as always, if you have any feedback on this please send us a note at aadfeedback@microsoft.com. We look forward to hearing from you.
Thanks,
Girish Chander.
@chander_girish
Hello everyone,
I’m Ross Adams and I’m a Senior Program Manager in the Azure Active Directory team, focusing on Application Proxy and other Hybrid Identity technologies.
Alright, let’s walkthrough how to setup a custom home page url for your published application.
Before we begin
There are a couple of items to note when you set the homepage url:
1. You must make sure that the path you specify is a sub path of the frontend url.
For example, if the intranet application is published with a front-end url of https://intranet-contoso.msappproxy.net/ then the homepage url that you configure must start with https://intranet-contoso.msappproxy.net/. Similarly, if the front-end url is https://apps.contoso.com/app1/ then the home page url must start with https://apps.contoso.com/app1/
2. If you make a change to the published application, it may reset the value of the home page url. So if you do update the application you may need to recheck/update the homepage url.
Using Azure AD Powershell module
To set the home page url using powershell, you need to get the Azure AD PowerShell module installed. This isn’t the standard Azure AD PowerShell module but a package from the PowerShell Gallery that uses the GRAPH API end point. More information about the package can be found here (https://www.powershellgallery.com/packages/AzureAD/1.1.23.0) including instructions, which are relatively simple as follows:
1. Open PowerShell.
2. Run the following command
Install-Module -Name AzureAD -RequiredVersion 1.1.23.0
NOTE: if you are running this as a non Admin you will need to use the additional option of “-scope currentuser”.
3. During the install it will install two packages from Nuget.org, please select “Y” to install these as they are needed to use the package.
Setting a Home Page URL Value
Now that you have the Powershell Module installed we’re ready to set the home page url using two simple steps:
1. Find the application you want to update.
2. Update the homepage URL for the application.
Step 1 – Finding the ObjectID of the application
To obtain the ObjectID of the application I’m going to search for the application by the homepage.
1. Open PowerShell.
2. Import the AzureAD module
Import-Module AzureAD
3. We now need to login. Use the cmdlet below and follow the instructions on the screen. Make sure you login as the tenant administrator.
Connect-AzureAD
4. The cmdlet below will find the applications based on the homepage containing “sharepoint-iddemo”. The app I’m looking to edit. Just replace this with the value that works for your application. Note I filtered the return result for easier reading.
Get-AzureADApplications | where { $_.Homepage -like "*sharepoint-iddemo*" } | fl DisplayName, Homepage, ObjectID
5. You should see something similar to the following. The GUID (in bold below) is the value we are looking for:
DisplayName : SharePoint
Homepage : https://sharepoint-iddemo.msappproxy.net/
ObjectId : 8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4
6. Copy the GUID value you see to the clipboard. We’ll need that in step 2.
Step 2 - Updating the Homepage URL
We are going to use the same tool to update the homepage URL as we did to find the application. In my case the application ID I want to update is “8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4”.
I’m assuming you are still logged into PowerShell, if not then repeat steps 1 to 3 above, then follow the steps below:
1. Confirm you have the right application, just replacing “8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4” with the value of your application that you copied above.
Get-AzureADApplication -AppObjectId 8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4
2. Now that we have confirmed the application we are ready to update the homepage as follows.
a. Create a blank application object to hold the changes we want to make; this doesn’t create anything; it is just a variable of the right type to hold the values we want to update.
$appnew = New-Object "Microsoft.Open.AzureAD.Model.Application"
b. Set the homepage to the value you want it to be, keep in mind that it must be a sub path of the published application. In my case I’m going to change my homepage from https://sharepoint-iddemo.msappproxy.net/ to https://sharepoint-iddemo.msappproxy.net/hybrid/ so uses go straight to the hybrid site.
$appnew.Homepage = "https://sharepoint-iddemo.msappproxy.net/hybrid/"
c. Now we just need to make the update, remember to use the GUID you copied from above.
Set-AzureADApplication -AppObjectId 8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4 -Application $appnew
3. You’re all done, and we can confirm by getting the application again and making sure the change worked.
Get-AzureADApplication -AppObjectId 8af89bfa-eac6-40b0-8a13-c2c4e3ee22a4
Keep in mind that certain changes to the application in the UX will reset the HomePage URL so you might have to do this again.
Hope you find this useful and as always we appreciate your feedback.