Skip to content

Commit 9d18c92

Browse files
committed
Added delete labs and restructured toc
1 parent a8e16ab commit 9d18c92

File tree

4 files changed

+131
-12
lines changed

4 files changed

+131
-12
lines changed

articles/education-hub/create-lab-education-hub.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ ms.date: 12/21/2021
99
ms.custom: template-how-to
1010
---
1111

12-
<!-- 1. H1
13-
Required. Start your H1 with a verb. Pick an H1 that clearly conveys the task the
14-
user will complete.
15-
-->
16-
1712
# Create a lab in Azure Education Hub through REST APIs.
1813

1914
This article will walk you through how to create a lab, add students to that lab and verify that the lab has been created.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Delete a lab in Azure Education Hub through REST APIs
3+
description: Learn how to delete a lab in Azure Education Hub using REST APIs
4+
author: vinnieangel
5+
ms.author: vangellotti
6+
ms.service: azure-education
7+
ms.topic: how-to
8+
ms.date: 1/24/2022
9+
ms.custom: template-how-to
10+
---
11+
12+
# Delete a lab in Education Hub through REST APIs
13+
14+
This article will walk you through how to delete a lab with REST APIs that has been created in Education Hub. Note, all students must be deleted from the lab in order for the lab to be able to be deleted.
15+
16+
## Prerequisites
17+
18+
- Know billing account ID, Billing profile ID, and Invoice Section ID
19+
- Have an Edu approved Azure account
20+
- Have a lab already created in Education Hub
21+
22+
## Delete students from a lab
23+
24+
As mentioned previously, before you delete a lab, you must delete every student in the lab first.
25+
26+
To find all of the students that are in a lab, we can call the below API. Replace the text surrounded in the <>.
27+
28+
```json
29+
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/<BillingAccountID>/billingProfiles/<BillingProfileID>/invoiceSections/<InvoiceSectionID>/providers/Microsoft.Education/labs/default/students?includeDeleted=false&api-version=2021-12-01-preview
30+
```
31+
32+
This will return the information about every student in the specified lab. Be sure to note down the ID of every student in the lab because that is what we will be using to delete the students.
33+
34+
```json
35+
{
36+
"value": [
37+
{
38+
"id": "string",
39+
"name": "string",
40+
"type": "string",
41+
"systemData": {
42+
"createdBy": "string",
43+
"createdByType": "User",
44+
"createdAt": "2021-12-22T17:17:07.542Z",
45+
"lastModifiedBy": "string",
46+
"lastModifiedByType": "User",
47+
"lastModifiedAt": "2021-12-22T17:17:07.542Z"
48+
},
49+
"properties": {
50+
"firstName": "string",
51+
"lastName": "string",
52+
"email": "string",
53+
"role": "Student",
54+
"budget": {
55+
"currency": "string",
56+
"value": 0
57+
},
58+
"subscriptionId": "string",
59+
"expirationDate": "2021-12-22T17:17:07.542Z",
60+
"status": "Active",
61+
"effectiveDate": "2021-12-22T17:17:07.542Z",
62+
"subscriptionAlias": "string",
63+
"subscriptionInviteLastSentDate": "string"
64+
}
65+
}
66+
],
67+
"nextLink": "string"
68+
}
69+
```
70+
71+
After we have the student IDs, we can begin deleting students from the lab. Replace the StudentID surrounded by <> in the below API call with the student ID obtained from the last step.
72+
73+
```json
74+
DELETE https://management.azure.com/providers/Microsoft.Billing/billingAccounts/<BillingAccountID>/billingProfiles/<BillingProfileID>/invoiceSections/<InvoiceSectionID>/providers/Microsoft.Education/labs/default/students/<StudentID>?api-version=2021-12-01-preview
75+
```
76+
77+
The API will respond that the student has been deleted:
78+
79+
```json
80+
student deleted
81+
```
82+
83+
## Delete the lab
84+
85+
After all of the students have been deleted from a lab, we can delete the actual lab.
86+
87+
Call the endpoint below and make sure to replace the sections that are surrounded by <>.
88+
89+
```json
90+
DELETE https://management.azure.com/providers/Microsoft.Billing/billingAccounts/<BillingAccountID>/billingProfiles/<BillingProfileID>/invoiceSections/<InvoiceSectionID>/providers/Microsoft.Education/labs/default?api-version=2021-12-01-preview
91+
```
92+
93+
The API will respond that the Lab has been deleted:
94+
95+
```json
96+
Lab deleted
97+
```
98+
99+
## Next steps
100+
In this article, you learned how to delete students from a lab and then delete the lab itself. Follow the tutorials below if you wish to create a new lab and read up on more documentation.
101+
102+
- [Create a lab using REST APIs](create-lab-education-hub.md)
103+
104+
- [Support options](educator-service-desk.md)

articles/education-hub/index.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,23 @@ landingContent:
4747
url: ./azure-dev-tools-teaching/enroll-renew-subscription.md
4848
- text: Set up access
4949
url: ./azure-dev-tools-teaching/set-up-access.md
50-
- text: Find IDs
51-
url: find-ids.md
5250
- linkListType: how-to-guide
5351
links:
5452
- text: How to manage students
5553
url: ./azure-dev-tools-teaching/manage-students.md
5654
- text: How to download software
5755
url: ./azure-dev-tools-teaching/download-software.md
56+
57+
# Card
58+
- title: Education Hub REST APIs
59+
linkLists:
60+
- linkListType: tutorial
61+
links:
62+
- text: Find IDs
63+
url: find-ids.md
64+
- linkListType: how-to-guide
65+
links:
66+
- text: How to create a lab
67+
url: create-lab-education-hub.md
68+
- text: How to delete a lab
69+
url: delete-lab-education-hub-apis.md

articles/education-hub/toc.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
href: create-lab-education-hub.md
2121
- name: Create an assignment and allocate credit
2222
href: create-assignment-allocate-credit.md
23-
- name: Tutorials
24-
items:
25-
- name: Find IDs required for calling Azure Education Hub APIs
26-
href: find-ids.md
27-
- name: Support
23+
- name: Support
2824
items:
2925
- name: Service desk
3026
href: educator-service-desk.md
@@ -60,3 +56,15 @@
6056
href: azure-dev-tools-teaching/program-faq.yml
6157
- name: Support
6258
href: azure-dev-tools-teaching/program-support.md
59+
- name: Azure Education Hub REST APIs
60+
items:
61+
- name: How-to guides
62+
items:
63+
- name: How to create a lab
64+
href: create-lab-education-hub.md
65+
- name: How to delete a lab
66+
href: delete-lab-education-hub-apis.md
67+
- name: Tutorials
68+
items:
69+
- name: Find IDs required for calling Azure Education Hub APIs
70+
href: find-ids.md

0 commit comments

Comments
 (0)