Skip to content

Commit

Permalink
Updated the docs to reflect changes in V2 of the tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Wael Kdouh committed Nov 10, 2022
1 parent 759e268 commit 28225b1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
2 changes: 2 additions & 0 deletions docs/apiops/1-supportedScenarios/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Below there is a table with all [artifacts extracted and published by APIOps](ht
| | | |
|Backend|Provides operations for managing Backends configured for the APIs|Yes|
|Policy Fragments| |Yes|
|API and Product Tags| |Yes|
|Group/Products Association| |Yes|
|GraphQL| |Yes|


Expand Down
23 changes: 13 additions & 10 deletions docs/apiops/3-apimTools/apiops-2-1-tools-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@ The extractor will export the artifacts listed below.
| - | - |
| APIM instance global policy | ./policy.xml |
| Product information | ./products/``product_display_name``/productInformation.json |
| Product policy | ./products/``product_display_name``/policy.xml |
| Product Groups | ./products/``product_display_name``/policy.xml |
| Product Groups | ./products/``product_display_name``/groups.json. Please note that we don't create the groups. We only associate with existing ones that would be created using IaC tool like ARM/Bicep/Terraform which is outside the scope of this tool |
| Gateway information | ./gateways/``gateway_name``/gatewayInformation.json |
| Authorization server information | ./authorizationServers/``authorization_server_name``/authorizationServerInformation.json |
| Diagnostic information | ./diagnostics/``diagnostic_name``/diagnosticInformation.json |
| Logger information | ./loggers/``logger_name``/loggerInformation.json |
| Non Versioned/revisioned API information | ./apis/``api_display_name``/Original/1/apiInformation.json |
| Non Versioned/revisioned specification information | ./apis/``api_display_name``/Original/1/specification.yaml |
| Versioned API information | ./apis/``api_display_name``/``Original serves as v1 in addition to folders for each version``/1/apiInformation.json |
| Versioned specification information | ./apis/``api_display_name``/``Original serves as v1 in addition to folders for each version``/1/specification.yaml |
| revisioned API information | ./apis/``api_display_name``/``Original\[revision number]``/apiinformation.json |
| revisioned specification information | ./apis/``api_display_name``/``Original\[revision number]``/specification.yaml |
| OpenAPI specification | ./apis/``api_display_name``/specification.{yaml\|json} |
| API policy | ./apis/``api_display_name``/policy.xml |
| Operation policy | ./apis/``api_display_name``/operations/``operation_display_name``/policy.xml |
| Non Versioned/revisioned API information | ./apis/``api_name``/Original/1/apiInformation.json |
| Non Versioned/revisioned specification information | ./apis/``api_name``/Original/1/specification.yaml |
| Versioned API information | ./apis/``api_name``/``Original serves as v1 in addition to folders for each version``/1/apiInformation.json |
| Versioned specification information | ./apis/``api_name``/``Original serves as v1 in addition to folders for each version``/1/specification.yaml |
| revisioned API information | ./apis/``api_name``/``Original\[revision number]``/apiinformation.json |
| revisioned specification information | ./apis/``api_name``/``Original\[revision number]``/specification.yaml |
| OpenAPI specification | ./apis/``api_name``/specification.{yaml\|json} |
| API policy | ./apis/``api_name``/policy.xml |
| Operation policy | ./apis/``api_name``/operations/``operation_name``/policy.xml |
| tags | ./tags/``tag_name``
| backends | ./backends/``backend_name``
25 changes: 13 additions & 12 deletions docs/apiops/3-apimTools/apiops-2-2-tools-publisher.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,14 @@ Here is a [**sample configuration file**](https://github.com/Azure/apiops/blob/m
![configuration Overrides](../../assets/images/Yaml_configuration.png)


Note that the configuration file is optional. In addition the different properties listed in the table below are optional as well. For example if you only need to override a nameValue then you would only include the namedValues property.
Note that the configuration file is optional. For a full list of supported configuration overrides that the publisher tool supports please take a look at the restful api documentation of APIM which can be found here [**APIM Restful API Docs**](https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/apis/create-or-update?tabs=HTTP). For more information spend some time looking at the response body of each of the sections in the APIM docs. Here is an example of the [**API Diagnostics Response Body which shows you which properties you can override**](https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/api-diagnostic/create-or-update?tabs=HTTP#apimanagementcreateapidiagnostic).

Below is the full list of supported configuration overrides that the publisher tool supports.

| Property | Purpose |
| - | - |
| apimServiceName | Name of the destination APIM instance that you would like to promote to. Note that if you provide both the apimServiceName and the API_MANAGEMENT_SERVICE_NAME environment variable then the configuration file will take precedence |
| namedValues | List of named value pairs to override. All three types (Plain - Secret - Key Vault) are supported
| loggers | Information for the application insights instance to utilize in the destination environment APIM instance |
| diagnostics | Configuration for the verbosity setting of the application insights instance to utilize in the destination environment APIM instance |
| apis | List of apis for you which you would like to override settings like the application insights etc.. You can also override the service url across environments. If you are utilizing versioning/revisioning in APIM then you need to set the target api version & revision to apply application insights to e.g. 'my-api', 'my-api-v2', 'my-api-v2;rev=2' |
| backends | List of backends which you would like to override. You can override information like the url when promoting across environments |
```
Note: When it comes to child configuration override (e.g. apis diagnostics) you don't need to include the properties tag in your yaml.
```

As mentioned above the publisher supports overriding secret named values. Whereas the publisher supports both types of APIM secrets (secret and Azure Key Vault), we recommend using Azure Key Vault whenever possible.
The publisher supports overriding secret named values. Whereas the publisher supports both types of APIM secrets (secret and Azure Key Vault), we recommend using Azure Key Vault whenever possible.

If you are trying to override a secret stored in Azure Key Vault then you can simply override the named value in your configuration file as demonstrated in the following [**sample configuration file**](https://github.com/Azure/apiops/blob/main/configuration.prod.yaml).

Expand All @@ -70,9 +64,16 @@ Note: You don't have to create the named values in the target APIM environments

If you are trying to override a secret stored as secret namedvalue type in APIM you can simply override the named value in your configuration file as demonstrated in the following [**sample configuration file**](https://github.com/Azure/apiops/blob/main/configuration.prod.yaml).

The important thing to note here is that the value included in the configuration override needs to be defined as a secret in your Azure Devops (as a variable group secret) and Github (as an environment secret) and then passed as an environment variable in the yaml files. The sample configuration yaml files provided in this repository set a variable name called testSecretValue which is the value that gets set on Azure APIM. The important thing to note there is that you need to surround your secret with {#[your secret]#}. Set the list of environments variables as you fit for your scenario. Please note that you will need to install the Replace Tokens Extension in the Azure DevOps environment. Go to the marketplace and search for Replace Tokens. You don't need to install any extension for Github as its not required there.
The important thing to note here is that the value included in the configuration override needs to be defined as a secret in your Azure Devops (as a variable group secret) and Github (as an environment secret) and then passed as an environment variable in the yaml files. The sample configuration yaml files provided in this repository set a variable name called testSecretValue which is the value that gets set on Azure APIM. Another thing to note here is that there is that you need to surround your secret with {#[your secret]#}. Set the list of environments variables as you fit for your scenario.

```
Note: You will need to install the Replace Tokens Extension in the Azure DevOps environment. Go to the marketplace and search for Replace Tokens. You don't need to install any extension for Github as its not required there.
```

```
Note: You don't have to create the named values in the target APIM environments ahead of time as they will be created by the publisher.
```

```
Note: Important note regarding deleting apis. If you delete the specification file nothing happens. But if you delete the information file we delete the api. Now if you delete one but not the other it will do a put of whichever file is left. So always make sure you delete both files when deleting an api. As a matter of fact its recommended you delete the folder pertaining to the api under question.
```
Binary file modified docs/assets/images/Yaml_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28225b1

Please sign in to comment.