Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Modules] Updated dependency references to not pass a resource ID unless required #2275

Merged
merged 8 commits into from
Nov 17, 2022
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 @@ -308,8 +308,11 @@ output managedIdentityResourceId string = managedIdentity.id
@description('The resource ID of the created Load Balancer Backend Pool.')
output loadBalancerBackendPoolResourceId string = loadBalancer.properties.backendAddressPools[0].id

@description('The resource ID of the created Recovery Services Vault.')
output recoveryServicesVaultResourceId string = recoveryServicesVault.id
@description('The name of the created Recovery Services Vault.')
output recoveryServicesVaultName string = recoveryServicesVault.name

@description('The name of the Resource Group, the Recovery Services Vault was created in.')
output recoveryServicesVaultResourceGroupName string = resourceGroup().name

@description('The name of the Backup Policy created in the Backup Recovery Vault.')
output recoveryServicesVaultBackupPolicyName string = backupPolicyName
Expand All @@ -329,6 +332,9 @@ output storageAccountResourceId string = storageAccount.id
@description('The URL of the Custom Script Extension in the created Storage Account')
output storageAccountCSEFileUrl string = '${storageAccount.properties.primaryEndpoints.blob}${storageContainerName}/${storageAccountCSEFileName}'

@description('The name of the Custom Script Extension in the created Storage Account')
output storageAccountCSEFileName string = storageAccountCSEFileName

