Skip to content

Latest commit

 

History

History
128 lines (83 loc) · 7.43 KB

README.md

File metadata and controls

128 lines (83 loc) · 7.43 KB

Lab 2 - Deploying and Monitoring a Webhook

👈 Back to SaaS Offer labs

⚠️ 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.

Overview

In this lab, you will build on what you accomplished in previous labs. You will create a SaaS offer webhook and eventually integrate it with your Partner Center SaaS offer configuration, enabling your webhook to respond to subscription change events.

The webhook in your Visual Studio solution is an Azure Function. There is no need to change the code in the webhook function at this time.

Looking through the webhook code you'll find that it simply prints the REST payload to the log. You will monitor this log to see the payload when the webhook is called.

Exercise: Create a Publish Profile

  1. In Visual Studio, right click the SaaSFunctions project and select Publish.

  2. For the target, select Azure and click Next.

  3. Select Azure Function App (Windows) and click Next.

  4. Select the right subscription in the dropdown.

  5. To publish, you will need to create a new Function App. Above and to the right of the Function Apps tree at the bottom of the dialog, click the + button to add a new Function App.

  6. In the Name field, enter SaaSWorkshopFunction followed by a number to make it a unique name.

  7. Select the right subscription.

  8. Select the `saas-workshop`` Resource Group.

  9. Stick with Plan Type: Consumption.

  10. Function Apps require the use of a Data Storage account. To the right of the Azure Storage field is a New... link. Click it.

  11. On the Azure storage dialog, click the OK button.

  12. Back on the Function App (windows) dialog, click the Create button.

    The App Service deployment will run for a little while.

  13. On the Publish dialog, click the Next button.

  14. On Select the Publish option and click the Finish button.

You have create an App Service, App Service Plan, storage account, and a publish profile. Now you will use the purlish profile to publish the function application itself.

Exercise: Publish the Function App

At the top right of the publish screen, click the Publish button.

It will take a moment to publish the function application. You can watch progress in Visual Studio's Output window.

Exercise: Getting the webhook URI

You need the webhook URI to add to your Technical Configuration in Partner Center. The Function Application contains only one function and you need the URI of that one function.

  1. Open the Azure portal.
  2. Find and click on the Azure function in the Azure portal. It is inside your saas-workshop resource group.
  3. In the left-hand menu find the Functions link and click it.
  4. You see a single function named Webhook. Click that function.
  5. Near the top of the screen, click Get Function URL and you are presented with a dialog.
  6. Copy the full path to this function into your copy/paste buffer.

Exercise: Publishing the webhook in Partner Center

Now you will populate your offer, with a valid webhook URL.

  1. In Partner Center, on the Technical configuration tab, find the Connection webhook field.
  2. Replace the previous value for the Connection webhook with the URL of the function application
  3. Click Save Draft.

Congratulation! You have finished this lab.

👈 Back to SaaS Offer labs