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

Use symbolicName.id instead of resourceId in snippets #3745

Merged
merged 4 commits into from
Jul 24, 2021
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
32 changes: 16 additions & 16 deletions src/Bicep.Core.Samples/Files/Completions/declarations.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// $1 = azureFunction
// $1 = serverfarms
// $2 = 'name'
// $3 = 'serverFarmName'
// $4 = storageAccountName1
// $5 = 'storageAccountID1'
// $6 = storageAccountName2
// $7 = 'storageAccountID2'
// $8 = storageAccountName3
// $9 = 'storageAccountID3'
// $10 = 'applicationInsightsName'
// $11 = dotnet
// $3 = insightsComponents
// $4 = 'name'
// $5 = azureFunction
// $6 = 'name'
// $7 = storageAccountName1
// $8 = 'storageAccountID1'
// $9 = storageAccountName2
// $10 = 'storageAccountID2'
// $11 = storageAccountName3
// $12 = 'storageAccountID3'
// $13 = 'name'
// $14 = dotnet


// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
// $1 = azureFunction
// $1 = serverfarms
// $2 = 'name'
// $3 = 'serverFarmName'
// $4 = storageAccountName1
// $5 = 'storageAccountID1'
// $6 = storageAccountName2
// $7 = 'storageAccountID2'
// $8 = storageAccountName3
// $9 = 'storageAccountID3'
// $10 = 'applicationInsightsName'
// $11 = dotnet
// $3 = insightsComponents
// $4 = 'name'
// $5 = azureFunction
// $6 = 'name'
// $7 = storageAccountName1
// $8 = 'storageAccountID1'
// $9 = storageAccountName2
// $10 = 'storageAccountID2'
// $11 = storageAccountName3
// $12 = 'storageAccountID3'
// $13 = 'name'
// $14 = dotnet


resource serverfarms 'Microsoft.Web/serverfarms@2021-01-15' existing = {
name: 'name'
}

resource insightsComponents 'Microsoft.Insights/components@2020-02-02' existing = {
name: 'name'
}

