Skip to content

Commit

Permalink
Add a default value for environmentName (Azure#17309)
Browse files Browse the repository at this point in the history
  • Loading branch information
Basel Rustum authored and annelo-msft committed Feb 17, 2021
1 parent ee6224c commit a5af7ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ az deployment group create --resource-group $ResourceGroup --name $($Environment

# Even though the output variable names are all capital letters in the script, ARM turns them into a strange casing
# and we have to use that casing in order to get them from the deployment outputs.
$dataAccessFqdn = az deployment group show -g $ResourceGroup -n $($EnvironmentName.ToLower()) --query 'properties.outputs.dataAccessFQDN.value' --output tsv
$dataAccessFqdn = az deployment group show -g $ResourceGroup -n $($EnvironmentName.ToLower()) --query 'properties.outputs.TIMESERIESINSIGHTS_URL.value' --output tsv

Write-Host("`nSet a new client secret for $appId`n")
$appSecret = az ad app credential reset --id $appId --years 2 --query 'password' --output tsv
Expand Down
3 changes: 2 additions & 1 deletion sdk/timeseriesinsights/test-resources.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ param environmentName string {
description: 'Name of the environment. The name cannot include: \'<\', \'>\', \'%\', \'&\', \':\', \'\\\', \'?\', \'/\' and any control characters. All other characters are allowed.'
}
maxLength: 90
default: concat(az.resourceGroup().name, '-TSI')
}

param consumerGroupName string {
Expand Down Expand Up @@ -173,4 +174,4 @@ resource storageaccount 'Microsoft.Storage/storageAccounts@2018-11-01' = {
properties: {}
}

output dataAccessFQDN string = '${environment.properties.dataAccessFqdn}'
output TIMESERIESINSIGHTS_URL string = '${environment.properties.dataAccessFqdn}'
5 changes: 3 additions & 2 deletions sdk/timeseriesinsights/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"maxLength": 90,
"metadata": {
"description": "Name of the environment. The name cannot include: '<', '>', '%', '&', ':', '\\', '?', '/' and any control characters. All other characters are allowed."
}
},
"defaultValue": "[concat(resourceGroup().name, '-TSI')]"
},
"consumerGroupName": {
"type": "string",
Expand Down Expand Up @@ -190,7 +191,7 @@
}
],
"outputs": {
"dataAccessFQDN": {
"TIMESERIESINSIGHTS_URL": {
"type": "string",
"value": "[reference(resourceId('Microsoft.TimeSeriesInsights/environments', parameters('environmentName'))).dataAccessFqdn]"
}
Expand Down

0 comments on commit a5af7ff

Please sign in to comment.