|
4 | 4 |
|
5 | 5 | This document summarizes the updates made to the Azure DevCenter module to implement the 2025-04-01-preview API version and fix the identity block placement. |
6 | 6 |
|
7 | | -## Latest Changes (July 28, 2025) |
| 7 | +## Latest Changes (August 14, 2025) |
| 8 | + |
| 9 | +### Dev Center Project Environment Type Module - API Schema Compliance Fix |
| 10 | + |
| 11 | +- **Fixed**: Resolved Azure API schema validation errors in dev_center_project_environment_type module for userRoleAssignments |
| 12 | +- **Classification**: Bug fix |
| 13 | +- **Breaking Change**: YES - User role assignments schema changed to match Azure API requirements |
| 14 | +- **Issue**: userRoleAssignments.roles was defined as list(string) but Azure API expects map(object({})) |
| 15 | +- **Root Cause**: Mismatch between Terraform variable schema and Azure DevCenter REST API schema |
| 16 | +- **Azure API Requirement**: |
| 17 | + - userRoleAssignments keys must be user object IDs (GUIDs), not email addresses |
| 18 | + - roles property must be a map where keys are role definition IDs (GUIDs) and values are objects |
| 19 | +- **Solution Applied**: |
| 20 | + - Updated module variable schema: `roles = list(string)` → `roles = map(object({}))` |
| 21 | + - Updated root variable schema in `variables.tf` to match module requirements |
| 22 | + - Updated all example configurations to use correct API format |
| 23 | + - Updated test files to use proper schema structure |
| 24 | + - Enhanced README documentation with Azure CLI commands to find required IDs |
| 25 | +- **Files Modified**: |
| 26 | + - `modules/dev_center_project_environment_type/variables.tf`: Fixed roles type definition |
| 27 | + - `modules/dev_center_project_environment_type/README.md`: Added comprehensive documentation for finding user object IDs and role definition IDs |
| 28 | + - `variables.tf`: Updated root variable definition to match module schema |
| 29 | + - `tests/unit/dev_center_project_environment_type/project_environment_type_test.tftest.hcl`: Updated test to use correct schema |
| 30 | + - `examples/dev_center_project_environment_type/enhanced_case/configuration.tfvars`: Updated all user role assignments to use object IDs and role definition IDs |
| 31 | +- **Migration Required**: |
| 32 | + - Users must update configurations to use Azure AD user object IDs instead of email addresses |
| 33 | + - Users must use role definition IDs (GUIDs) instead of role names |
| 34 | + - Use `az ad user show --id user@domain.com --query id -o tsv` to get user object IDs |
| 35 | + - Use `az role definition list --name "Role Name" --query '[].id' -o tsv` to get role definition IDs |
| 36 | +- **Validation**: All unit and integration tests pass (43 total test cases) |
| 37 | +- **API Reference**: Based on Azure DevCenter REST API documentation (2025-04-01-preview) |
| 38 | + |
| 39 | +### Dev Center Project Environment Type Module - Critical Fix Applied |
| 40 | + |
| 41 | +- **Fixed**: Resolved API validation errors in dev_center_project_environment_type module |
| 42 | +- **Classification**: Bug fix |
| 43 | +- **Breaking Change**: NO - Module interface updated but functionality preserved |
| 44 | +- **Issue**: DeploymentTargetId was incorrectly using full environment type resource ID instead of subscription ID |
| 45 | +- **Root Cause**: Azure DevCenter API requires deploymentTargetId to be subscription ID format `/subscriptions/{guid}`, not full resource ID |
| 46 | +- **Solution Applied**: |
| 47 | + - Updated `deploymentTargetId` to use subscription ID: `/subscriptions/${data.azapi_client_config.current.subscription_id}` |
| 48 | + - Fixed environment type name matching to use actual created environment type names |
| 49 | + - Removed unnecessary azurecaf_name resource for project environment types |
| 50 | + - Updated module to reference environment type names from parent Dev Center |
| 51 | +- **Files Modified**: |
| 52 | + - `modules/dev_center_project_environment_type/module.tf`: Fixed deploymentTargetId and name logic |
| 53 | + - `modules/dev_center_project_environment_type/variables.tf`: Added environment_type_name variable, updated validation |
| 54 | + - `modules/dev_center_project_environment_type/output.tf`: Updated deployment_target_id output description |
| 55 | + - `modules/dev_center_project_environment_type/README.md`: Updated usage examples and documentation |
| 56 | + - `dev_center_project_environment_types.tf`: Updated module call to pass environment_type_name |
| 57 | +- **Validation**: Successfully applied simple case configuration with both development and staging project environment types |
| 58 | +- **API Reference**: Based on official Azure DevCenter REST API documentation (2025-04-01-preview) |
| 59 | +- **Resources Created**: |
| 60 | + - `/subscriptions/.../projects/.../environmentTypes/demo-dcet-development-qgi` (Enabled) |
| 61 | + - `/subscriptions/.../projects/.../environmentTypes/demo-dcet-staging-iuo` (Enabled) |
| 62 | + |
| 63 | +### Dev Center Project Environment Type Module - New Implementation |
| 64 | + |
| 65 | +- **Added**: New `dev_center_project_environment_type` module for associating environment types with Dev Center projects |
| 66 | +- **Classification**: Feature |
| 67 | +- **Breaking Change**: NO - This is a new module that doesn't affect existing functionality |
| 68 | +- **Files Added**: |
| 69 | + - `modules/dev_center_project_environment_type/module.tf`: Main module implementation using azapi provider |
| 70 | + - `modules/dev_center_project_environment_type/variables.tf`: Strong typing with comprehensive validation |
| 71 | + - `modules/dev_center_project_environment_type/output.tf`: Output definitions for project environment type properties |
| 72 | + - `modules/dev_center_project_environment_type/README.md`: Complete documentation with usage examples |
| 73 | + - `dev_center_project_environment_types.tf`: Root orchestration file |
| 74 | + - `variables.tf`: Added new variable definition with validation rules |
| 75 | + - `examples/dev_center_project_environment_type/simple_case/configuration.tfvars`: Basic example |
| 76 | + - `examples/dev_center_project_environment_type/enhanced_case/configuration.tfvars`: Advanced example with user role assignments |
| 77 | + - `tests/unit/dev_center_project_environment_type/project_environment_type_test.tftest.hcl`: Unit tests with provider mocking |
| 78 | +- **Files Modified**: |
| 79 | + - `tests/integration/dev_center_integration_test.tftest.hcl`: Added project environment type integration test |
| 80 | + - `.vscode/tasks.json`: Added new example options for VS Code development workflow |
| 81 | + - `docs/file_structure.md`: Updated with new module and example locations |
| 82 | + - `docs/module_guide.md`: Enhanced with comprehensive usage patterns and configuration options |
| 83 | +- **Features**: |
| 84 | + - Associates environment types with Dev Center projects using Azure DevCenter 2025-04-01-preview API |
| 85 | + - Configurable status (Enabled/Disabled) for project environment types |
| 86 | + - User role assignments for granular access control |
| 87 | + - Comprehensive validation for all input variables |
| 88 | + - Full test coverage with both unit and integration tests |
| 89 | + - Complete documentation and examples |
| 90 | + |
| 91 | +## Previous Changes (July 28, 2025) |
8 | 92 |
|
9 | 93 | ### Dev Center Network Connection Module - AzAPI Migration |
10 | 94 | - **Updated**: Migrated `dev_center_network_connection` module from azurerm to azapi provider |
|
0 commit comments