Capturing lifecycle events from your Azure Managed Application deployments

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

As a publisher that is offering their software solutions on the Azure Marketplace, in particular Azure Managed Applications, it is essential to monitor the customer deployments to make sure they occur without incidents, and to get notified and act quickly when something fails. While Partner Center provides a dashboard to view your deployed apps, data is not updated in real-time and it make take some time to reflect the latest state. Moreover, it might be challenging to integrate with other Azure services for analytics, alerts, and more. For this reason, we have created a simple Azure Function app that captures real-time events triggered during installation of your Managed Application and persists the information in an Azure Table. This will give you the foundation to consume those events and integrate them into other existing systems to trigger alerts, build dashboards, etc.

 

Overview 

Azure Managed Application notifications allow publishers to automate actions based on lifecycle events of the managed application instances. Publishers can specify a custom notification webhook endpoint to receive event notifications about new and existing managed application instances. Publishers can set up custom workflows at the time of application provisioning, updates, and deletion.

 

In this blog post, we have built a simple Azure Function app, which is invoked via an HTTP trigger, to receive those event notification and store them in an Azure Table. The purpose of this app is to be used as a starter template which will then be customized to include your business logic and integrate it with other services.

 

With the setup below, the Azure Function will capture events triggered during the deployment of your app, such as the start of the deployment as well as the success or failure of it. Captured events are logged in Azure Application Insights as well as saved in an Azure Table storage. You can build analytics and alerts on top of this data. 

  

This project can be used as a starter application and can be customized according to your needs. The solution is published in GitHub repo azure-marketplace-management-extras, so you can freely fork it and update it.

 

polinao_0-1692364429107.png

 

Follow these steps to create the Notification Endpoint 

 

Warning: please make sure you deploy the Notification Endpoint before you publish your managed app offer. Otherwise, you will need to republish the offer again with configuration of the Notification Endpoint URL. 

 

Deployment to Azure 

The directory azure-marketplace-management-extras contains the Bicep templates that deploy the infrastructure components of the Notification Endpoint. Additionally, a GitHub workflow has been created at workflows directory to automate the infrastructure deployment and the Function app deployment. Read these instructions on how to deploy the infrastructure and code.  

 

Set up your Azure Marketplace Managed Application to forward notifications to the Function app endpoint 

In order to set up your Azure Marketplace Managed Application to forward notifications to the notification endpoint, first get the URL of your Azure Function by: 

 

  • Navigating to the Azure Function in the Azure Portal
  • On the function page, select Code + Test from the left menu
  • Select Get function URL from the top menu and copy the URL

To add the notification endpoint to your Managed App, follow the following steps: 

 

  • Open the Managed Application in Partner Centre 
  • Navigate to your offer > select your managed app plan > Plan overview > Technical configuration
  • Enter the Notification Endpoint URL, which is the URL of the Azure Function that you created
  • Save the changes and publish the offer 

Conclusion

The notification endpoint built as an Azure Function is a handy tool for Managed Application solution owners to keep track of their deployed apps. It provides a centralized location to capture events triggered during installation and can be further customized to fit the needs of the publisher. 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.