@@ -56,29 +56,32 @@ public async Task<Template> GenerateBackendsARMTemplate(string apimname, string
56
56
backendTemplateResource . name = $ "[concat(parameters('ApimServiceName'), '/{ backendName } ')]";
57
57
backendTemplateResource . apiVersion = GlobalConstants . APIVersion ;
58
58
59
- //only extract the backend if this is a full extraction, or in the case of a single api, if it is referenced by one of the policies
60
- if ( singleApiName == null )
61
- {
62
- // if the user is extracting all apis, extract all the backends
63
- Console . WriteLine ( "'{0}' Backend found" , backendName ) ;
64
- templateResources . Add ( backendTemplateResource ) ;
65
- }
66
- else
67
- {
68
- bool isReferencedInPolicy = false ;
69
- foreach ( PolicyTemplateResource policyTemplateResource in policyResources )
70
- {
71
- // the backend is used in a policy if the xml contains a set-backend-service policy, which will reference the backend's url or id
72
- string policyContent = policyTemplateResource . properties . policyContent ;
73
- isReferencedInPolicy = DoesPolicyReferenceBackend ( policyContent , namedValueResources , backendName , backendTemplateResource ) ;
74
- }
75
- if ( isReferencedInPolicy == true )
76
- {
77
- // backend was used in policy, extract it
78
- Console . WriteLine ( "'{0}' Backend found" , backendName ) ;
79
- templateResources . Add ( backendTemplateResource ) ;
80
- }
81
- }
59
+ ////only extract the backend if this is a full extraction, or in the case of a single api, if it is referenced by one of the policies
60
+ //if (singleApiName == null)
61
+ //{
62
+ // // if the user is extracting all apis, extract all the backends
63
+ // Console.WriteLine("'{0}' Backend found", backendName);
64
+ // templateResources.Add(backendTemplateResource);
65
+ //}
66
+ //else
67
+ //{
68
+ // bool isReferencedInPolicy = false;
69
+ // foreach (PolicyTemplateResource policyTemplateResource in policyResources)
70
+ // {
71
+ // // the backend is used in a policy if the xml contains a set-backend-service policy, which will reference the backend's url or id
72
+ // string policyContent = policyTemplateResource.properties.policyContent;
73
+ // isReferencedInPolicy = DoesPolicyReferenceBackend(policyContent, namedValueResources, backendName, backendTemplateResource);
74
+ // }
75
+ // if (isReferencedInPolicy == true)
76
+ // {
77
+ // // backend was used in policy, extract it
78
+ // Console.WriteLine("'{0}' Backend found", backendName);
79
+ // templateResources.Add(backendTemplateResource);
80
+ // }
81
+ //}
82
+
83
+ Console . WriteLine ( "'{0}' Backend found" , backendName ) ;
84
+ templateResources . Add ( backendTemplateResource ) ;
82
85
}
83
86
84
87
armTemplate . resources = templateResources . ToArray ( ) ;
0 commit comments