Incorrect behavior of Create method of armmarketplaceordering.MarketplaceAgreementsClient #21292
Labels
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Marketplace Ordering
Mgmt
This issue is related to a management-plane library.
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.
Bug Report
Package dependencies and versions used:
I am currently using armmarketplaceorder.MarketplaceAgreementsClient to create AgreementTerms for a combination of OfferType, PublisherID, PlanID, OfferID and AgreementTerms and i have observed the following:
Observation-1
All other clients have either
CreateOrUpdate
orBeginCreateOrUpdate
methods which clearly says that it will create it the resource does not exist but it will update if the resource exists. InMarketplaceAgreementsClient
there is a singleCreate
method. Semantically a create only creates and does not update, however if the resource exists then it does not return any error. Behind the scene it usesPUT
HTTP verb which is used to update a resource. This explains why it does not fail. So either this method should be renamed toCreateOrUpdate
just like the rest of clients or aPOST
request should be used to create.Observation-2
Assume that there is already an agreement for
{Publisher: bingo, Offer: my-os, Plan: greatest}
, now make aCreate
call and change thePlan
togreatest1111
or anything other thangreatest
. You will see that the request succeeds. Since it makes a PUT request one would assume that thePlan
would get updated. However that does not get updated. Try and get the resource again and you will see thatPlan
is intact and has not changed. The API should clearly define what can be updated and what cannot be updated.Observation-3
Get the agreement terms, change
resp.AgreementTerms.Properties.Publisher
tobingo1
(original wasbingo
). Use theCreate
call to update it. The update succeeds but when you get the agreement terms again, thenresp.AgreementTerms.Properties.Publisher
is unchanged.Observation-4
Get the current agreement terms and change the signature. Call
Create
with an agreement that contains the changed signature. The update is allowed and is also reflected when you get the agreement terms again.So till now it seems that
Create
can be used to updateAccepted
andSignature
. I have not tested all the fields that are part ofAgreementTerms
apart from what has been already mentioned in the above observations. Nothing is mentioned as part of the API documentation w.r.t what can be updated and what cannot be. The responses returned by the API also does not help as they accept the changes for some and never actually updated the resource, whereas only a subset of field updates get reflected.In its current form this API is quite hard to understand and use.
The text was updated successfully, but these errors were encountered: