Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -235,55 +235,4 @@ properties:
allowPrerelease: true
description: Install Azure Storage Emulator for local development
settings:
id: Microsoft.Azure.StorageEmulator

# Resource: Azure Cosmos DB Emulator
# Azure Cosmos DB Emulator provides a local instance of the Cosmos DB service
# supporting multiple data models (SQL, MongoDB, Gremlin, etc.).
#
# Key Azure integration points:
# - Support for SQL, MongoDB, Table, Gremlin, and Cassandra APIs
# - Local development of multi-region applications
# - Built-in data explorer for query development
# - Export functionality for data migration
# - Simulated consistency levels matching Azure Cosmos DB
#
# Development best practices:
# - Use consistent connection logic between emulator and cloud
# - Test with various consistency levels before deployment
# - Simulate production request patterns for performance testing
# - Create parameterized applications that work with both environments
# - Ensure partition key strategies are validated locally
# - Use environment-specific configuration for connection strings
# - Implement retry logic that works in both environments
# - Consider resource limits differences between emulator and cloud
# - Validate performance with realistic data volumes
#
# Common development scenarios:
# - NoSQL database application development
# - Graph database implementations with Gremlin API
# - High-performance, globally distributed application prototyping
# - Schema evolution and migration testing
# - Multi-model database application development
#
# Security note:
# - The emulator uses a well-known certificate and key for development
# - Never use the emulator's certificate in production environments
# - Data persistence is local and requires backup consideration
# - Consider implementing application-level encryption for sensitive data
# - Be aware of differences in security features between emulator and cloud
#
# DSC-specific notes:
# - Installation requires significant disk space (~2GB)
# - May conflict with other applications using port 8081
# - Consider configuring the emulator to start automatically
# - Installation may require system restart
#
# Reference: https://learn.microsoft.com/en-us/azure/cosmos-db/local-emulator
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: Microsoft.Azure.CosmosEmulator
directives:
allowPrerelease: true
description: Install Azure Cosmos DB Emulator for local NoSQL database development
settings:
id: Microsoft.Azure.CosmosEmulator
id: Microsoft.Azure.StorageEmulator
2 changes: 1 addition & 1 deletion cleanSetUp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$EnvName = "demo",
[string]$EnvName = "gitHub",

