Skip to content

Latest commit

 

History

History

api_management

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

API Management in Azure

Note: Architectures illustrated are for educational purposes ONLY. They do no necessarily follow best practices and are NOT suitable for production.

Requirements

  • Microsoft Azure Tenant
  • Microsoft Azure Subscription
  • Microsoft Azure Service Principal with client ID and client secret

Books API Exposed via Azure API Management

The Azure architecture implemented here exhibits how a Simple Books REST API Service can be exposed through Azure's API Management service.
An Azure Virtual Machine (VM) is deployed in an Azure Virtual Network (V-Net) to host the REST API Service. After deploying the VM, the Public IP address of the VM is inserted into an Ansible hosts file. The VM is then provisioned to run the API program with Ansible.
An API is deployed within an API Management Service instance using the OpenAPI 3.0 specification file of the REST API Service (which was duplicated into the files directory for ease of access). The REST API Service is made available to the API Management API via the Public IP address of the hosting VM (over plain HTTP - not secure, I know :-|).

Usage

Azure-Terraform Authentication

To authenticate terraform with Azure, export the following environment variables in your shell:

export ARM_CLIENT_ID=""
export ARM_CLIENT_SECRET=""
export ARM_SUBSCRIPTION_ID=""
export ARM_TENANT_ID="" 
export ARM_SKIP_PROVIDER_REGISTRATION="true"

Required Variables

The following terraform variables are required to run this terraform infrastructure module:

resource_group = "azure resource group"
http_basic_auth_username = "http_basic_auth username for backend API"
http_basic_auth_password = "http_basic_auth password for backend API"
public_key_path          = "public key for SSH access"
private_key_path         = "private key for SSH access"