Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2813

Use specific clientId's credentials in swatch-producer-azure when possible

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • 2024-09-17 - API
    • None
    • None

      As of ITPART-1180, the clientId associated to a given Azure subscription is available in the /partnerEntitlements response (for most azure subscriptions). Note: the clientId is not always available from the IT Partner Entitlement endpoint; contracts created prior to implementation of ITPART-1180 do not have the clientId recorded.

      When available, swatch should use this attribute to determine which client credentials should be used to submit usage; otherwise we should try all configured client credentials.

      Implementation hint: AzureMarketplaceService.sendUsageEventToAzureMarketplace should consider the clientId value from AzureUsageContext if available.

      Done:

      • When a contract is synced from the IT Partner gateway the value of clientId is stored as another field in the `;`-delimited billingProviderId.
      • Preserve current behavior of trying all the credentials/regions as a fallback because not all contracts are populated with this information. However, we should only log an error if we are completely unable to send the data. i.e. a retry to a different endpoint/credential combination is not an error.   
      • AzureUsageContext is updated to provide the value of clientId when it is present in billingProviderId
      • When swatch-producer-azure looks up azure usage context and the context includes a clientId value, it should immediately use the azure client configured with the value, and not loop through any other clientId's client instances.
      • Ephemeral test using wiremock to validate behavior
      • Validate that if a matching credential is not found that appropriate errors are logged. 
      •  

              jcarvaja@redhat.com Jose Carvajal Hilario
              khowell@redhat.com Kevin Howell
              Lisa Walker Lisa Walker
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: