Giter VIP home page Giter VIP logo

Comments (8)

lwang2016 avatar lwang2016 commented on June 18, 2024

What's the type of array items with this syntax?

// output with a value calculated by a loop (output copy loop in JSON):
output myLoopyOutput array = [for myItem in myArray {
  myProperty: myItem.myOtherProperty
}]

How to declare an output for resourceIds in sqlDatabases?

resource[] sqlDatabases 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2020-03-01' [
    for dbindex in length(param.databaseName) {
        <db properties>
    }
]

from bicep.

lwang2016 avatar lwang2016 commented on June 18, 2024

With this proposal, output declarations may scatter in a .arm file, right?

from bicep.

majastrz avatar majastrz commented on June 18, 2024

Same as parameters - yup.

from bicep.

majastrz avatar majastrz commented on June 18, 2024

The other part I forgot to mention was that we brought up the idea of enforcing order in a file (inputs at the top, etc.) at our discussions with DevDiv folks and they felt it was better left up to the user and the auto formatter. The main reason given was that when a user is merging two files together by concatenating them together, nothing will compile until they fix the order.

from bicep.

majastrz avatar majastrz commented on June 18, 2024

Discussion notes from 7/1/2020 team meeting about outputs:

  • Need to figure out if condition is actually useful on outputs. How do you consume a condition if it may not exist?
  • Does secureString and secureObject type in outputs allow passing the value around?

from bicep.

majastrz avatar majastrz commented on June 18, 2024

We have consensus on minimal output declarations, but need to investigate secure types and conditions to commit to syntax for those.

from bicep.

majastrz avatar majastrz commented on June 18, 2024

Conditions on outputs and secure types on outputs are not that useful, so we will not support them in the bicep language. There is no remaining scenario that would require a modifier syntax for outputs. Therefore the proposal is reduced to the following:

// output value referencing a resource identifier
output myEndpoint string = myResource.properties.endpoint

// hard-coded output
output myHardcodedOutput int = 42

// output with a value calculated by a loop (output copy loop in JSON):
output myLoopyOutput array = [for myItem in myArray {
  myProperty: myItem.myOtherProperty
}]

As we appear to have team consensus on this syntax, I will send a spec pull request shortly and close this issue.

from bicep.

majastrz avatar majastrz commented on June 18, 2024

Created #67

from bicep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.