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

Port arm tools snippets - part 6 #2782

Merged
merged 12 commits into from
Jun 2, 2021
348 changes: 348 additions & 0 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
Expand Up @@ -100,10 +100,10 @@
{
"label": "snippet",
"kind": "snippet",
"detail": "DNS Zone",
"detail": "DNS Record",
"documentation": {
"kind": "markdown",
"value": "```bicep\n{\n name: 'name'\n location: 'global'\n}\n\n```"
"value": "```bicep\n{\n name: 'name'\n location: resourceGroup().location\n}\n\n```"
},
"deprecated": false,
"preselect": true,
Expand All @@ -112,7 +112,7 @@
"insertTextMode": "adjustIndentation",
"textEdit": {
"range": {},
"newText": "{\n name: ${2:'name'}\n location: 'global'\n}\n"
"newText": "{\n name: ${1:'name'}\n location: resourceGroup().location\n}\n"
},
"command": {
"command": "bicep.Telemetry",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// $1 = applicationGatewayFirewall
// $2 = 'name'
// $3 = true
// $4 = 128
// $5 = 100
// $6 = Enabled
// $7 = Detection
// $8 = 'ruleSetType'
// $9 = 'ruleSetVersion'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource applicationGatewayFirewall 'Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies@2020-11-01' = {
name: 'name'
location: resourceGroup().location
properties: {
policySettings: {
requestBodyCheck: true
maxRequestBodySizeInKb: 128
fileUploadLimitInMb: 100
state: 'Enabled'
mode: 'Detection'
}
managedRules: {
managedRuleSets: [
{
ruleSetType: 'ruleSetType'
ruleSetVersion: 'ruleSetVersion'
}
]
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// $1 = applicationGateway
// $2 = 'name'
// $3 = Standard_Small
// $4 = Standard
// $5 = 2
// $6 = 'name'
// $7 = 'id'
// $8 = 'name'
// $9 = 'id'
// $10 = 'name'
// $11 = 80
// $12 = 'name'
// $13 = 'name'
// $14 = 80
// $15 = Http
// $16 = 'name'
// $17 = 'id'
// $18 = 'id'
// $19 = Http
// $20 = 'name'
// $21 = Basic
// $22 = 'id'
// $23 = 'id'
// $24 = 'id'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
resource applicationGateway 'Microsoft.Network/applicationGateways@2020-11-01' = {
name: 'name'
location: resourceGroup().location
properties: {
sku: {
name: 'Standard_Small'
tier: 'Standard'
capacity: 2
}
gatewayIPConfigurations: [
{
name: 'name'
properties: {
subnet: {
id: 'id'
}
}
}
]
frontendIPConfigurations: [
{
name: 'name'
properties: {
publicIPAddress: {
id: 'id'
}
}
}
]
frontendPorts: [
{
name: 'name'
properties: {
port: 80
}
}
]
backendAddressPools: [
{
name: 'name'
}
]
backendHttpSettingsCollection: [
{
name: 'name'
properties: {
port: 80
protocol: 'Http'
cookieBasedAffinity: 'Disabled'
}
}
]
httpListeners: [
{
name: 'name'
properties: {
frontendIPConfiguration: {
id: 'id'
}
frontendPort: {
id: 'id'
}
protocol: 'Http'
sslCertificate: null
}
}
]
requestRoutingRules: [
{
name: 'name'
properties: {
ruleType: 'Basic'
httpListener: {
id: 'id'
}
backendAddressPool: {
id: 'id'
}
backendHttpSettings: {
id: 'id'
}
}
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// $1 = appInsightsAlertRules
// $2 = 'name'
// $3 = 'name'
// $4 = 'description'
// $5 = 3
// $6 = Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition
// $7 = Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource
// $8 = 'resourceUri'
// $9 = 'windowSize'
// $10 = Microsoft.Azure.Management.Insights.Models.RuleEmailAction

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource appInsightsAlertRules 'Microsoft.Insights/alertrules@2016-03-01' = {
name: 'name'
location: resourceGroup().location
properties: {
name: 'name'
description: 'description'
isEnabled: false
condition: {
failedLocationCount: 3
'odata.type': 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition'
dataSource: {
'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource'
resourceUri: 'resourceUri'
}
windowSize: 'windowSize'
}
action: {
'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction'
sendToServiceOwners: true
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// $1 = appInsightsAutoScaleSettings
// $2 = 'name'
// $3 = web
// $4 = appServiceId
// $5 = 'name'
// $6 = 'name'
// $7 = 'minimum'
// $8 = 'maximum'
// $9 = 'default'
// $10 = 'name'
// $11 = 'metricResourceUri'
// $12 = 'value'
// $13 = 'metricName'
// $14 = 'metricResourceUri'
// $15 = 'value'
// $16 = 'metricResourceUri'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
resource appInsightsAutoScaleSettings 'Microsoft.Insights/autoscalesettings@2015-04-01' = {
name: 'name'
location: resourceGroup().location
tags: {
Application_Type: 'web'
'hidden-link:appServiceId': 'Resource'
}
properties: {
name: 'name'
profiles: [
{
name: 'name'
capacity: {
minimum: 'minimum'
maximum: 'maximum'
default: 'default'
}
rules: [
{
metricTrigger: {
metricName: 'name'
metricResourceUri: 'metricResourceUri'
timeGrain: 'PT1M'
statistic: 'Average'
timeWindow: 'PT10M'
timeAggregation: 'Average'
operator: 'GreaterThan'
threshold: 80
}
scaleAction: {
direction: 'Increase'
type: 'ChangeCount'
value: 'value'
cooldown: 'PT10M'
}
}
{
metricTrigger: {
metricName: 'metricName'
metricResourceUri: 'metricResourceUri'
timeGrain: 'PT1M'
statistic: 'Average'
timeWindow: 'PT1H'
timeAggregation: 'Average'
operator: 'LessThan'
threshold: 60
}
scaleAction: {
direction: 'Decrease'
type: 'ChangeCount'
value: 'value'
cooldown: 'PT1H'
}
}
]
}
]
enabled: false
targetResourceUri: 'metricResourceUri'
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// $1 = appInsightsComponents
// $2 = 'name'
// $3 = web

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource appInsightsComponents 'Microsoft.Insights/components@2020-02-02-preview' = {
name: 'name'
location: resourceGroup().location
kind: 'web'
properties: {
Application_Type: 'web'
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// $1 = 'name'
// $2 = dnsRecord
// $3 = A
// $4 = 'name'
// $5 = ARecords

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' = {
name: 'name'
location: resourceGroup().location
}

resource dnsRecord 'Microsoft.Network/dnsZones/A@2018-05-01' = {
parent: dnsZone
name: 'name'
properties: {
TTL: 3600
'ARecords': []
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// $1 = firewall
// $2 = 'name'
// $3 = 'name'
// $4 = 100
// $5 = Allow
// $6 = 'name'
// $7 = 'description'
// $8 = 'sourceAddress'
// $9 = Http
// $10 = 80
// $11 = 'www.microsoft.com'
// $12 = 'name'
// $13 = 100
// $14 = Dnat
// $15 = 'name'
// $16 = 'description'
// $17 = 'sourceAddress'
// $18 = 'destinationAddress'
// $19 = '80'
// $20 = TCP
// $21 = 'translatedAddress'
// $22 = '80'
// $23 = 'name'
// $24 = 100
// $25 = Deny
// $26 = 'name'
// $27 = 'description'
// $28 = 'sourceAddress'
// $29 = 'destinationAddress'
// $30 = '80'
// $31 = TCP
// $32 = 'name'
// $33 = 'id'
// $34 = 'id'

// Insert snippet here
Loading