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 @@ -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 name of the created Storage Account.')
output storageAccountResourceName string = last(split(storageAccount.id, '/'))
@description('The resource ID of the created Storage Account.')
output storageAccountResourceId string = storageAccount.id
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ module testDeployment '../../deploy.bicep' = {
}
]
diagnosticsStorageAccountConfig: {
blobEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.blob.${environment().suffixes.storage}/'
blobEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.blob.${environment().suffixes.storage}/'
protectedAccountKeyName: 'StorageAccountKey1'
queueEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.queue.${environment().suffixes.storage}/'
storageAccountName: resourceGroupResources.outputs.storageAccountResourceName
tableEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.table.${environment().suffixes.storage}/'
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}/'
}
fabricSettings: [
{
Expand Down Expand Up @@ -201,6 +201,7 @@ module testDeployment '../../deploy.bicep' = {
principalIds: [
resourceGroupResources.outputs.managedIdentityPrincipalId
]
principalType: 'ServicePrincipal'
}
]
applicationTypes: [
Expand Down
18 changes: 10 additions & 8 deletions modules/Microsoft.ServiceFabric/clusters/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
}
]
diagnosticsStorageAccountConfig: {
blobEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.blob.${environment().suffixes.storage}/'
blobEndpoint: '<blobEndpoint>'
protectedAccountKeyName: 'StorageAccountKey1'
queueEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.queue.${environment().suffixes.storage}/'
queueEndpoint: '<queueEndpoint>'
storageAccountName: '<storageAccountName>'
tableEndpoint: 'https://${resourceGroupResources.outputs.storageAccountResourceName}.table.${environment().suffixes.storage}/'
tableEndpoint: '<tableEndpoint>'
}
fabricSettings: [
{
Expand Down Expand Up @@ -484,6 +484,7 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
principalIds: [
'<managedIdentityPrincipalId>'
]
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Reader'
}
]
Expand All @@ -506,7 +507,7 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
maxPercentUnhealthyNodes: 0
}
upgradeDomainTimeout: '02:00:00'
upgradeReplicaSetCheckTimeout: '<upgradeReplicaSetCheckTimeout>'
upgradeReplicaSetCheckTimeout: '1.00:00:00'
upgradeTimeout: '02:00:00'
}
vmImage: 'Linux'
Expand Down Expand Up @@ -638,11 +639,11 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
},
"diagnosticsStorageAccountConfig": {
"value": {
"blobEndpoint": "https://${resourceGroupResources.outputs.storageAccountResourceName}.blob.${environment().suffixes.storage}/",
"blobEndpoint": "<blobEndpoint>",
"protectedAccountKeyName": "StorageAccountKey1",
"queueEndpoint": "https://${resourceGroupResources.outputs.storageAccountResourceName}.queue.${environment().suffixes.storage}/",
"queueEndpoint": "<queueEndpoint>",
"storageAccountName": "<storageAccountName>",
"tableEndpoint": "https://${resourceGroupResources.outputs.storageAccountResourceName}.table.${environment().suffixes.storage}/"
"tableEndpoint": "<tableEndpoint>"
}
},
"fabricSettings": {
Expand Down Expand Up @@ -696,6 +697,7 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
"principalIds": [
"<managedIdentityPrincipalId>"
],
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Reader"
}
]
Expand All @@ -722,7 +724,7 @@ module clusters './Microsoft.ServiceFabric/clusters/deploy.bicep' = {
"maxPercentUnhealthyNodes": 0
},
"upgradeDomainTimeout": "02:00:00",
"upgradeReplicaSetCheckTimeout": "<upgradeReplicaSetCheckTimeout>",
"upgradeReplicaSetCheckTimeout": "1.00:00:00",
"upgradeTimeout": "02:00:00"
}
},
Expand Down
9 changes: 5 additions & 4 deletions utilities/tools/Set-ModuleReadMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -691,15 +691,16 @@ function ConvertTo-FormattedJSONParameterObject {
$line = $pattern.replace($line, '"$1":', 1)

# [2.5] Syntax: Replace Bicep resource ID references
$mayHaveValue = $line -like '*:*'
$mayHaveValue = $line -match '\s*.+:\s+'
if ($mayHaveValue) {

$lineValue = ($line -split '\s*.+:\s+')[1].Trim() # i.e. optional spaces, followed by a name ("xzy"), followed by ':', folowed by at least a space

# Individual checks
$isLineWithEmptyObjectValue = $line -match '^.+:\s*{\s*}\s*$' # e.g. test: {}
$isLineWithObjectPropertyReferenceValue = ($line -split ':')[1].Trim() -like '*.*' # e.g. resourceGroupResources.outputs.virtualWWANResourceId`
$isLineWithObjectPropertyReferenceValue = $lineValue -like '*.*' # e.g. resourceGroupResources.outputs.virtualWWANResourceId`
$isLineWithReferenceInLineKey = ($line -split ':')[0].Trim() -like '*.*'

$lineValue = ($line -split ':')[1].Trim()
$isLineWithStringValue = $lineValue -match '".+"' # e.g. "value"
$isLineWithFunction = $lineValue -match '[a-zA-Z]+\(.+\)' # e.g. (split(resourceGroupResources.outputs.recoveryServicesVaultResourceId, "/"))[4]
$isLineWithPlainValue = $lineValue -match '^\w+$' # e.g. adminPassword: password
Expand All @@ -717,7 +718,7 @@ function ConvertTo-FormattedJSONParameterObject {
if ($isLineWithObjectPropertyReference -or $isLineWithFunction -or $isLineWithParameterOrVariableReferenceValue) {
$line = '{0}: "<{1}>"' -f ($line -split ':')[0], ([regex]::Match(($line -split ':')[0], '"(.+)"')).Captures.Groups[1].Value
} elseif ($isLineWithObjectReferenceKeyAndEmptyObjectValue) {
$line = '"<{0}>": {1}' -f (($line -split ':')[0] -split '\.')[-1].TrimEnd('}"'), ($line -split ':')[1].Trim()
$line = '"<{0}>": {1}' -f (($line -split ':')[0] -split '\.')[-1].TrimEnd('}"'), $lineValue
}
} else {
if ($line -notlike '*"*"*' -and $line -like '*.*') {
Expand Down