1 min read
Staging Routing
Prerequisites
- Access to https://github.com/poqcommerce/Poq.Terraform.git repo
Steps
- Clone https://github.com/poqcommerce/Poq.Terraform.git repo
- Go to staging/apim/poqplatformstaging
- Create apimpoqplatformstaging[yourclientname]bfcrev_1.tf file with following content:
module "yourclientname_bfc" { source = "../../../modules/bfc/apim_bfc_routing" apim = azurerm_api_management.poqplatformstaging api_name = "yourclientname" api_display_name = "Your Client Name (BFC)" path = "clients/yourclientname" service_url = "https://poq-yourclientname-staging-weu-app.azurewebsites.net" # Optional args description = "Standard BFC routing for Your Client Name" verbs = ["DELETE", "GET", "PATCH", "POST", "PUT"]}
- Replace yourClientName with proper client name everywhere in the file following the same naming convention, for ex: yourclientname -> amazingclient; Your Client Name -> Amazing Client
- Create PR
- Merge the PR
- Apply terraform scripts. In order for terraform scripts to take action they need to be applied. We are still in the process of defining how to better setup this process. If you have access to terraform console you can apply scripts by yourself, if you do not have access you should reach out to your Poq contact to apply scripts for you.
Congratulations, you have successfully created routing for the Staging environment.
We advise to test APIM routing right away once it has been created. As a prerequisite for such a test you need to have infrastructure setup and API deployed. Then in order to make sure that APIM routing is working as expected you can use an example request to /shop endpoint for example:
curl -X GET "https://staging.poq.io/clients/yourclientname/shop" -H "accept: text/plain" -H "Poq-App-Identifier: yourAppIdentifier"