Skip to content

Commit

Permalink
Tweak Bicep string name. (dotnet#3331)
Browse files Browse the repository at this point in the history
* Tweak Bicep string name.

* Fix up test.
  • Loading branch information
mitchdenny authored Apr 3, 2024
1 parent 44cb1b4 commit f077b95
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 107 deletions.
2 changes: 1 addition & 1 deletion playground/bicep/BicepSample.AppHost/aspire-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"test0": {
"type": "azure.bicep.v0",
"path": "test0.bicep"
"path": "test0.module.bicep"
},
"kv3": {
"type": "azure.bicep.v0",
Expand Down
12 changes: 6 additions & 6 deletions playground/cdk/CdkSample.AppHost/appConfig.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ param principalId string
param principalType string


resource appConfigurationStore_j2IqAZkBh 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
name: toLower(take(concat('appConfig', uniqueString(resourceGroup().id)), 24))
resource appConfigurationStore_xM7mBhesj 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
name: toLower(take('appConfig${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'appConfig'
Expand All @@ -23,14 +23,14 @@ resource appConfigurationStore_j2IqAZkBh 'Microsoft.AppConfiguration/configurati
}
}

resource roleAssignment_umUNaNdeG 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: appConfigurationStore_j2IqAZkBh
name: guid(appConfigurationStore_j2IqAZkBh.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b'))
resource roleAssignment_3uatMWw7h 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: appConfigurationStore_xM7mBhesj
name: guid(appConfigurationStore_xM7mBhesj.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b'))
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b')
principalId: principalId
principalType: principalType
}
}

output appConfigEndpoint string = appConfigurationStore_j2IqAZkBh.properties.endpoint
output appConfigEndpoint string = appConfigurationStore_xM7mBhesj.properties.endpoint
6 changes: 3 additions & 3 deletions playground/cdk/CdkSample.AppHost/appInsights.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ param kind string = 'web'
param logAnalyticsWorkspaceId string


resource applicationInsightsComponent_fo9MneV12 'Microsoft.Insights/components@2020-02-02' = {
name: toLower(take(concat('appInsights', uniqueString(resourceGroup().id)), 24))
resource applicationInsightsComponent_eYAu4rv7j 'Microsoft.Insights/components@2020-02-02' = {
name: toLower(take('appInsights${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'appInsights'
Expand All @@ -27,4 +27,4 @@ resource applicationInsightsComponent_fo9MneV12 'Microsoft.Insights/components@2
}
}

output appInsightsConnectionString string = applicationInsightsComponent_fo9MneV12.properties.ConnectionString
output appInsightsConnectionString string = applicationInsightsComponent_eYAu4rv7j.properties.ConnectionString
6 changes: 3 additions & 3 deletions playground/cdk/CdkSample.AppHost/cache.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ resource keyVault_IeF8jZvXV 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
name: keyVaultName
}

resource redisCache_p9fE6TK3F 'Microsoft.Cache/Redis@2020-06-01' = {
name: toLower(take(concat('cache', uniqueString(resourceGroup().id)), 24))
resource redisCache_enclX3umP 'Microsoft.Cache/Redis@2020-06-01' = {
name: toLower(take('cache${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'cache'
Expand All @@ -33,6 +33,6 @@ resource keyVaultSecret_Ddsc3HjrA 'Microsoft.KeyVault/vaults/secrets@2022-07-01'
name: 'connectionString'
location: location
properties: {
value: '${redisCache_p9fE6TK3F.properties.hostName},ssl=true,password=${redisCache_p9fE6TK3F.listKeys(redisCache_p9fE6TK3F.apiVersion).primaryKey}'
value: '${redisCache_enclX3umP.properties.hostName},ssl=true,password=${redisCache_enclX3umP.listKeys(redisCache_enclX3umP.apiVersion).primaryKey}'
}
}
10 changes: 5 additions & 5 deletions playground/cdk/CdkSample.AppHost/cosmos.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ resource keyVault_IeF8jZvXV 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
name: keyVaultName
}

resource cosmosDBAccount_5pKmb8KAZ 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {
name: toLower(take(concat('cosmos', uniqueString(resourceGroup().id)), 24))
resource cosmosDBAccount_MZyw35gqp 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {
name: toLower(take('cosmos${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'cosmos'
Expand All @@ -32,8 +32,8 @@ resource cosmosDBAccount_5pKmb8KAZ 'Microsoft.DocumentDB/databaseAccounts@2023-0
}
}

resource cosmosDBSqlDatabase_q2Ny71tR3 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2023-04-15' = {
parent: cosmosDBAccount_5pKmb8KAZ
resource cosmosDBSqlDatabase_mHA5VB7LB 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2023-04-15' = {
parent: cosmosDBAccount_MZyw35gqp
name: 'cosmosdb'
location: location
properties: {
Expand All @@ -48,6 +48,6 @@ resource keyVaultSecret_Ddsc3HjrA 'Microsoft.KeyVault/vaults/secrets@2022-07-01'
name: 'connectionString'
location: location
properties: {
value: 'AccountEndpoint=${cosmosDBAccount_5pKmb8KAZ.properties.documentEndpoint};AccountKey=${cosmosDBAccount_5pKmb8KAZ.listkeys(cosmosDBAccount_5pKmb8KAZ.apiVersion).primaryMasterKey}'
value: 'AccountEndpoint=${cosmosDBAccount_MZyw35gqp.properties.documentEndpoint};AccountKey=${cosmosDBAccount_MZyw35gqp.listkeys(cosmosDBAccount_MZyw35gqp.apiVersion).primaryMasterKey}'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ targetScope = 'resourceGroup'
param location string = resourceGroup().location


resource operationalInsightsWorkspace_uzGUFQdnZ 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: toLower(take(concat('logAnalyticsWorkspace', uniqueString(resourceGroup().id)), 24))
resource operationalInsightsWorkspace_DuWNVIPPL 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: toLower(take('logAnalyticsWorkspace${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'logAnalyticsWorkspace'
Expand All @@ -17,4 +17,4 @@ resource operationalInsightsWorkspace_uzGUFQdnZ 'Microsoft.OperationalInsights/w
}
}

output logAnalyticsWorkspaceId string = operationalInsightsWorkspace_uzGUFQdnZ.id
output logAnalyticsWorkspaceId string = operationalInsightsWorkspace_DuWNVIPPL.id
18 changes: 9 additions & 9 deletions playground/cdk/CdkSample.AppHost/mykv.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,39 @@ param principalType string
param signaturesecret string


resource keyVault_IKWI2x0B5 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: toLower(take(concat('mykv', uniqueString(resourceGroup().id)), 24))
resource keyVault_aMZbuK3Sy 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: toLower(take('mykv${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'mykv'
}
properties: {
tenantId: tenant().tenantId
sku: {
name: 'standard'
family: 'A'
name: 'standard'
}
enableRbacAuthorization: true
}
}

resource roleAssignment_Z4xb36awa 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: keyVault_IKWI2x0B5
name: guid(keyVault_IKWI2x0B5.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483'))
resource roleAssignment_hVU9zjQV1 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: keyVault_aMZbuK3Sy
name: guid(keyVault_aMZbuK3Sy.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483'))
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '00482a5a-887f-4fb3-b363-3b7fe8e74483')
principalId: principalId
principalType: principalType
}
}

resource keyVaultSecret_7ClrhkRcM 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = {
parent: keyVault_IKWI2x0B5
resource keyVaultSecret_mW5tlkNij 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = {
parent: keyVault_aMZbuK3Sy
name: 'mysecret'
location: location
properties: {
value: signaturesecret
}
}

output vaultUri string = keyVault_IKWI2x0B5.properties.vaultUri
output vaultUri string = keyVault_aMZbuK3Sy.properties.vaultUri
14 changes: 7 additions & 7 deletions playground/cdk/CdkSample.AppHost/pgsql.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource keyVault_IeF8jZvXV 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
name: keyVaultName
}

resource postgreSqlFlexibleServer_UTKFzAL0U 'Microsoft.DBforPostgreSQL/flexibleServers@2023-03-01-preview' = {
name: toLower(take(concat('pgsql', uniqueString(resourceGroup().id)), 24))
resource postgreSqlFlexibleServer_NCqzKcjXq 'Microsoft.DBforPostgreSQL/flexibleServers@2023-03-01-preview' = {
name: toLower(take('pgsql${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'pgsql'
Expand All @@ -46,17 +46,17 @@ resource postgreSqlFlexibleServer_UTKFzAL0U 'Microsoft.DBforPostgreSQL/flexibleS
}
}

resource postgreSqlFirewallRule_TT2MuwakC 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_UTKFzAL0U
resource postgreSqlFirewallRule_dtlIpxH5J 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_NCqzKcjXq
name: 'AllowAllAzureIps'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '0.0.0.0'
}
}

resource postgreSqlFlexibleServerDatabase_MVhrhEeMJ 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_UTKFzAL0U
resource postgreSqlFlexibleServerDatabase_cJDk3wYkh 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_NCqzKcjXq
name: 'pgsqldb'
properties: {
}
Expand All @@ -67,6 +67,6 @@ resource keyVaultSecret_Ddsc3HjrA 'Microsoft.KeyVault/vaults/secrets@2022-07-01'
name: 'connectionString'
location: location
properties: {
value: 'Host=${postgreSqlFlexibleServer_UTKFzAL0U.properties.fullyQualifiedDomainName};Username=${administratorLogin};Password=${administratorLoginPassword}'
value: 'Host=${postgreSqlFlexibleServer_NCqzKcjXq.properties.fullyQualifiedDomainName};Username=${administratorLogin};Password=${administratorLoginPassword}'
}
}
10 changes: 5 additions & 5 deletions playground/cdk/CdkSample.AppHost/pgsql2.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ resource keyVault_IeF8jZvXV 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
name: keyVaultName
}

resource postgreSqlFlexibleServer_L4yCjMLWz 'Microsoft.DBforPostgreSQL/flexibleServers@2023-03-01-preview' = {
name: toLower(take(concat('pgsql2', uniqueString(resourceGroup().id)), 24))
resource postgreSqlFlexibleServer_v9qSHyzIy 'Microsoft.DBforPostgreSQL/flexibleServers@2023-03-01-preview' = {
name: toLower(take('pgsql2${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'pgsql2'
Expand All @@ -46,8 +46,8 @@ resource postgreSqlFlexibleServer_L4yCjMLWz 'Microsoft.DBforPostgreSQL/flexibleS
}
}

resource postgreSqlFirewallRule_b2WDQTOKx 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_L4yCjMLWz
resource postgreSqlFirewallRule_Go8Dbe3VJ 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2023-03-01-preview' = {
parent: postgreSqlFlexibleServer_v9qSHyzIy
name: 'AllowAllAzureIps'
properties: {
startIpAddress: '0.0.0.0'
Expand All @@ -60,6 +60,6 @@ resource keyVaultSecret_Ddsc3HjrA 'Microsoft.KeyVault/vaults/secrets@2022-07-01'
name: 'connectionString'
location: location
properties: {
value: 'Host=${postgreSqlFlexibleServer_L4yCjMLWz.properties.fullyQualifiedDomainName};Username=${administratorLogin};Password=${administratorLoginPassword}'
value: 'Host=${postgreSqlFlexibleServer_v9qSHyzIy.properties.fullyQualifiedDomainName};Username=${administratorLogin};Password=${administratorLoginPassword}'
}
}
18 changes: 9 additions & 9 deletions playground/cdk/CdkSample.AppHost/search.module.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ param principalId string
param principalType string


resource searchService_7WkaGluF0 'Microsoft.Search/searchServices@2023-11-01' = {
name: toLower(take(concat('search', uniqueString(resourceGroup().id)), 24))
resource searchService_j3umigYGT 'Microsoft.Search/searchServices@2023-11-01' = {
name: toLower(take('search${uniqueString(resourceGroup().id)}', 24))
location: location
tags: {
'aspire-resource-name': 'search'
Expand All @@ -27,24 +27,24 @@ resource searchService_7WkaGluF0 'Microsoft.Search/searchServices@2023-11-01' =
}
}

resource roleAssignment_7uytIREoa 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: searchService_7WkaGluF0
name: guid(searchService_7WkaGluF0.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7'))
resource roleAssignment_f77ijNEYF 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: searchService_j3umigYGT
name: guid(searchService_j3umigYGT.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7'))
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7')
principalId: principalId
principalType: principalType
}
}

resource roleAssignment_QpFzCj55x 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: searchService_7WkaGluF0
name: guid(searchService_7WkaGluF0.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0'))
resource roleAssignment_s0J7B4aGN 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
scope: searchService_j3umigYGT
name: guid(searchService_j3umigYGT.id, principalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0'))
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0')
principalId: principalId
principalType: principalType
}
}

output connectionString string = 'Endpoint=https://${searchService_7WkaGluF0.name}.search.windows.net'
output connectionString string = 'Endpoint=https://${searchService_j3umigYGT.name}.search.windows.net'
Loading

0 comments on commit f077b95

Please sign in to comment.