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

Commit 803df72

Browse files
jsacapdevnzthiago
authored andcommitted
Example Usage using the Azure CLI (#16)
* create example page and reference from readme
1 parent a008c1b commit 803df72

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Example.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Example deployment using the Azure CLI
2+
3+
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).
4+
5+
#### Changing the `ApimServiceName` template parameter
6+
7+
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:
8+
9+
```
10+
Deployment failed. Correlation ID: {
11+
"code": "ServiceAlreadyExists",
12+
"message": "Api service already exists: contosoapim-dev",
13+
"details": null,
14+
"innerError": null
15+
}
16+
```
17+
18+
## Instructions
19+
20+
Login to your Azure subscription:
21+
22+
`az login`
23+
24+
Create a new resource group `apim-rg` that will be used to deploy an APIM instance:
25+
26+
`az group create -n apim-rg -l westeurope`
27+
28+
Deploy the _service template_ to host the APIM _instance_ (note this command can take several minutes to complete):
29+
30+
`az group deployment create --resource-group apim-rg --template-file ./example/service.template.json --parameters ./example/service.parameters.json`
31+
32+
Deploy the `api-httpbin` _API template_ to create an API in the APIM instance:
33+
34+
`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`
35+
36+
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.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Once the changes are merged successfully, then _API publishers_ can deploy them
3232

3333
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.
3434

35+
We have provided an [example](Example.md) on how to use this approach and deploy using the Azure CLI.
36+
3537
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.
3638

3739
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.

0 commit comments

Comments
 (0)