@description('The resource ID of the created SSH Key')
output SSHKeyResourceID string = sshKey.id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ module testDeployment '../../deploy.bicep' = {
vmSize: 'Standard_B12ms'
availabilityZone: 1
backupPolicyName: resourceGroupResources.outputs.recoveryServicesVaultBackupPolicyName
backupVaultName: last(split(resourceGroupResources.outputs.recoveryServicesVaultResourceId, '/'))
backupVaultResourceGroup: (split(resourceGroupResources.outputs.recoveryServicesVaultResourceId, '/'))[4]
backupVaultName: resourceGroupResources.outputs.recoveryServicesVaultName
backupVaultResourceGroup: resourceGroupResources.outputs.recoveryServicesVaultResourceGroupName
dataDisks: [
{
caching: 'ReadWrite'
Expand Down Expand Up @@ -171,7 +171,7 @@ module testDeployment '../../deploy.bicep' = {
]
}
extensionCustomScriptProtectedSetting: {
commandToExecute: 'value=$(./${last(split(resourceGroupResources.outputs.storageAccountCSEFileUrl, '/'))}); echo "$value"'
commandToExecute: 'value=$(./${resourceGroupResources.outputs.storageAccountCSEFileName}); echo "$value"'
}
extensionDependencyAgentConfig: {
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,11 @@ output managedIdentityResourceId string = managedIdentity.id
@description('The resource ID of the created Load Balancer Backend Pool.')
output loadBalancerBackendPoolResourceId string = loadBalancer.properties.backendAddressPools[0].id

@description('The resource ID of the created Recovery Services Vault.')
output recoveryServicesVaultResourceId string = recoveryServicesVault.id
@description('The name of the created Recovery Services Vault.')
output recoveryServicesVaultName string = recoveryServicesVault.name

@description('The name of the Resource Group, the Recovery Services Vault was created in.')
output recoveryServicesVaultResourceGroupName string = resourceGroup().name

@description('The name of the Backup Policy created in the Backup Recovery Vault.')
output recoveryServicesVaultBackupPolicyName string = backupPolicyName
Expand All @@ -299,6 +302,9 @@ output keyVaultEncryptionKeyUrl string = keyVault::key.properties.keyUriWithVers
@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id

@description('The name of the Custom Script Extension in the created Storage Account')
output storageAccountCSEFileName string = storageAccountCSEFileName

@description('The URL of the Custom Script Extension in the created Storage Account')
output storageAccountCSEFileUrl string = '${storageAccount.properties.primaryEndpoints.blob}${storageContainerName}/${storageAccountCSEFileName}'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ module testDeployment '../../deploy.bicep' = {
adminPassword: password
availabilityZone: 2
backupPolicyName: resourceGroupResources.outputs.recoveryServicesVaultBackupPolicyName
backupVaultName: last(split(resourceGroupResources.outputs.recoveryServicesVaultResourceId, '/'))
backupVaultResourceGroup: (split(resourceGroupResources.outputs.recoveryServicesVaultResourceId, '/'))[4]
backupVaultName: resourceGroupResources.outputs.recoveryServicesVaultName
backupVaultResourceGroup: resourceGroupResources.outputs.recoveryServicesVaultResourceGroupName
dataDisks: [
{
caching: 'None'
Expand Down Expand Up @@ -187,7 +187,7 @@ module testDeployment '../../deploy.bicep' = {
]
}
extensionCustomScriptProtectedSetting: {
commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command "& ./${last(split(resourceGroupResources.outputs.storageAccountCSEFileUrl, '/'))}"'
commandToExecute: 'powershell -ExecutionPolicy Unrestricted -Command "& ./${resourceGroupResources.outputs.storageAccountCSEFileName}"'
}
extensionDependencyAgentConfig: {
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ resource backupVault 'Microsoft.DataProtection/backupVaults@2022-03-01' = {
name: name
location: location
tags: tags
identity: any(identity)
identity: identity
properties: {
storageSettings: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2021-07-12' = {
@description('The principal ID of the created Managed Identity.')
output managedIdentityPrincipalId string = managedIdentity.properties.principalId

@description('The resource ID of the created Host Pool.')
output hostPoolResourceId string = hostPool.id
@description('The name of the created Host Pool.')
output hostPoolName string = hostPool.name
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module testDeployment '../../deploy.bicep' = {
params: {
name: '<<namePrefix>>${serviceShort}001'
applicationGroupType: 'RemoteApp'
hostpoolName: last(split(resourceGroupResources.outputs.hostPoolResourceId, '/'))
hostpoolName: resourceGroupResources.outputs.hostPoolName
applications: [
{
commandLineArguments: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2021-07-12' = {
}
}

@description('The resource ID of the created Host Pool.')
output hostPoolResourceId string = hostPool.id
@description('The name of the created Host Pool.')
output hostPoolName string = hostPool.name
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ module testDeployment '../../deploy.bicep' = {
params: {
name: '<<namePrefix>>${serviceShort}001'
applicationGroupType: 'RemoteApp'
hostpoolName: last(split(resourceGroupResources.outputs.hostPoolResourceId, '/'))
hostpoolName: resourceGroupResources.outputs.hostPoolName
}
}
2 changes: 1 addition & 1 deletion modules/Microsoft.RecoveryServices/vaults/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ resource rsv 'Microsoft.RecoveryServices/vaults@2022-09-10' = {
name: name
location: location
tags: tags
identity: any(identity)
identity: identity
sku: {
name: 'RS0'
tier: 'Standard'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = {
@description('The principal ID of the created Managed Identity.')
output managedIdentityPrincipalId string = managedIdentity.properties.principalId

@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id
@description('The name of the created Storage Account.')
output storageAccountName string = storageAccount.name
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ module testDeployment '../../deploy.bicep' = {
}
]
diagnosticsStorageAccountConfig: {
blobEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.blob.${environment().suffixes.storage}/'
blobEndpoint: 'https://${resourceGroupResources.outputs.storageAccountName}.blob.${environment().suffixes.storage}/'
protectedAccountKeyName: 'StorageAccountKey1'
queueEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.queue.${environment().suffixes.storage}/'
storageAccountName: last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))
tableEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.table.${environment().suffixes.storage}/'
queueEndpoint: 'https://${resourceGroupResources.outputs.storageAccountName}.queue.${environment().suffixes.storage}/'
storageAccountName: resourceGroupResources.outputs.storageAccountName
tableEndpoint: 'https://${resourceGroupResources.outputs.storageAccountName}.table.${environment().suffixes.storage}/'
}
fabricSettings: [
{
Expand Down