Onboard Azure.Provisioning.Education - #63261
RuiJun Hu (MSFT) (cxznmhdcxz) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Resource scope modeling makes several generated resources and the primary sample invalid for their actual billing-scoped endpoints.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (9)
Require billing invoice-section scope for Education labs · New Preserve required EducationLab parent for StudentDetails · New Include billing invoice-section scope in sample · New Validate Education labs at billing tenant scope · New Include billing invoice-section scope in public example · New Rename GrantDetails with Education-specific client name · New Rename JoinRequestStatus with Education-specific client name · New Rename LabStatus with Education-specific client name · New Rename StudentRole with Education-specific client name · New
What changed in this PR
Onboards the TypeSpec-generated Azure.Provisioning.Education package, including its public API, validation assets, documentation, and CI integration.
Changes:
- Adds Education provisioning resources and models.
- Adds unit/live tests, README snippets, API listings, and package metadata.
- Registers the package in Education CI and spell checking.
| File | Description |
|---|---|
sdk/education/cspell.yaml |
Adds provisioning terminology. |
sdk/education/ci.mgmt.yml |
Adds package CI coverage. |
Azure.Provisioning.Education/tsp-location.yaml |
References the draft specification commit. |
tests/BasicLiveEducationTests.cs |
Adds live validation. |
tests/BasicEducationTests.cs |
Adds Bicep generation test and snippet. |
tests/Azure.Provisioning.Education.Tests.csproj |
Configures tests and references. |
src/Generated/StudentLabDetails.cs |
Adds student-lab resource. |
src/Generated/Models/StudentRole.cs |
Adds student-role enum. |
src/Generated/Models/StudentProperties.cs |
Adds student properties. |
src/Generated/Models/StudentLabStatus.cs |
Adds student-lab statuses. |
src/Generated/Models/StudentLabProperties.cs |
Adds student-lab properties. |
src/Generated/Models/LabStatus.cs |
Adds lab statuses. |
src/Generated/Models/LabProperties.cs |
Adds lab properties. |
src/Generated/Models/JoinRequestStatus.cs |
Adds join-request statuses. |
src/Generated/Models/JoinRequestProperties.cs |
Adds join-request properties. |
src/Generated/Models/GrantDetailProperties.cs |
Adds grant properties. |
src/Generated/Models/EducationGrantType.cs |
Adds grant types. |
src/Generated/Models/EducationGrantStatus.cs |
Adds grant statuses. |
src/Generated/Models/EducationAmount.cs |
Adds monetary model. |
src/Generated/Internal/CodeGenTypeAttribute.cs |
Adds generator customization attribute. |
src/Generated/Internal/CodeGenSuppressAttribute.cs |
Adds suppression attribute. |
src/Generated/Internal/CodeGenSerializationAttribute.cs |
Adds serialization attribute. |
src/Generated/Internal/CodeGenMemberAttribute.cs |
Adds member customization attribute. |
src/Generated/Internal/CodeGenEnumValueAttribute.cs |
Adds enum customization attribute. |
src/Generated/GrantDetails.cs |
Adds grant resource. |
src/Generated/EducationStudent.cs |
Adds student resource. |
src/Generated/EducationLab.cs |
Adds lab resource. |
src/Generated/EducationJoinRequest.cs |
Adds join-request resource. |
src/Azure.Provisioning.Education.csproj |
Defines the new package. |
README.md |
Documents installation and lab creation. |
metadata.json |
Records the supported API version. |
Directory.Build.props |
Configures package-wide build settings. |
CHANGELOG.md |
Records the initial preview. |
Azure.Provisioning.Education.slnx |
Includes source and test projects. |
api/Azure.Provisioning.Education.netstandard2.0.cs |
Records the netstandard API. |
api/Azure.Provisioning.Education.net8.0.cs |
Records the .NET 8 API. |
api/Azure.Provisioning.Education.net10.0.cs |
Records the .NET 10 API. |
| _name = DefineProperty<string>(nameof(Name), new string[] { "name" }, isRequired: true, defaultValue: "default"); | ||
| _systemData = DefineModelProperty<SystemData>(nameof(SystemData), new string[] { "systemData" }, isOutput: true); | ||
| _properties = DefineModelProperty<LabProperties>(nameof(Properties), new string[] { "properties" }); | ||
| _scope = DefineResource<ProvisionableResource>(nameof(Scope), new string[] { "scope" }); |
| _name = DefineProperty<string>(nameof(Name), new string[] { "name" }, isRequired: true); | ||
| _systemData = DefineModelProperty<SystemData>(nameof(SystemData), new string[] { "systemData" }, isOutput: true); | ||
| _properties = DefineModelProperty<StudentProperties>(nameof(Properties), new string[] { "properties" }); | ||
| _scope = DefineResource<ProvisionableResource>(nameof(Scope), new string[] { "scope" }); |
| EducationLab lab = | ||
| new(nameof(lab), EducationLab.ResourceVersions.V2021_12_01_PREVIEW) |
| await test.SetupLiveCalls(this) | ||
| .Lint() | ||
| .ValidateAsync(); |
| EducationLab lab = | ||
| new(nameof(lab), EducationLab.ResourceVersions.V2021_12_01_PREVIEW) |
| /// <summary> Grant details. </summary> | ||
| public partial class GrantDetails : ProvisionableResource |
| /// <summary> Join request status. </summary> | ||
| public enum JoinRequestStatus |
| /// <summary> The status of this lab. </summary> | ||
| public enum LabStatus |
| /// <summary> Student Role. </summary> | ||
| public enum StudentRole |
Provisioning schema extractor outputPackage: Schema extracted from generated and custom source# Provisioning Resource Schema
Package: `sdk/education/Azure.Provisioning.Education`
Source: `sdk/education/Azure.Provisioning.Education/src/Generated`
## EducationJoinRequest
- Resource type: `Microsoft.Education/labs/joinRequests`
- Default API version: `2021-12-01-preview`
- Source file: `src/Generated/EducationJoinRequest.cs`
| Property | Path | Kind | Type | Required | Settable | Default | Metadata |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `Id` | `id` | Property | `BicepValue<ResourceIdentifier>` | False | False | `` | False |
| `Name` | `name` | Property | `BicepValue<string>` | True | True | `` | False |
| `SystemData` | `systemData` | ModelProperty | `SystemData` | False | False | `` | False |
| `Properties` | `properties` | ModelProperty | `JoinRequestProperties` | False | False | `` | False |
| `Parent` | `parent` | Resource | `EducationLab` | True | True | `` | True |
## EducationLab
- Resource type: `Microsoft.Education/labs`
- Default API version: `2021-12-01-preview`
- Source file: `src/Generated/EducationLab.cs`
| Property | Path | Kind | Type | Required | Settable | Default | Metadata |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `Id` | `id` | Property | `BicepValue<ResourceIdentifier>` | False | False | `` | False |
| `Name` | `name` | Property | `BicepValue<string>` | True | False | `"default"` | False |
| `SystemData` | `systemData` | ModelProperty | `SystemData` | False | False | `` | False |
| `Properties` | `properties` | ModelProperty | `LabProperties` | False | False | `` | False |
| `Scope` | `scope` | Resource | `ProvisionableResource` | False | True | `` | True |
## EducationStudent
- Resource type: `Microsoft.Education/labs/students`
- Default API version: `2021-12-01-preview`
- Source file: `src/Generated/EducationStudent.cs`
| Property | Path | Kind | Type | Required | Settable | Default | Metadata |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `Id` | `id` | Property | `BicepValue<ResourceIdentifier>` | False | False | `` | False |
| `Name` | `name` | Property | `BicepValue<string>` | True | True | `` | False |
| `SystemData` | `systemData` | ModelProperty | `SystemData` | False | False | `` | False |
| `Properties` | `properties` | ModelProperty | `StudentProperties` | False | False | `` | False |
| `Scope` | `scope` | Resource | `ProvisionableResource` | False | True | `` | True |
## GrantDetails
- Resource type: `Microsoft.Education/grants`
- Default API version: `2021-12-01-preview`
- Source file: `src/Generated/GrantDetails.cs`
| Property | Path | Kind | Type | Required | Settable | Default | Metadata |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `Id` | `id` | Property | `BicepValue<ResourceIdentifier>` | False | False | `` | False |
| `Name` | `name` | Property | `BicepValue<string>` | True | False | `"default"` | False |
| `SystemData` | `systemData` | ModelProperty | `SystemData` | False | False | `` | False |
| `Properties` | `properties` | ModelProperty | `GrantDetailProperties` | False | False | `` | False |
## StudentLabDetails
- Resource type: `Microsoft.Education/studentLabs`
- Default API version: `2021-12-01-preview`
- Source file: `src/Generated/StudentLabDetails.cs`
| Property | Path | Kind | Type | Required | Settable | Default | Metadata |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `Id` | `id` | Property | `BicepValue<ResourceIdentifier>` | False | False | `` | False |
| `Name` | `name` | Property | `BicepValue<string>` | True | True | `` | False |
| `SystemData` | `systemData` | ModelProperty | `SystemData` | False | False | `` | False |
| `Properties` | `properties` | ModelProperty | `StudentLabProperties` | False | False | `` | False |
|
There was a problem hiding this comment.
Provisioning SDK Review Summary
- Scope:
sdk/education/Azure.Provisioning.Education/**(new package onboarding: generated resources, models, README, tests, metadata, CHANGELOG, CI/cspell config) - Classification: onboarding
- CI: pass (
net - pullrequestsucceeded on this head commit) - Schema and metadata correctness: fail — see findings below and the schema-extractor output posted separately
- Compatibility: not applicable (new package, no
ApiCompatBaseline.txt/BackwardCompatibleconcerns) - Tests/snippets/docs: fail — sample/tests inherit the same missing-scope issue as the resource model
Findings (blocking):
- [Docs]
tsp-location.yamlreferences an unmerged specification commit in a contributor's personal fork (cxznmhdcxz/azure-rest-api-specs) instead of the officialAzure/azure-rest-api-specs. Regenerating from a commit outside the canonical spec repo is fragile (no durable audit trail, fork can disappear/change) and should be updated once the linked spec PR (azure-rest-api-specs#46577) merges. - [Provisioning schema]
GrantDetails(Microsoft.Education/grants) defines noScope/Parentproperty at all, even though the spec examples place grants under a BillingbillingProfile(an extension-resource scope). Without scope metadata, generated Bicep for this resource cannot address the real service path.
A prior review (copilot-pull-request-reviewer[bot]) already flagged related scope issues on EducationLab, EducationStudent, BasicEducationTests.cs, BasicLiveEducationTests.cs, and README.md (missing required billing invoice-section scope), plus naming customizations for GrantDetails/JoinRequestStatus/LabStatus/StudentRole. Those findings are valid and should also be addressed; this review adds the two new findings above (unmerged fork spec reference, and GrantDetails missing scope entirely) that were not previously called out.
The full generated-resource schema inventory (property settability/required/default/metadata flags for all 5 resources) is posted in a separate comment for reviewer verification.
Analyzed by Azure .NET Provisioning SDK PR Review: https://github.com/Azure/azure-sdk-for-net/actions/runs/35702739646
| namespace Azure.Provisioning.Education | ||
| { | ||
| /// <summary> Grant details. </summary> | ||
| public partial class GrantDetails : ProvisionableResource |
There was a problem hiding this comment.
[Provisioning schema] GrantDetails (Microsoft.Education/grants) has no Scope or Parent property at all — unlike EducationLab and EducationStudent, which at least define an optional Scope. Per the spec examples, grants live under /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/{name}, i.e. this is a billing-scoped extension resource. Without a Scope/Parent metadata property, the emitted Bicep will declare GrantDetails at the deployment's default scope, which cannot address the real service path and will fail to deploy. Fix the TypeSpec/emitter mapping so this resource models the required billing scope, then regenerate.
| @@ -0,0 +1,6 @@ | |||
| directory: specification/education/resource-manager/Microsoft.Education/Education | |||
| commit: 4564b787ab7787add4900d2cd592cdea6ea39a11 | |||
| repo: cxznmhdcxz/azure-rest-api-specs | |||
There was a problem hiding this comment.
[Docs] repo: cxznmhdcxz/azure-rest-api-specs points the generator at an unmerged specification commit in a contributor's personal fork rather than the official Azure/azure-rest-api-specs repository. This is confirmed by the PR description itself ("reference the unmerged specification commit from the contributor fork"). Onboarding a new provisioning package against a fork/unmerged commit is fragile: the fork can be deleted or force-pushed, breaking future regeneration and leaving no audit trail back to an approved spec review. Update tsp-location.yaml to reference the merged commit in Azure/azure-rest-api-specs (spec PR #46577) once it lands, and regenerate from that commit before merging this SDK PR.



Summary
Related
Validation