Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 791c8bf

Browse files
authored
Add description for tags and splitAPIs (#271)
1 parent b809b4b commit 791c8bf

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

src/APIM_ARMTemplate/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The utility requires one argument, --configFile, which points to a yaml file tha
3333
| linked | boolean | No | Determines whether the utility should create a master template that links to all generated templates. |
3434
| linkedTemplatesBaseUrl| string | No | Location that stores linked templates. Required if 'linked' is set to true. |
3535
| linkedTemplatesUrlQueryString| string | No | Query string appended to linked templates uris that enables retrieval from private storage. |
36+
| tags | Array<[TagConfiguration](#tagConfiguration)> | No | List of Tags configurations. |
3637

3738
#### APIConfiguration
3839

@@ -57,6 +58,7 @@ The utility requires one argument, --configFile, which points to a yaml file tha
5758
| products | string | No | Comma separated list of existing products to associate the API with. |
5859
| protocols | string | No | Comma separated list of protocols used between client and APIM service. |
5960
| diagnostic | [APIDiagnosticConfiguration](#APIDiagnosticConfiguration) | No | Diagnostic configuration. |
61+
| tags | string | No | Comma separated list of tags to associate the API with. Tags can be existing or nonexisting. For nonexisting tags, it will automatically generate new tags on the API instance |
6062

6163
#### APIOperationPolicyConfiguration
6264

@@ -96,6 +98,13 @@ _Additional properties found in [ProductContractProperties](https://docs.microso
9698

9799
_Additional properties found in [LoggerContractProperties](https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2019-01-01/service/loggers#LoggerContractProperties)_
98100

101+
#### TagConfiguration
102+
103+
| Property | Type | Required | Value |
104+
|-----------------------|-----------------------|-----------------------|--------------------------------------------------|
105+
| displayName | string | Yes | DisplayName and name of the tag |
106+
107+
_Additional properties found in [TagContractProperties](https://docs.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2019-01-01/service/tags)_
99108
### Sample Config File
100109

101110
The following is a full config.yml file with each property listed:
@@ -131,7 +140,9 @@ apis:
131140
apiVersionDescription: My first version
132141
apiVersionSetId: myAPIVersionSetID
133142
apiRevision: 1
134-
apiRevisionDescription: My first revision
143+
apiRevisionDescription: My first revision
144+
products: myProduct
145+
tags: Universe, myTag
135146
operations:
136147
addPet:
137148
policy: C:\Users\myUsername\Projects\azure-api-management-devops-example\src\APIM_ARMTemplate\apimtemplate\Creator\ExampleFile\XMLPolicies\operationRateLimit.xml
@@ -177,6 +188,8 @@ products:
177188
subscriptionsLimit: 1
178189
state: notPublished
179190
policy: C:\Users\myUsername\Projects\azure-api-management-devops-example\src\APIM_ARMTemplate\apimtemplate\Creator\ExampleFile\XMLPolicies\productSetBodyBasic.xml
191+
tags:
192+
- displayName: Universe
180193
loggers:
181194
- name: myAppInsights
182195
loggerType: applicationInsights
@@ -279,10 +292,22 @@ az account set --subscription <subscription_id>
279292
| linkedTemplatesBaseUrl| No | Linked templates remote location. If provided, Extractor generates master template and requires linked templates pushed to remote location. |
280293
| linkedTemplatesUrlQueryString | No | String | Query string appended to linked templates uris that enables retrieval from private storage. |
281294
| policyXMLBaseUrl | No | Policy XML files remote location. If provided, Extractor generates policies folder with xml files, and requires they be pushed to remote location. |
295+
| splitAPIs | No | If set to "true", then generate multiple api folders, each api will have a seperate folder, with a separate master template to deploy this api. If this single api has a version set, then a version set folder will generate instead, then all apis that belongs to this version set will be included in the version set folder, apis in this version set can be deployed separately using every api's master template, or they can be deployed together using the master template in "VersionSetMasterFolder" folder |
282296

283-
To run the Extractor with all arguments (executing a single API extraction with linked templates and policy file generation), use the following command:
297+
#### Note
298+
* You can not use "--splitAPIs" and "--apiName" at the same time, since using "--apiName" only extract one API
299+
### Extractor Command Example
300+
Executing **a single API extraction with linked templates and policy file** generation, use the following command:
284301
```
285302
dotnet run extract --sourceApimName <name_of_the_source_APIM_instance> --destinationApimName <name_of_the_destination_APIM_instance> --resourceGroup <name_of_resource_group> --fileFolder <path_to_folder> --apiName <api_name> --linkedTemplatesBaseUrl <linked_templates_remote_location> --policyXMLBaseUrl <policies_remote_location>
286303
```
304+
Extract **all APIs with linked templates linking all apis and policy file**, use the following command:
305+
```
306+
dotnet run extract --sourceApimName <name_of_the_source_APIM_instance> --destinationApimName <name_of_the_destination_APIM_instance> --resourceGroup <name_of_resource_group> --fileFolder <path_to_folder> --linkedTemplatesBaseUrl <linked_templates_remote_location> --policyXMLBaseUrl <policies_remote_location>
307+
```
308+
Extract **all APIs with seperated api folders**, use the following command:
309+
```
310+
dotnet run extract --sourceApimName <name_of_the_source_APIM_instance> --destinationApimName <name_of_the_destination_APIM_instance> --resourceGroup <name_of_resource_group> --fileFolder <path_to_folder> --linkedTemplatesBaseUrl <linked_templates_remote_location> --policyXMLBaseUrl <policies_remote_location> --splitAPIs true
311+
```
287312

288313
You can also run it directly from the [releases](https://github.com/Azure/azure-api-management-devops-resource-kit/releases).

0 commit comments

Comments
 (0)