Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect response codes returned by GET method of armmarketplaceorder.MarketplaceAgreementsClient #21286

Open
unmarshall opened this issue Jul 28, 2023 · 1 comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Marketplace Ordering needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Service This issue points to a problem in the service.

Comments

@unmarshall
Copy link

unmarshall commented Jul 28, 2023

Bug Report

Package dependencies and versions used:

github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.1
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0-beta.2
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.1.0-beta.2
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering v1.2.0-beta.2
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v3 v3.1.0-beta.2
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0-beta.2

I am currently using armmarketplaceorder.MarketplaceAgreementsClient to get the AgreementTerms for a combination of OfferType, PublisherID, PlanID and OfferID and i have observed the following:

Observation-1
If the OfferID is changed to a value which is not there then it returns the following response:

RESPONSE 400: 400 Bad Request
ERROR CODE: BadRequest
--------------------------------------------------------------------------------
{
  "error": {
    "code": "BadRequest",
    "message": "The offer with Offer ID 'gardenlinux-112' was not found. Try one of these: 1- Make sure the offer name is written correctly. 2- If this offer was recently created, allow up to 30 minutes for it to be available for purchase. 3- The offer may have been removed from the marketplace. Look for similar offers from this publisher here: 'https://azuremarketplace.microsoft.com/en-us/marketplace/apps?page=1%26search=sap%20gardenlinux-112'. Publisher ID: 'sap', Offer ID: 'gardenlinux-112', Correlation ID '500ab03e-6282-48ad-afaa-55b690b15d5f'."
  }
}

Expectation:
I was expecting a 404 Resource Not Found to be returned. A bad request is usually returned when the request is malformed or has an invalid value. Offer Types are strings which are persisted by the server when a client creates a Plan. From that perspective i would have assumed that if there was no agreement term for a combination of PlanID, OfferID, PublisherID and OfferType then it should have just returned a 404.

Observation-2
If PlanID is passed a value that does not exist it still returns the AgreementTerms with the correct PlanID. It seems that the value of PlanID has no impact on the response. If that is the case then why do you expect the consumer to pass this value?

Observation-3
If PlanID is left blank then i get the following error:

 parameter planID cannot be empty

So as long as PlanID is any gibberish value and that is clubbed with correct values for the rest of parameters passed to Get method on the client then it will return the correct AgreementTerms. This is totally unexpected.

Observation-4
If PublisherID is set incorrectly then we get the following response:

RESPONSE 400: 400 Bad Request
ERROR CODE: BadRequest
--------------------------------------------------------------------------------
{
  "error": {
    "code": "BadRequest",
    "message": "The offer with Offer ID 'gardenlinux' was not found. Try one of these: 1- Make sure the offer name is written correctly. 2- If this offer was recently created, allow up to 30 minutes for it to be available for purchase. 3- The offer may have been removed from the marketplace. Look for similar offers from this publisher here: 'https://azuremarketplace.microsoft.com/en-us/marketplace/apps?page=1%26search=sap1%20gardenlinux'. Publisher ID: 'sap1', Offer ID: 'gardenlinux', Correlation ID '9f0d19cd-34bc-40c2-9f3f-6d694eaa54f8'."
  }
}

Expectation:
I was expecting a 404 Resource Not Found to be returned. Same as the expectation for an non-existent PlanID. If you closely observe the message says OfferID gardenlinux not found which is weird as it does not talk about a non-existent PublisherID. There is no publisher ID sap1 and therefore all : the error code, http response code and the message are misleading.

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 28, 2023
@unmarshall unmarshall changed the title Inconsistent response codes for armmarketplaceorder.MarketplaceAgreementsClient Incorrect response codes for armmarketplaceorder.MarketplaceAgreementsClient Jul 28, 2023
@unmarshall unmarshall changed the title Incorrect response codes for armmarketplaceorder.MarketplaceAgreementsClient Incorrect response codes returned by armmarketplaceorder.MarketplaceAgreementsClient Jul 28, 2023
@jhendrixMSFT jhendrixMSFT added Marketplace Ordering Service Attention Workflow: This issue is responsible by Azure service team. Service This issue points to a problem in the service. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 28, 2023
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 28, 2023
@github-actions
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @prbansa.

@unmarshall unmarshall changed the title Incorrect response codes returned by armmarketplaceorder.MarketplaceAgreementsClient Incorrect response codes returned by GET method of armmarketplaceorder.MarketplaceAgreementsClient Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Marketplace Ordering needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Service This issue points to a problem in the service.
Projects
None yet
Development

No branches or pull requests

2 participants