[Parameter(Mandatory=$false)]
[ValidateSet("eastus", "eastus2", "westus", "westus2", "northeurope", "westeurope")]
Expand Down
6 changes: 3 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ output WORKLOAD_AZURE_RESOURCE_GROUP_NAME string = workloadRg.name
// Module deployments with improved names and organization
@description('Log Analytics Workspace for centralized monitoring')
module monitoring '../src/management/logAnalytics.bicep' = {
name: 'monitoring-logAnalytics-deployment-${environmentName}-${dateTime}'
name: 'monitoring-logAnalytics-${environmentName}-${dateTime}'
scope: resourceGroup(monitoringRgName)
params: {
name: 'logAnalytics'
Expand All @@ -114,7 +114,7 @@ output AZURE_LOG_ANALYTICS_WORKSPACE_NAME string = monitoring.outputs.AZURE_LOG_

@description('Security components including Key Vault')
module security '../src/security/security.bicep' = {
name: 'security-keyvault-deployment-${environmentName}-${dateTime}'
name: 'security-keyvault-${environmentName}-${dateTime}'
scope: resourceGroup(securityRgName)
params: {
secretValue: secretValue
Expand All @@ -137,7 +137,7 @@ output AZURE_KEY_VAULT_ENDPOINT string = security.outputs.AZURE_KEY_VAULT_ENDPOI

@description('DevCenter workload deployment')
module workload '../src/workload/workload.bicep' = {
name: 'workload-devcenter-deployment-${environmentName}-${dateTime}'
name: 'workload-${environmentName}-${dateTime}'
scope: resourceGroup(workloadRgName)
params: {
logAnalyticsId: monitoring.outputs.AZURE_LOG_ANALYTICS_WORKSPACE_ID
Expand Down
4 changes: 4 additions & 0 deletions src/security/security.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ param logAnalyticsId string
@description('Azure Key Vault Configuration')
var securitySettings = loadYamlContent('../../infra/settings/security/security.yaml')

param dateTime string = utcNow('yyyyMMdd-HHmmss')

@description('Azure Key Vault')
module keyVault 'keyVault.bicep' = if (securitySettings.create) {
name: 'keyVault-${securitySettings.keyVault.name}-${dateTime}'
params: {
tags: tags
keyvaultSettings: securitySettings
Expand All @@ -27,6 +30,7 @@ resource existingKeyVault 'Microsoft.KeyVault/vaults@2023-07-01' existing = if (

@description('Key vault secret module')
module secret 'secret.bicep' = {
name: 'keyVaultSecret-${securitySettings.keyVault.secretName}-${dateTime}'
params: {
name: securitySettings.keyVault.secretName
keyVaultName: (securitySettings.create ? keyVault!.outputs.AZURE_KEY_VAULT_NAME : existingKeyVault!.name)
Expand Down
13 changes: 7 additions & 6 deletions src/workload/core/devCenter.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ param secretIdentifier string

param securityResourceGroupName string

param dateTime string = utcNow('yyyyMMdd-HHmmss')

// Type definitions with proper naming conventions
@description('DevCenter configuration type')
type DevCenterConfig = {
Expand Down Expand Up @@ -122,7 +124,7 @@ resource diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-pr
@description('Dev Center Identity Role Assignments')
module devCenterIdentityRoleAssignment '../../identity/devCenterRoleAssignment.bicep' = [
for (role, i) in config.identity.roleAssignments.devCenter: {
name: 'RBACDevCenterSub-${i}-${devCenterName}'
name: 'RBACDevCenterSub-${i}-${devCenterName}-${dateTime}'
scope: subscription()
params: {
id: role.id
Expand All @@ -135,7 +137,7 @@ module devCenterIdentityRoleAssignment '../../identity/devCenterRoleAssignment.b
@description('Dev Center Identity Role Assignments')
module devCenterIdentityRoleAssignmentRG '../../identity/devCenterRoleAssignmentRG.bicep' = [
for (role, i) in config.identity.roleAssignments.devCenter: {
name: 'RBACDevCenterRG-${i}-${devCenterName}'
name: 'RBACDevCenterRG-${i}-${devCenterName}-${dateTime}'
scope: resourceGroup(securityResourceGroupName)
params: {
id: role.id
Expand All @@ -151,7 +153,7 @@ module devCenterIdentityRoleAssignmentRG '../../identity/devCenterRoleAssignment
@description('Dev Center Identity User Groups role assignments')
module devCenterIdentityUserGroupsRoleAssignment '../../identity/orgRoleAssignment.bicep' = [
for (role, i) in config.identity.roleAssignments.orgRoleTypes: {
name: 'RBACUserGroup-${i}-${devCenterName}'
name: 'RBACUserGroup-${i}-${devCenterName}-${dateTime}'
scope: resourceGroup()
params: {
principalId: role.azureADGroupId
Expand All @@ -167,7 +169,7 @@ module devCenterIdentityUserGroupsRoleAssignment '../../identity/orgRoleAssignme
@description('Dev Center Catalogs')
module catalog 'catalog.bicep' = [
for (catalog, i) in catalogs: {
name: 'catalog-${i}-${devCenterName}'
name: 'catalog-${i}-${devCenterName}-${dateTime}'
scope: resourceGroup()
params: {
devCenterName: devCenterName
Expand All @@ -185,12 +187,11 @@ module catalog 'catalog.bicep' = [
@description('Dev Center Environments')
module environment 'environmentType.bicep' = [
for (environment, i) in environmentTypes: {
name: 'environmentType-${i}-${devCenterName}'
name: 'environmentType-${i}-${devCenterName}-${dateTime}'
scope: resourceGroup()
params: {
devCenterName: devCenterName
environmentConfig: environment
}
}
]

16 changes: 9 additions & 7 deletions src/workload/project/project.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ param identity Identity
@description('Tags to be applied to all resources')
param tags object = {}

param dateTime string = utcNow('yyyyMMdd-HHmmss')

@description('Identity configuration for the project')
type Identity = {
@description('Type of managed identity (SystemAssigned or UserAssigned)')
Expand Down Expand Up @@ -98,7 +100,7 @@ resource project 'Microsoft.DevCenter/projects@2025-04-01-preview' = {
@description('Configure project identity role assignments')
module projectIdentity '../../identity/projectIdentityRoleAssignment.bicep' = [
for (role, i) in identity.roleAssignments: {
name: 'prj-rbac${i}-${uniqueString(project.id, project.name)}'
name: 'prj-rbac${i}-${uniqueString(project.id, project.name)}-${dateTime}'
scope: resourceGroup()
params: {
projectName: project.name
Expand All @@ -112,7 +114,7 @@ module projectIdentity '../../identity/projectIdentityRoleAssignment.bicep' = [
@description('Configure project identity role assignments')
module projectIdentityRG '../../identity/projectIdentityRoleAssignmentRG.bicep' = [
for (role, i) in identity.roleAssignments: {
name: 'prj-rbac-RG-${i}-${uniqueString(project.id, project.name)}'
name: 'prj-rbac-RG-${i}-${uniqueString(project.id, project.name)}-${dateTime}'
scope: resourceGroup(securityResourceGroupName)
params: {
projectName: project.name
Expand All @@ -126,7 +128,7 @@ module projectIdentityRG '../../identity/projectIdentityRoleAssignmentRG.bicep'
@description('Add the AD Group to the DevCenter project')
module projectADGroup '../../identity/projectIdentityRoleAssignment.bicep' = [
for (role, i) in identity.roleAssignments: {
name: 'prj-adgroup-${i}-${uniqueString(project.id, project.name)}'
name: 'prj-adgroup-${i}-${uniqueString(project.id, project.name)}-${dateTime}'
scope: resourceGroup()
params: {
projectName: project.name
Expand All @@ -139,7 +141,7 @@ module projectADGroup '../../identity/projectIdentityRoleAssignment.bicep' = [

@description('Configure environment definition catalogs')
module catalogs 'projectCatalog.bicep' = {
name: 'catalog-${uniqueString(project.id)}'
name: 'catalog-${uniqueString(project.id)}-${dateTime}'
scope: resourceGroup()
params: {
projectName: project.name
Expand All @@ -156,7 +158,7 @@ module catalogs 'projectCatalog.bicep' = {
@description('Configure project environment types')
module environmentTypes 'projectEnvironmentType.bicep' = [
for (envType, i) in projectEnvironmentTypes: {
name: 'env-type-${i}-${uniqueString(project.id, envType.name)}'
name: 'env-type-${i}-${uniqueString(project.id, envType.name)}-${dateTime}'
scope: resourceGroup()
params: {
projectName: project.name
Expand All @@ -173,7 +175,7 @@ module environmentTypes 'projectEnvironmentType.bicep' = [

@description('Connectivity configuration for the project')
module connectivity '../../connectivity/connectivity.bicep' = {
name: 'connectivity-${uniqueString(project.id)}'
name: 'connectivity-${uniqueString(project.id)}-${dateTime}'
scope: resourceGroup()
params: {
devCenterName: devCenterName
Expand All @@ -192,7 +194,7 @@ module connectivity '../../connectivity/connectivity.bicep' = {
@description('Configure DevBox pools for the project')
module pools 'projectPool.bicep' = [
for (pool, i) in projectPools: {
name: 'pool-${i}-${uniqueString(project.id, pool.name)}'
name: 'pool-${i}-${uniqueString(project.id, pool.name)}-${dateTime}'
scope: resourceGroup()
params: {
name: pool.name
Expand Down
6 changes: 4 additions & 2 deletions src/workload/workload.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ param secretIdentifier string
@minLength(3)
param securityResourceGroupName string

param dateTime string = utcNow('yyyyMMdd-HHmmss')

// Resource types with documentation
@description('Landing Zone configuration type')
type LandingZone = {
Expand All @@ -32,7 +34,7 @@ var devCenterSettings = loadYamlContent('../../infra/settings/workload/devcenter
// Deploy core DevCenter infrastructure
@description('DevCenter Core Infrastructure')
module devcenter 'core/devCenter.bicep' = {
name: 'devCenterDeployment'
name: 'devCenter-${dateTime}'
scope: resourceGroup()
params: {
config: devCenterSettings
Expand All @@ -51,7 +53,7 @@ output AZURE_DEV_CENTER_NAME string = devcenter.outputs.AZURE_DEV_CENTER_NAME
@description('DevCenter Projects')
module projects 'project/project.bicep' = [
for (project, i) in devCenterSettings.projects: {
name: 'project-${project.name}'
name: 'project-${project.name}-${dateTime}'
scope: resourceGroup()
params: {
name: project.name
Expand Down
Loading