Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

modified private link naming variables #533

Merged
merged 6 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 7 additions & 7 deletions src/bicep/mlz.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.4.1008.15138",
"templateHash": "11544710405663054226"
"templateHash": "14984160042336406283"
}
},
"parameters": {
Expand Down Expand Up @@ -1227,7 +1227,7 @@
"_generator": {
"name": "bicep",
"version": "0.4.1008.15138",
"templateHash": "2822522237557490106"
"templateHash": "13599565970900573060"
}
},
"parameters": {
Expand Down Expand Up @@ -2432,7 +2432,7 @@
"_generator": {
"name": "bicep",
"version": "0.4.1008.15138",
"templateHash": "18251381868621303940"
"templateHash": "7428452441585761239"
}
},
"parameters": {
Expand Down Expand Up @@ -2490,10 +2490,10 @@
},
"functions": [],
"variables": {
"privateLinkConnectionName": "[substring(format('plconn{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 0, 16)]",
"privateLinkEndpointName": "[substring(format('pl{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 0, 16)]",
"privateLinkScopeName": "[substring(format('plscope{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 0, 16)]",
"privateLinkScopeResourceName": "[substring(format('plscres{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 0, 16)]",
"privateLinkConnectionName": "[take(format('plconn{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 80)]",
"privateLinkEndpointName": "[take(format('pl{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 80)]",
"privateLinkScopeName": "[take(format('plscope{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 80)]",
"privateLinkScopeResourceName": "[take(format('plscres{0}{1}', parameters('logAnalyticsWorkspaceName'), parameters('uniqueData')), 80)]",
"privateDnsZones_privatelink_monitor_azure_name": "[if(equals(toLower(environment().name), toLower('AzureCloud')), 'privatelink.monitor.azure.com', 'privatelink.monitor.azure.us')]",
"privateDnsZones_privatelink_ods_opinsights_azure_name": "[if(equals(toLower(environment().name), toLower('AzureCloud')), 'privatelink.ods.opinsights.azure.com', 'privatelink.ods.opinsights.azure.us')]",
"privateDnsZones_privatelink_oms_opinsights_azure_name": "[if(equals(toLower(environment().name), toLower('AzureCloud')), 'privatelink.oms.opinsights.azure.com', 'privatelink.oms.opinsights.azure.us')]",
Expand Down
10 changes: 5 additions & 5 deletions src/bicep/modules/privateLink.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ param vnetResourceGroup string = resourceGroup().name
@description('The subscription id of the subscription the virtual network exists in')
param vnetSubscriptionId string = subscription().subscriptionId

var privateLinkConnectionName = substring('plconn${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkEndpointName = substring('pl${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkScopeName = substring('plscope${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkScopeResourceName = substring('plscres${logAnalyticsWorkspaceName }${uniqueData}', 0, 16)
var privateLinkConnectionName = take('plconn${logAnalyticsWorkspaceName}${uniqueData}', 80)
var privateLinkEndpointName = take('pl${logAnalyticsWorkspaceName}${uniqueData}', 80)
var privateLinkScopeName = take('plscope${logAnalyticsWorkspaceName}${uniqueData}', 80)
var privateLinkScopeResourceName = take('plscres${logAnalyticsWorkspaceName}${uniqueData}', 80)

resource globalPrivateLinkScope 'microsoft.insights/privateLinkScopes@2019-10-17-preview' = {
name: privateLinkScopeName
Expand Down Expand Up @@ -93,7 +93,7 @@ resource dnsZonePrivateLinkEndpoint 'Microsoft.Network/privateEndpoints/privateD
{
name: 'agentsvc'
properties: {
privateDnsZoneId: privatelink_agentsvc_azure_automation_net .id
privateDnsZoneId: privatelink_agentsvc_azure_automation_net.id
}
}
{
Expand Down