Skip to content

Commit

Permalink
- emit limit plus codegen
Browse files Browse the repository at this point in the history
- range() now returns int[] instead of array
- better union type array formatting
- loop variable completions
- removed brackets from loops spec
- fixed exceptions with resource/module collection refs
  • Loading branch information
majastrz committed Feb 17, 2021
1 parent c05130c commit ac95b81
Show file tree
Hide file tree
Showing 110 changed files with 25,328 additions and 4,699 deletions.
2 changes: 1 addition & 1 deletion docs/examples/201/key-vault-secret-create/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ resource secret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = {
/*
TODO: Replace the first secret workaround above with this once we have loops
resource[] secrets 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [
resource secrets 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [
for secret in secretsObject.secrets: {
dependsOn: [
vault
Expand Down
6 changes: 3 additions & 3 deletions docs/spec/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In the below example, we are looping over `storageAccounts` array. For each loop
// array of storage account names
param storageAccounts array
resource[] storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for storageName in storageAccounts: {
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for storageName in storageAccounts: {
name: storageName
location: resourceGroup().location
properties: {
Expand Down Expand Up @@ -57,7 +57,7 @@ var storageConfigurations = [
}
]
resource[] storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for (config, i) in storageConfigurations: {
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for (config, i) in storageConfigurations: {
name: storageAccountNamePrefix + config.suffix + i
location: resourceGroup().location
properties: {
Expand Down Expand Up @@ -121,7 +121,7 @@ resource vnet 'Microsoft.Network/virtualNetworks@2018-11-01' = {
The example below demonstrates a nested loop combined with filters at each loop. Filters must be expressions that evaluate to a boolean value.

```
resource[] parentResources 'Microsoft.Example/examples@2020-06-06' = [for parent in parents where parent.enabled: {
resource parentResources 'Microsoft.Example/examples@2020-06-06' = [for parent in parents where parent.enabled: {
name: parent.name
properties: {
children: [for child in parent.children where parent.includeChildren && child.enabled: {
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.Cli/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Bicep.Cli": {
"commandName": "Project",
"commandLineArgs": "build D:\\DSL\\EladDemo.arm",
"commandLineArgs": "build D:\\DSL\\working\\main.bicep",
"remoteDebugEnabled": false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bicep.Core.Samples/Files/Functions/sys.json
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@
"minimumArgumentCount": 2,
"maximumArgumentCount": 2,
"flags": "default",
"typeSignature": "(startIndex: int, count: int): array",
"typeSignature": "(startIndex: int, count: int): int[]",
"parameterTypeSignatures": [
"startIndex: int",
"count: int"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"detail": "dependsOn",
"documentation": {
"kind": "markdown",
"value": "Type: `resource | module[]` \nWrite-only property \n"
"value": "Type: `(module[] | resource | module | resource[])[]` \nWrite-only property \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"detail": "dependsOn",
"documentation": {
"kind": "markdown",
"value": "Type: `resource | module[]` \nWrite-only property \n"
"value": "Type: `(module[] | resource | module | resource[])[]` \nWrite-only property \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"detail": "dependsOn",
"documentation": {
"kind": "markdown",
"value": "Type: `resource | module[]` \nWrite-only property \n"
"value": "Type: `(module[] | resource | module | resource[])[]` \nWrite-only property \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"detail": "dependsOn",
"documentation": {
"kind": "markdown",
"value": "Type: `resource | module[]` \nWrite-only property \n"
"value": "Type: `(module[] | resource | module | resource[])[]` \nWrite-only property \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Loading

0 comments on commit ac95b81

Please sign in to comment.