Repository navigation
Expand file tree
/
Copy pathvm-delete.json
More file actions
113 lines (113 loc) · 2.43 KB
/
Copy pathvm-delete.json
File metadata and controls
113 lines (113 loc) · 2.43 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
"info": {
"_postman_id": "8bc370c3-cd20-4eb4-8fb0-3615a4ed0ab2",
"name": "5. Delete VM",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Create AAD",
"event": [
{
"listen": "test",
"script": {
"id": "5fa9279a-4413-4c65-97a0-c2ec841fac4f",
"exec": [
"// Retrieve access_token and set PM environment variable for all subsequent request",
"pm.test(\"Successful POST request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200]);",
"})",
"var json = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"bearerToken\", json.access_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
},
{
"key": "client_id",
"value": "{{clientId}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{clientSecret}}",
"type": "text"
},
{
"key": "resource",
"value": "{{resource}}",
"type": "text"
}
]
},
"url": {
"raw": "https://login.microsoftonline.com/{{tenantId}}/oauth2/token",
"protocol": "https",
"host": [
"login",
"microsoftonline",
"com"
],
"path": [
"{{tenantId}}",
"oauth2",
"token"
]
}
},
"response": []
},
{
"name": "Delete VM",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bearerToken}}",
"type": "text"
}
],
"url": {
"raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.Compute/virtualMachines/{{vmName}}?api-version=2020-06-01",
"protocol": "https",
"host": [
"management",
"azure",
"com"
],
"path": [
"subscriptions",
"{{subscriptionId}}",
"resourceGroups",
"{{resourceGroupName}}",
"providers",
"Microsoft.Compute",
"virtualMachines",
"{{vmName}}"
],
"query": [
{
"key": "api-version",
"value": "2020-06-01"
}
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
}