Skip to content

Commit

Permalink
TSI: Add default values for ARM parameters (Azure#17133)
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 baa3ac6 commit 49e285a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ $timeSeriesIdProperties = $timeSeriesIdProperties.Replace('"','\"')
az deployment group create --resource-group $ResourceGroup --name $($EnvironmentName.ToLower()) --template-file $armTemplateFile --parameters `
region=$Region `
resourceGroup=$ResourceGroup `
subscriptionId=$SubscriptionId `
environmentName=$EnvironmentName `
iotHubName=$($EnvironmentName + "-hub") `
consumerGroupName=$ConsumerGroupName `
Expand Down
34 changes: 21 additions & 13 deletions sdk/timeseriesinsights/test-resources.bicep
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
param subscriptionId string {
metadata: {
description: 'The subscription Id where the resources will be deployed.'
}
}

param iotHubName string {
metadata: {
description: 'The name of the source IoT hub.'
}
default: az.resourceGroup().name
}

param testApplicationOid string {
Expand All @@ -23,52 +18,65 @@ param region string {
default: az.resourceGroup().location
}

param consumerGroupName string {
param environmentName string {
metadata: {
description: 'The name of the consumer group that the Time Series Insights service will use to read the data from the event hub. NOTE: To avoid resource contention, this consumer group must be dedicated to the Time Series Insights service and not shared with other readers.'
description: 'Name of the environment. The name cannot include: \'<\', \'>\', \'%\', \'&\', \':\', \'\\\', \'?\', \'/\' and any control characters. All other characters are allowed.'
}
maxLength: 90
}

param environmentName string {
param consumerGroupName string {
metadata: {
description: 'Name of the environment. The name cannot include: \'<\', \'>\', \'%\', \'&\', \':\', \'\\\', \'?\', \'/\' and any control characters. All other characters are allowed.'
description: 'The name of the consumer group that the Time Series Insights service will use to read the data from the event hub. NOTE: To avoid resource contention, this consumer group must be dedicated to the Time Series Insights service and not shared with other readers.'
}
maxLength: 90
default: concat(environmentName, 'CG')
}

param environmentTimeSeriesIdProperties array {
metadata: {
description: 'Time Series ID acts as a partition key for your data and as a primary key for your time series model. It is important that you specify the appropriate Time Series Property ID during environment creation, since you cannot change it later. Note that the Property ID is case sensitive. You can use 1-3 keys: one is required, but up to three can be used to create a composite.'
}
maxLength: 3
default: [
{
'name': 'timeseriesinsights.id'
'type': 'string'
}
{
'name': 'id'
'type': 'string'
}
]
}

param eventSourceName string {
metadata: {
description: 'Name of the event source child resource. The name cannot include: \'<\', \'>\', \'%\', \'&\', \':\', \'\\\', \'?\', \'/\' and any control characters. All other characters are allowed.'
}
maxLength: 90
default: concat(environmentName, 'EventSourceName')
}

param resourceGroup string {
default: az.resourceGroup().name
metadata: {
description: 'If you have an existing IotHub provide the name here. Defaults to the same resource group as the TSI environnment.'
}
default: az.resourceGroup().name
}

param eventSourceTimestampPropertyName string {
metadata: {
description: 'The event property that will be used as the event source\'s timestamp. If a value is not specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used.'
}
maxLength: 90
default: concat(eventSourceName, 'TimestampPropertyName')
}

param eventSourceKeyName string {
default : 'service'
metadata: {
description: 'The name of the shared access key that the Time Series Insights service will use to connect to the event hub.'
}
default : 'service'
}

var rbacOwnerRoleDefinitionId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
Expand Down
40 changes: 24 additions & 16 deletions sdk/timeseriesinsights/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"subscriptionId": {
"type": "string",
"metadata": {
"description": "The subscription Id where the resources will be deployed."
}
},
"iotHubName": {
"type": "string",
"metadata": {
"description": "The name of the source IoT hub."
}
},
"defaultValue": "[resourceGroup().name]"
},
"testApplicationOid": {
"type": "string",
Expand All @@ -27,32 +22,44 @@
},
"defaultValue": "[resourceGroup().location]"
},
"consumerGroupName": {
"type": "string",
"metadata": {
"description": "The name of the consumer group that the Time Series Insights service will use to read the data from the event hub. NOTE: To avoid resource contention, this consumer group must be dedicated to the Time Series Insights service and not shared with other readers."
}
},
"environmentName": {
"type": "string",
"maxLength": 90,
"metadata": {
"description": "Name of the environment. The name cannot include: '<', '>', '%', '&', ':', '\\', '?', '/' and any control characters. All other characters are allowed."
}
},
"consumerGroupName": {
"type": "string",
"metadata": {
"description": "The name of the consumer group that the Time Series Insights service will use to read the data from the event hub. NOTE: To avoid resource contention, this consumer group must be dedicated to the Time Series Insights service and not shared with other readers."
},
"defaultValue": "[concat(parameters('environmentName'), 'CG')]"
},
"environmentTimeSeriesIdProperties": {
"type": "array",
"maxLength": 3,
"metadata": {
"description": "Time Series ID acts as a partition key for your data and as a primary key for your time series model. It is important that you specify the appropriate Time Series Property ID during environment creation, since you cannot change it later. Note that the Property ID is case sensitive. You can use 1-3 keys: one is required, but up to three can be used to create a composite."
}
},
"defaultValue": [
{
"name": "timeseriesinsights.id",
"type": "string"
},
{
"name": "id",
"type": "string"
}
]
},
"eventSourceName": {
"type": "string",
"maxLength": 90,
"metadata": {
"description": "Name of the event source child resource. The name cannot include: '<', '>', '%', '&', ':', '\\', '?', '/' and any control characters. All other characters are allowed."
}
},
"defaultValue": "[concat(parameters('environmentName'), 'EventSourceName')]"
},
"resourceGroup": {
"type": "string",
Expand All @@ -66,7 +73,8 @@
"maxLength": 90,
"metadata": {
"description": "The event property that will be used as the event source's timestamp. If a value is not specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used."
}
},
"defaultValue": "[concat(parameters('eventSourceName'), 'TimestampPropertyName')]"
},
"eventSourceKeyName": {
"type": "string",
Expand Down

0 comments on commit 49e285a

Please sign in to comment.