Closed levimatheri closed 2 years ago
Hello @levimatheri. Thanks for you feedback :)
Can you please elaborate more on this issue? the products
array is not mandatory in the yml file 🤔
Hi @mirsaeedi. Yes, the products
array is not required in the yml, but if we don't include it and add product assignments in the API definition, the generated ARM adds a dependsOn
the product. Since the product resource isn't included in the generated ARM (i.e. because of omitting the products
array in the yml), the deployment fails with the error I indicated above, because dependsOn
requires that the referenced resource be in the same ARM template. This is the case with API Tags as well. I've updated the PR.
See example: Here's my yml:
Here's the generated ARM template:
This is what I'd expect instead:
First of all, I love this tool! It would be nice if we didn't have to specify the
products
array in the yml file for the product-api assignments to be added to the output ARM template. This is useful because we manage products as separate arm templates from the APIs. This is the behavior in the apim-azure-devops-toolkit, as in this section of code, it only addsdependsOn
onproducts/apis
resource and notproducts
. Besides, we're already addingdependsOn
product
in the API resource, i.e. products is added as a dependency inApiDeploymentDefinition
. Therefore, if one decides to add the products array in their yml, it should still work.Currently, if one doesn't include
products
in the yml, deployment fails with this error: "The resource 'Microsoft.ApiManagement/service/products/***' is not defined in the template"@mirsaeedi I'd be happy to submit a PR for this.
Thanks.