You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Product for multiple APIs are not getting deployed through publisher pipeline #245
in my DEV environment, few APIs are associated with the same "product" when I am doing the deployment for higher environment, its considering only the given API in "artifact folder" and in target environment, others APIs not showing up to connect with this product.
Please see the atta
ched image of dev environment where product "cxp" is associated with multiple APIs
See the attached image for QA when we deployed the APIs
then in QA, under this product only one API is displaying
Expected behavior
like dev, in QA also under the product all associated APIS should be displayed
If you tell ApiOps to only export specific APIs, the extractor will only extract product/api associations that contain the listed APIs.
When the publisher then runs, it sets the product API association to what's defined in the extracted JSON. That means APIs not associated with a product in code will be removed from the product in APIM.
I can see why this behavior is not ideal. We'll discuss internally whether it should change. Keep in mind though, the ApiOps philosophy has Git as the source of truth. Our tool is designed to make your environment mirror what's represented in code.
This issue just happened in a scenario with more than 100 API's losing their product - almost a disaster if it wouldn't have been noticed on TEST already.
I know the gitops philosophy here, but unless I explicitly delete something (on commit level) I don't want things to be removed. One simple and logical alternative could be to switch the API Products assignments to API level and not on product level.
+1! I had a similar close-call as Wendelin Niesl (@DSpirit) last week and I'm now struggling to figure out how to manage the APIs within the Product for upper environments.
I think there's a pattern of usage (which i believe was suggested by MS to the team i work with) where we have one API per-branch. This definitely breaks this, because the product.json file in one branch is considered to have the complete set of APIs assigned to a product, and it performs a replace, not a merge. We've somewhat solved this by having a separate "Product" branch where the product-API mapping is extracted to. This, of course, is now a cyclical dependency, which is it's own - but more manageable - drag.
Thanks for the feedback. After internal deliberations, we've landed on this approach.
Current behavior
Product APIs are stored in products/productA/apis.json, where apis.json looks like
[
{
"name": "apiA"
},
{
"name": "apiB"
}
]
If products/productA/apis.json was modified in the commit, the publisher
Associates APIs in apis.json with the product. In the example above, apiA and apiB will get associated with productA.
Removes any associations to the product for APIs that are NOT in apis.json. In the example above, if apiC is currently associated with productA, that association is removed.
New behavior
Product APIs are stored in products/productA/apis/apiA/fileNameTBD.json. fileNameTBD.json will be an empty JSON object for now.
When the publisher runs
If products/productA/apis/apiA/fileNameTBD.json was added in the Git commit, apiA is associated with productA.
If products/productA/apis/apiA/fileNameTBD.json was deleted in the Git commit, the association is removed.
This is a BREAKING CHANGE, but the behavior will be more consistent with that of other ApiOps resources. Would love to hear any feedback.
Todd Drake (@trdrake-tw) - Could you elaborate on your scenario? We've seen ApiOps used with various branching strategies, but one API per branch can get unwieldy very quickly.
This is a problem for teams with operator repositories because APIs have to be deployed before the products can be deployed. It forces this:
deploy the operators repo: resources like namevalues
deploy the api repo: with no product
deploy the operator repo again: product with an api assignment
This requires a costly ceremony to release new APIs and products that we don't have to do with other resources that deploy like this:
deploy the operators repo: * service-level resources
deploy the api repo: with the product assignment
While I understand it may make more sense to match the management API in terms of maintainability, the consumer of APIOps doesn't use the management API. We consume the APIOps tools. I will say it is painful to remember and teach my team "it works one way unless it's a product, then you have to do a special thing."
I have to associate products with Apis in APIOps and using "APIOps Toolkit for Azure APIM v6.0.1.1" latest version hoping it contains fix for this issue and Product APIs are being stored in /artifacts/products/productName/apis/apiName/productApiInformation.json. After running publisher it's successful but products don't get associate with Apis.Can someone share the fix if this has been resolved and does v6.0.1.1 contain fix for this issue?
guys, please provide a quality fix..... you delivered a feature that is not even doing what is suppose to do,
we have a global product definition repo where we don't want to extract apis but only products that will have all associated apis, but that is not happening, so we manually entering the json spec in product to keep this working...
Activity
guythetechie commentedon Mar 16, 2023
Hi nehaapr28 - this behavior is expected.
If you tell ApiOps to only export specific APIs, the extractor will only extract product/api associations that contain the listed APIs.
When the publisher then runs, it sets the product API association to what's defined in the extracted JSON. That means APIs not associated with a product in code will be removed from the product in APIM.
I can see why this behavior is not ideal. We'll discuss internally whether it should change. Keep in mind though, the ApiOps philosophy has Git as the source of truth. Our tool is designed to make your environment mirror what's represented in code.
DSpirit commentedon May 8, 2023
This issue just happened in a scenario with more than 100 API's losing their product - almost a disaster if it wouldn't have been noticed on TEST already.
I know the gitops philosophy here, but unless I explicitly delete something (on commit level) I don't want things to be removed. One simple and logical alternative could be to switch the API Products assignments to API level and not on product level.
hscheffert commentedon May 17, 2023
+1! I had a similar close-call as Wendelin Niesl (@DSpirit) last week and I'm now struggling to figure out how to manage the APIs within the Product for upper environments.
trdrake-tw commentedon May 18, 2023
I think there's a pattern of usage (which i believe was suggested by MS to the team i work with) where we have one API per-branch. This definitely breaks this, because the product.json file in one branch is considered to have the complete set of APIs assigned to a product, and it performs a replace, not a merge. We've somewhat solved this by having a separate "Product" branch where the product-API mapping is extracted to. This, of course, is now a cyclical dependency, which is it's own - but more manageable - drag.
guythetechie commentedon May 24, 2023
Thanks for the feedback. After internal deliberations, we've landed on this approach.
Current behavior
products/productA/apis.json, whereapis.jsonlooks like[ { "name": "apiA" }, { "name": "apiB" } ]products/productA/apis.jsonwas modified in the commit, the publisherapis.jsonwith the product. In the example above,apiAandapiBwill get associated withproductA.apis.json. In the example above, ifapiCis currently associated withproductA, that association is removed.New behavior
products/productA/apis/apiA/fileNameTBD.json.fileNameTBD.jsonwill be an empty JSON object for now.products/productA/apis/apiA/fileNameTBD.jsonwas added in the Git commit,apiAis associated withproductA.products/productA/apis/apiA/fileNameTBD.jsonwas deleted in the Git commit, the association is removed.This is a BREAKING CHANGE, but the behavior will be more consistent with that of other ApiOps resources. Would love to hear any feedback.
guythetechie commentedon May 24, 2023
Todd Drake (@trdrake-tw) - Could you elaborate on your scenario? We've seen ApiOps used with various branching strategies, but one API per branch can get unwieldy very quickly.
trdrake-tw commentedon May 25, 2023
I would agree, but it's the approach we've been asked to take. mihirsurting, in the linked issue (#295), might could comment.
shawnmurtagh commentedon Jun 12, 2023
This is a problem for teams with operator repositories because APIs have to be deployed before the products can be deployed. It forces this:
deploy the operators repo: resources like namevalues
deploy the api repo: with no product
deploy the operator repo again: product with an api assignment
This requires a costly ceremony to release new APIs and products that we don't have to do with other resources that deploy like this:
deploy the operators repo: * service-level resources
deploy the api repo: with the product assignment
While I understand it may make more sense to match the management API in terms of maintainability, the consumer of APIOps doesn't use the management API. We consume the APIOps tools. I will say it is painful to remember and teach my team "it works one way unless it's a product, then you have to do a special thing."
seilorjunior commentedon Dec 1, 2023
guythetechie do you have any news about that?
vinilka8 commentedon Jun 10, 2024
Hi guythetechie,
How long will take to release this feature, I can see it's been under review since the 30th of April,
Thanks,
Regards
waelkdouh commentedon Jul 3, 2024
we just tested under v6.0.0-rc1 and the issue has been resolved. Please test and let us know.
username-anonymous commentedon Sep 2, 2024
I have to associate products with Apis in APIOps and using "APIOps Toolkit for Azure APIM v6.0.1.1" latest version hoping it contains fix for this issue and Product APIs are being stored in /artifacts/products/productName/apis/apiName/productApiInformation.json. After running publisher it's successful but products don't get associate with Apis.Can someone share the fix if this has been resolved and does v6.0.1.1 contain fix for this issue?
vinilka8 commentedon Mar 28, 2025
guys, please provide a quality fix..... you delivered a feature that is not even doing what is suppose to do,
we have a global product definition repo where we don't want to extract apis but only products that will have all associated apis, but that is not happening, so we manually entering the json spec in product to keep this working...