Lab 3 - Installing a Publisher Portal#
⚠️ Completion of this lab is required for the following labs in the series to work properly.
💀 The code in this lab is NOT meant to be used for production environments. It is a simple example with no error handling, no custom workflows, and is for learning purposes only.
This is a quick lab in which you will create one app registration and deploy a small website used by the publisher for activating customer subscriptions. After you have the new website installed, the customer can use their landing page to request subscription activation and use the publisher portal to activate the subscription.
Exercise: Create an app registration#
In this exercise, you will create a single-tenant app registration for the internal Publisher Portal application. This allows accounts you designate within your own tenant to access the application.
- Log in to the Azure portal.
- In the top-of-center command window in the portal, type "app reg" and select the item "App registrations" that appears. You will see a list of current app registrations.
- At the top of the page, click the + New registration link. You are taken to the Register an application page.
saas-workshop-publisheras the name of this app registration.
- At the bottom of the page, click the Register button.
Add a secret#
Now you will add a secret to the app registration. Make sure to copy and paste the secret value somewhere you can access it later.
- Click into the saas-workshop-publisher application registration.
- In the left-hand menu, find the Manage menu and click the Certificates and secrets link.
- Create a new client secret.
- Give it a description.
- Choose an expiration date. The 6-month default should be fine.
- Copy the Value of the secret and paste it somewhere you can easily access it later.
Exercise: Configure appsettings.json#
Now you configure the
appsettings.json file for the Publisher Portal application so you can publish it.
- In Visual Studio, open the
appsetting.jsonfile in the PublisherPortal project.
YOUR_DOMAINwith the same value you use in the
appsettings.jsonfile for the LandingPage project.
TENANT_IDwith the Tenant ID of the tenant you are working in. To find the Tenant ID, do the following.
- Type Tenant into the command bar at the top of the Azure portal and select Tenant properties.
- Find the Tenant ID field and copy the value into the
CLIENT_IDwith the Application (client) ID of the app registration you created in the above exercise.
CLIENT_SECRETwith the secret you created in the above exercise.
MarketplaceApi section, you may copy and paste the section from the LandingPage project's
appsettings.json file. It is an exact copy.
Exercise: Create an App Service and publish profile for the Publisher Portal application#
In this section, you'll create an App Service for your new portal so you can publish it in the next step.
- Right click the project in Visual Studio and select Publish.
- Select Azure as your target and then click the Next button.
- Select Azure App Service (Windows) and then click the Next button.
- Click the green + button to create a new App Service and the App Service creation dialog appears.
- Enter SaaSWorkshopPublisherPortal with a number suffix as the name of the app service.
- Set the Resource Group to
- Set the App service plan to the one you created earlier, likely named SaaSWorkshopAppServicePlan.
- Click the Create button to create the App Service and be taken back to the Publish dialog.
- Select your new App Service instance.
- Click the Next button.
- Select the Publish option to create a publish profile.
- Click the Finish button.
Exercise: Publish the Publisher Portal application#
Now that you are back to the publish dialog, just click the Publish button in the upper-right of the page to publish your website.
This may take a few moments for the site to publish. You can monitor publish progress in Visual Studio's output window.
The page will launch, but shows an error message. You aren't quite done configuring the publisher portal application.
Update the application registration#
- In the command bar at the top of the Azure portal, search for and select App Services.
- Click on the App Service you've just created, SaaSWorkshopPublisherPortal with a number suffix.
- On the overview screen in Visual Studio, the URL for the site should be in the Hosting section. Copy it into your paste buffer.
- In the command bar at the top of the Azure portal, search for and select App registrations.
- Click on the
- In the left-hand menu click the Authentication link.
- Click on Add a platform under Platform configurations.
- Select Web tile under Configure platforms.
- Paste in your publisher portal application URL under Redirect URIs and click Configure.
- In the Web > Redirect URIs section, click Add URI.
Paste your publisher portal application URL in again on another line, this time adding a suffix of
/signin-oidcso that your URI looks something like this.
Click the Save button at the top of the screen.
Using the App Service URL
https://<prefix>.azurewebsites.net, browse to that web page. After authenticating you will see all the subscriptions to your offers. If you completed Lab 2, there should be at least one purchased subscription.
If you haven't completed Lab 2 by subscribing to your offer, please go do so now.
Exercise: As a customer, request subscription activation#
This exercise puts you in the place of the customer, and you will request your subscription be activated by the publisher.
- In the command text box at the top of the Azure portal, type "SaaS" and select SaaS from the dropdown. This takes you to the SaaS management page where you can monitor and manage all your SaaS offers.
- Click the SaaS offer you subscribed to in Lab 2. Note that it is the
Pending Configurationstate. The publisher has not provisioned your account yet.
- Click the Configure account now button. This takes you to the offer's landing page.
- Under the Available Customer Actions section, click the link for Notify publisher to activate account. This emulates sending a notice to your publisher that you want to activate your subscription.
Exercise: As the publisher, activate the customer's subscription#
This exercise puts you back in the role of the publisher, and you will activate the customer's subscription.
- Open the publisher portal website.
- Find and click on the subscription that needs to be activated.
- Notice the SaasSubscriptionStatus field is in the
- Scroll down to the Publisher Actions section.
- Click the Activate this subscription link.
- Notice the status immediately changes to Subscribed.
Exercise: See the activation on the client side#
- Go back to the landing page for the offer and note the Subscription State now equals
- Go back to the SaaS management screen and find your subscription. It likely still reads
- This page caches the state of the subscriptions and updates every few minutes. Try refreshing the page occasionally until it reads
Congratulations! You have finished this lab.
If you are in a live class setting, please raise your hand in Microsoft Teams to indicate you are done with the lab.
Congratulation! You have finished this lab.