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

Commit

Permalink
Example Usage using the Azure CLI (#16)
Browse files Browse the repository at this point in the history
* create example page and reference from readme
  • Loading branch information
jsacapdev authored and nzthiago committed Dec 5, 2018
1 parent a008c1b commit 803df72
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Example.md
@@ -0,0 +1,36 @@
# Example deployment using the Azure CLI

The following instructions demonstrate how to deploy the contents of this example repository using the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).

#### Changing the `ApimServiceName` template parameter

Note that throughout the following steps, the ARM template parameter `ApimServiceName` will need to be unique. If you use the default of `contosoapim-dev` that is used in these templates you will get the following error:

```
Deployment failed. Correlation ID: {
"code": "ServiceAlreadyExists",
"message": "Api service already exists: contosoapim-dev",
"details": null,
"innerError": null
}
```

## Instructions

Login to your Azure subscription:

`az login`

Create a new resource group `apim-rg` that will be used to deploy an APIM instance:

`az group create -n apim-rg -l westeurope`

Deploy the _service template_ to host the APIM _instance_ (note this command can take several minutes to complete):

`az group deployment create --resource-group apim-rg --template-file ./example/service.template.json --parameters ./example/service.parameters.json`

Deploy the `api-httpbin` _API template_ to create an API in the APIM instance:

`az group deployment create --resource-group apim-rg --template-file ./example/api-httpbin/api-httpbin.template.json --parameters ./example/api-httpbin/api-httpbin.parameters.json`

It is of interest the command to create the `api-httpbin` API uses an Open API (swagger) specification `api-httpbin.openapi.json` file when creating the API.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -32,6 +32,8 @@ Once the changes are merged successfully, then _API publishers_ can deploy them

With this approach, it is easy to migrate changes from one environment to another. Also, since different API development teams will be working on different sets of API templates and files, it also prevents them from colliding with each other.

We have provided an [example](Example.md) on how to use this approach and deploy using the Azure CLI.

We realize our customers bring a wide range of engineering cultures and existing automation solutions. The approach proposed here is not meant to be a one-size-fits-all solution. That's the reason we created this repository and open sourced everything, so that you can extend and custom the solution.

If you have any questions or feedback, please raise issues in the repository or email us at apimgmt at microsoft dotcom. We also started an [FAQ page](./FAQ.md) to answer most common questions.
Expand Down

0 comments on commit 803df72

Please sign in to comment.