resource azureFunction 'Microsoft.Web/sites@2020-12-01' = {
name: 'name'
location: resourceGroup().location
kind: 'functionapp'
properties: {
serverFarmId: resourceId('Microsoft.Web/serverfarms', 'serverFarmName')
serverFarmId: serverfarms.id
siteConfig: {
appSettings: [
{
Expand All @@ -41,7 +52,7 @@ resource azureFunction 'Microsoft.Web/sites@2020-12-01' = {
}
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
value: reference(resourceId('microsoft.insights/components/', 'applicationInsightsName'), '2015-05-01').InstrumentationKey
value: reference(insightsComponents.id, '2015-05-01').InstrumentationKey
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// $1 = mediaServices
// $1 = storageAccount
// $2 = 'name'
// $3 = 'mediaServiceStorageAccount'
// $4 = Primary
// $3 = mediaServices
// $4 = 'name'
// $5 = Primary

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// $1 = mediaServices
// $1 = storageAccount
// $2 = 'name'
// $3 = 'mediaServiceStorageAccount'
// $4 = Primary
// $3 = mediaServices
// $4 = 'name'
// $5 = Primary

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-02-01' existing = {
name: 'name'
}

resource mediaServices 'Microsoft.Media/mediaServices@2020-05-01' = {
name: 'name'
location: resourceGroup().location
properties: {
storageAccounts: [
{
id: resourceId('Microsoft.Storage/storageAccounts', 'mediaServiceStorageAccount')
id: storageAccount.id
type: 'Primary'
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// $1 = networkInterface
// $2 = 'name'
// $1 = 'name'
// $2 = subnet
// $3 = 'name'
// $4 = Dynamic
// $5 = 'virtualNetwork'
// $6 = 'subnet'
// $4 = networkInterface
// $5 = 'name'
// $6 = 'name'
// $7 = Dynamic

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
// $1 = networkInterface
// $2 = 'name'
// $1 = 'name'
// $2 = subnet
// $3 = 'name'
// $4 = Dynamic
// $5 = 'virtualNetwork'
// $6 = 'subnet'
// $4 = networkInterface
// $5 = 'name'
// $6 = 'name'
// $7 = Dynamic

resource vnet 'Microsoft.Network/virtualNetworks@2021-02-01' existing = {
name: 'name'
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2021-02-01' existing = {
parent: vnet
name: 'name'
}

resource networkInterface 'Microsoft.Network/networkInterfaces@2020-11-01' = {
name: 'name'
location: resourceGroup().location
Expand All @@ -15,7 +25,7 @@ resource networkInterface 'Microsoft.Network/networkInterfaces@2020-11-01' = {
properties: {
privateIPAllocationMethod: 'Dynamic'
subnet: {
id: resourceId('Microsoft.Network/virtualNetworks/subnets', 'virtualNetwork', 'subnet')
id: subnet.id
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// $1 = peering
// $2 = 'virtualNetwork/name'
// $3 = true
// $4 = true
// $1 = virtualNetworks
// $2 = 'name'
// $3 = peering
// $4 = 'virtualNetwork/name'
// $5 = true
// $6 = true
// $7 = 'REQUIRED'
// $7 = true
// $8 = true

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// $1 = peering
// $2 = 'virtualNetwork/name'
// $3 = true
// $4 = true
// $1 = virtualNetworks
// $2 = 'name'
// $3 = peering
// $4 = 'virtualNetwork/name'
// $5 = true
// $6 = true
// $7 = 'REQUIRED'
// $7 = true
// $8 = true

resource virtualNetworks 'Microsoft.Network/virtualNetworks@2021-02-01' existing = {
name: 'name'
}

resource peering 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2020-07-01' = {
name: 'virtualNetwork/name'
properties: {
Expand All @@ -14,7 +19,7 @@ resource peering 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2020-
allowGatewayTransit: true
useRemoteGateways: true
remoteVirtualNetwork: {
id: resourceId('Microsoft.Network/virtualNetworks', 'REQUIRED')
id: virtualNetworks.id
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// $1 = vpnVnetConnection
// $1 = virtualNetworkGateways
// $2 = 'name'
// $3 = 'vnetGateway'
// $4 = 'localGateway'
// $5 = IPsec
// $6 = 0
// $7 = 'sharedkey'
// $3 = localNetworkGateways
// $4 = 'name'
// $5 = vpnVnetConnection
// $6 = 'name'
// $7 = IPsec
// $8 = 0
// $9 = 'sharedkey'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
// $1 = vpnVnetConnection
// $1 = virtualNetworkGateways
// $2 = 'name'
// $3 = 'vnetGateway'
// $4 = 'localGateway'
// $5 = IPsec
// $6 = 0
// $7 = 'sharedkey'
// $3 = localNetworkGateways
// $4 = 'name'
// $5 = vpnVnetConnection
// $6 = 'name'
// $7 = IPsec
// $8 = 0
// $9 = 'sharedkey'

resource virtualNetworkGateways 'Microsoft.Network/virtualNetworkGateways@2021-02-01' existing = {
name: 'name'
}

resource localNetworkGateways 'Microsoft.Network/localNetworkGateways@2021-02-01' existing = {
name: 'name'
}

resource vpnVnetConnection 'Microsoft.Network/connections@2020-11-01' = {
name: 'name'
location: resourceGroup().location
properties: {
virtualNetworkGateway1: {
id: resourceId('Microsoft.Network/virtualNetworkGateways', 'vnetGateway')
id: virtualNetworkGateways.id
properties:{}
}
localNetworkGateway2: {
id: resourceId('Microsoft.Network/localNetworkGateways', 'localGateway')
id: localNetworkGateways.id
properties:{}
}
connectionType: 'IPsec'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// $1 = virtualNetworkGateway
// $2 = 'name'
// $1 = 'name'
// $2 = subnet
// $3 = 'name'
// $4 = 'virtualNetwork'
// $5 = 'subnet'
// $6 = 'publicIPAddress'
// $7 = Basic
// $8 = Basic
// $9 = Vpn
// $10 = PolicyBased
// $11 = true
// $4 = publicIPAdresses
// $5 = 'name'
// $6 = virtualNetworkGateway
// $7 = 'name'
// $8 = 'name'
// $9 = Basic
// $10 = Basic
// $11 = Vpn
// $12 = PolicyBased
// $13 = true

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
// $1 = virtualNetworkGateway
// $2 = 'name'
// $1 = 'name'
// $2 = subnet
// $3 = 'name'
// $4 = 'virtualNetwork'
// $5 = 'subnet'
// $6 = 'publicIPAddress'
// $7 = Basic
// $8 = Basic
// $9 = Vpn
// $10 = PolicyBased
// $11 = true
// $4 = publicIPAdresses
// $5 = 'name'
// $6 = virtualNetworkGateway
// $7 = 'name'
// $8 = 'name'
// $9 = Basic
// $10 = Basic
// $11 = Vpn
// $12 = PolicyBased
// $13 = true

resource vnet 'Microsoft.Network/virtualNetworks@2021-02-01' existing = {
name: 'name'
}

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2021-02-01' existing = {
parent: vnet
name: 'name'
}

resource publicIPAdresses 'Microsoft.Network/publicIPAddresses@2021-02-01' existing = {
name: 'name'
}

resource virtualNetworkGateway 'Microsoft.Network/virtualNetworkGateways@2020-11-01' = {
name: 'name'
location: resourceGroup().location
Expand All @@ -20,10 +35,10 @@ resource virtualNetworkGateway 'Microsoft.Network/virtualNetworkGateways@2020-11
properties: {
privateIPAllocationMethod: 'Dynamic'
subnet: {
id: resourceId('Microsoft.Network/virtualNetworks/subnets', 'virtualNetwork', 'subnet')
id: subnet.id
}
publicIPAddress: {
id: resourceId('Microsoft.Network/publicIPAddresses', 'publicIPAddress')
id: publicIPAdresses.id
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// $1 = webApplication
// $1 = webServerFarms
// $2 = 'name'
// $3 = appServicePlan
// $4 = 'appServicePlan'
// $3 = webApplication
// $4 = 'name'
// $5 = appServicePlan

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// $1 = webApplication
// $1 = webServerFarms
// $2 = 'name'
// $3 = appServicePlan
// $4 = 'appServicePlan'
// $3 = webApplication
// $4 = 'name'
// $5 = appServicePlan

resource webServerFarms 'Microsoft.Web/serverfarms@2021-01-15' existing = {
name: 'name'
}

resource webApplication 'Microsoft.Web/sites@2018-11-01' = {
name: 'name'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan': 'Resource'
}
properties: {
serverFarmId: resourceId('Microsoft.Web/serverfarms', 'appServicePlan')
serverFarmId: webServerFarms.id
}
}// Insert snippet here
Loading