is it possible to detach tags from APIM api using becip (the previous question no respond)

Gallatin 21V 186 Reputation points
2024-06-20T06:41:59.3333333+00:00

we used becip scripts to deploy APIM API, and found the API tags can't be modified after we changed the old tag name to a new one , the new one was appended, for example, I deployed the API with tag 'tag1' first, next I changed from 'tag1' to 'tag2' and redeployed, we could see tag1 and tag2 in this API from portal, my purpose was to change the tags from 'tag1' to 'tag2' indead of append 'tag2' to 'tag1', so I wanted to understand if it's possible to do this using becip, if so , how can I achieve it, thank you very much.

reference: https://learn.microsoft.com/zh-cn/azure/templates/microsoft.apimanagement/service/apis/tags?pivots=deployment-language-bicep

updates: this is my bicep template, I already have tag1 and tag2 created via portal, first I deployed it with 'tag1', next I redeployed it with 'tag2', my expectation was to modify tag1 to tag2, but the result was tag1 and tag2 both attached to the API. User's image

User's image

PS: I can't upload the scripts directly, this platform would delete my post at once if I did so.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Luis Arias 5,901 Reputation points
    2024-06-20T15:44:56.94+00:00

    Hi Gallatin 21V,

    I understood that you are trying to update the tag on the APIM resource however this tag is append as a new one on the azure resource.

    By default the Azure deployment is on incremental mode, Could you try deploy your using complete mode? use the what-if operation to verify that you only updated the resource that you want to update.

    Example:

    az deployment group what-if \
      --mode Complete \
      --name ExampleDeployment \
      --resource-group ExampleResourceGroup \
      --template-file main.bicep
    
    

    References:

    Let me know if this help you with what you are looking for.

    Luis