@@ -50,7 +50,7 @@ public async Task<Template<TagApiTemplateResources>> GenerateApiTagsTemplateAsyn
50
50
51
51
if ( ! string . IsNullOrEmpty ( singleApiName ) )
52
52
{
53
- tagApiTemplate . TypedResources = await this . GenerateSingleApiTagResourceAsync ( singleApiName , extractorParameters , Array . Empty < string > ( ) ) ;
53
+ tagApiTemplate . TypedResources = await this . GenerateSingleApiTagResourceAsync ( singleApiName , extractorParameters ) ;
54
54
}
55
55
else if ( ! multipleApiNames . IsNullOrEmpty ( ) )
56
56
{
@@ -73,40 +73,31 @@ async Task<TagApiTemplateResources> GenerateMultipleApisTemplateAsync(List<strin
73
73
this . logger . LogDebug ( "Processing {0} api-names..." , multipleApiNames . Count ) ;
74
74
75
75
var overallResources = new TagApiTemplateResources ( ) ;
76
- string [ ] dependsOn = Array . Empty < string > ( ) ;
77
76
foreach ( string apiName in multipleApiNames )
78
77
{
79
- var tagApiResources = await this . GenerateSingleApiTagResourceAsync ( apiName , extractorParameters , dependsOn ) ;
78
+ var tagApiResources = await this . GenerateSingleApiTagResourceAsync ( apiName , extractorParameters ) ;
80
79
81
80
if ( tagApiResources . HasContent ( ) )
82
81
{
83
82
overallResources . AddDataResources ( tagApiResources ) ;
84
-
85
- // Extract the tag name from the last resource
86
- string [ ] lastTagName = tagApiResources . Tags . Last ( ) . Name . Replace ( "')]" , "" ) . Split ( '/' ) ;
87
- dependsOn = new string [ ] { $ "[resourceId('Microsoft.ApiManagement/service/apis/tags', parameters('{ ParameterNames . ApimServiceName } '), '{ apiName } ', '{ lastTagName [ 2 ] } ')]" } ;
88
83
}
89
84
}
90
85
91
86
return overallResources ;
92
87
}
93
88
94
- async Task < TagApiTemplateResources > GenerateSingleApiTagResourceAsync ( string apiName , ExtractorParameters extractorParameters , string [ ] dependsOn )
89
+ async Task < TagApiTemplateResources > GenerateSingleApiTagResourceAsync ( string apiName , ExtractorParameters extractorParameters )
95
90
{
96
91
var templateResources = new TagApiTemplateResources ( ) ;
97
92
98
93
var apiTags = await this . tagClient . GetAllTagsLinkedToApiAsync ( apiName , extractorParameters ) ;
99
- var dependencyChain = dependsOn ;
100
94
foreach ( var apiTag in apiTags )
101
95
{
102
96
var apiTagOriginalName = apiTag . Name ;
103
97
104
98
apiTag . Name = $ "[concat(parameters('{ ParameterNames . ApimServiceName } '), '/{ apiName } /{ apiTagOriginalName } ')]";
105
99
apiTag . ApiVersion = GlobalConstants . ApiVersion ;
106
100
apiTag . Scale = null ;
107
- apiTag . DependsOn = dependencyChain ;
108
- dependencyChain = new string [ ] { $ "[resourceId('Microsoft.ApiManagement/service/apis/tags', parameters('{ ParameterNames . ApimServiceName } '), '{ apiName } ', '{ apiTagOriginalName } ')]" } ;
109
-
110
101
templateResources . Tags . Add ( apiTag ) ;
111
102
}
112
103
0 commit comments