Skip to content

Commit

Permalink
fix 569 (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoore-msft authored Jan 21, 2022
1 parent 1fc9c76 commit be4e8bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ foreach ($found in $foundObjects) { # Walk over each found object
foreach ($prop in $found.psobject.properties) { # then walk thru each property
if ($prop.Name -notmatch 'ur[il]$') { continue } # skipping ones that are not uri/url
if (-not $prop.value | ?<ARM_Template_Expression>) { continue } # and ones that do not contain an expression.



# If the value contained expressions, but not the function uri
$foundBadFunction = $prop.Value | ?<ARM_Template_Function> -FunctionName ($FunctionNotAllowedInUri -join '|')
$foundUriFunction = $prop.Value | ?<ARM_Template_Function> -FunctionName uri

if (
($foundBadFunction -and -not $foundUriFunction) -or
$foundBadFunction.Index -lt $foundUriFunction.Index
($foundBadFunction.Index -lt $foundUriFunction.Index -and $foundBadFunction)
) {
Write-Error "Function'$($foundBadFunction.Groups['FunctionName'].Value)' found within '$($prop.Name)" -TargetObject $found -ErrorId "URI.Improperly.Constructed"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"outputs": {
"ServerUrl": {
"type": "string",
"value": "[uri(concat('http://', reference(variables('publicIPAddressName')).dnsSettings.fqdn), 'somepath')]"
}
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [],
"outputs": {
"ServerUrl": {
"type": "string",
"value": "[uri(concat('http://', reference(variables('publicIPAddressName')).dnsSettings.fqdn), 'somepath')]"
},
"otherUri": {
"type": "string",
"value": "[uri(reference(resourceId('Microsoft.KeyVault/vaults/keys', 'keyVaultName', 'keyName'), '2021-06-01-preview').keyUri, 'blah')]"
}
}
}

0 comments on commit be4e8bf

Please sign in to comment.