-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI_management.ps1
64 lines (48 loc) · 1.73 KB
/
API_management.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Create a resource group
# Create a new service
# Check the status of the deployment
# Clean up resources
# Examples of the help
az find "az apim"
# Create a resource group
az group create -n rg-api --location northeurope
# Create a new service
az apim create -n THAPI \
-g rg-api \
--publisher-name Live \
--publisher-email [email protected] \
--sku-name Consumption \
--no-wait
#
# Check the status of the deployment
az apim show -n THAPI \
-g rg-api \
--output table
#
# Delete an API management intance
az apim delete -n THAPI \
-g rg-api \
--no-wait \
--yes
#
# Purge API management service
az apim deletedservice purge -l northeurope \
--service-name THAPI
#
# List all API deleted services
az apim deletedservice list
# Show an API deleted service
az apim deletedservice show -l northeurope \
--service-name THAPI
#
# Check to see if the name is in use
az apim check-name -n THAPI
# Clean up resources
az group delete -n rg-api --yes
# Show a given soft-deleted instance by name
GET https://management.azure.com/subscriptions/7f1f265d-dc8c-4232-af03-db9ab6f9fa63/providers/Microsoft.ApiManagement/locations/NorthEurope/deletedservices/THAPI?api-version=2021-08-01
# List all API management soft-deleted instances for a given subscription:
GET https://management.azure.com/subscriptions/7f1f265d-dc8c-4232-af03-db9ab6f9fa63/providers/Microsoft.ApiManagement/deletedservices?api-version=2021-08-01
curl https://thapi.azure-api.net/api/Products
curl --header "Ocp-Apim-Subscription-Key: xxxxxxxxxxxxxxxxxxxxxxxxx" https://thapi.azure-api.net/api/Products
curl --header "Ocp-Apim-Subscription-Key: xxxxxxxxxxxxxxxxxxxxxxxxx" https://thapi.azure-api.net/api/Products