Tutorial: here
What are the differences between:
Products: open/protected
Groups: administrators
, developers
, guests
Policies
inbound
/outbound
/on-error
@(expression)
- C# one-liner@{expression}
- C# multi-linerExample
choose
) - hereCode samples are here
choose
)forward-request
)limit-concurrency
) - eg. throttling 429log-to-eventhub
)mock-response
)retry
)return-response
)Ocp-Apim-Subscription-Key
curl --header "Ocp-Apim-Subscription-Key: <key string>" https://<apim gateway>.azure-api.net/api/path
## Securing APIs by using certs.
…
More: here
Creating an APIM (API Management) instance
GIST: https://gist.github.com/wkaczurba/d38753d32f595d4b663dcdc84579cd1f
#!/bin/bash
# Login if not created:
#az login
echo "Specify your email:"
read MY_EMAIL
RESOURCE_GROUP=apim-demo1-rg
MY_APIM_NAME=apim-$RANDOM
MY_LOCATION=westeurope
PUBLISHER_NAME="APIDemo_Publisher"
echo MY_EMAIL=$MY_EMAIL
echo RESOURCE_GROUP=$RESOURCE_GROUP
echo MY_APIM_NAME=$MY_APIM_NAME
echo MY_LOCATION=$MY_LOCATION
echo PUBLISHER_NAME=$PUBLISHER_NAME
if [ $(az group exists --name $RESOURCE_GROUP) = false ]; then
echo Creating resource group $rg:
az group create --resource-group $RESOURCE_GROUP --location westeurope
else
echo Resource group $RESOURCE_GROUP exists. Not creating.
fi
echo Creating APIM...
az apim create -n $MY_APIM_NAME \
--location $MY_LOCATION \
--publisher-email $MY_EMAIL \
--resource-group $RESOURCE_GROUP \
--publisher-name $PUBLISHER_NAME \
--sku-name Consumption
Then go to APIM, create new API - from https://conferenceapi.azurewebsites.net/?format=json
After importing:
Then the backend spec.:
Go into API -> select “Settings”
Test -> from “Test tab”
Elaborate on security of APIM:
Discuss caching + caching policies.
show example based on this one: https://learn.microsoft.com/en-us/azure/api-management/set-edit-policies?tabs=form
look at https://youtu.be/NQUDkd96sUo?t=574 TODO - descrbe policies as such