Azure / Commercial-Marketplace-SaaS-Accelerator

A reference example with sample code for developers interested publishing transactable, Software as a-Service offers in the Microsoft commercial marketplace.
MIT License
179 stars 275 forks source link

Unsubscribe Webhook stuck in loop #694

Open msp-corbett opened 2 months ago

msp-corbett commented 2 months ago

I have an offer setup in preview and was testing the webhook. My endpoint is now being hit constantly by an unsubscribe event about every 3 minutes.

{'applicationName': 'XXX', 'eventType': 'Webhook', 'payloadFromLandingpage': {}, 'payloadFromWebhook': {'action': 'Unsubscribe', 'activityId': '3a894589-848b-4b63-b3ac-cb97637dedd7', 'offerId': 'base_plan_test-preview', 'Id': '3a894589-848b-4b63-b3ac-cb97637dedd7', 'PlanId': 'base_01', 'PublisherId': 'XXX', 'Quantity': 1, 'status': 'Succeeded', 'subscriptionId': 'fd56eab6-fd03-41fd-dcfe-b7f0e5e5f943', 'timeStamp': '2024-04-23T05:00:14.1625935+00:00', 'subscription': {'id': 'fd56eab6-fd03-41fd-dcfe-b7f0e5e5f943', 'name': 'Base Plan Test - Base Subscription', 'offerId': 'base_plan_test-preview', 'planId': 'base_01', 'quantity': 1, 'saasSubscriptionStatus': 'Unsubscribed'}}}

Where do I need to go to clear out, or cancel the event that is causing this webhook to fire?

neelavarshad commented 2 months ago

@msp-corbett Have you enabled notification to an external endpoint? You can disable notifications by making changes in the admin portal.

msp-corbett commented 2 months ago

@neelavarshad Thanks for the response. Which configuration are you referring to in the settings? WebNotificationUrl is set to my webhook URL, which is getting hit. All other notification configurations appear to refer to Email.

I disabled the webhook over the weekend, and now re-enabled it. The loop appears to have stopped, but not before blowing up the application logs with over 33000 entries. I have hundreds of entries for the "Unsubscribe" event for the same subscriptionID image

Is there some processing my end that I need to tell the SaaS Accelerator to stop sending the Webhook request?