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

Bicep Community Call 10/21 #4821

Closed
stephaniezyen opened this issue Oct 12, 2021 · 11 comments
Closed

Bicep Community Call 10/21 #4821

stephaniezyen opened this issue Oct 12, 2021 · 11 comments

Comments

@stephaniezyen
Copy link
Contributor

We are hosting our fourth monthly Bicep community call on Thursday, 10/21 at 2pm PST! Please use this issue to address topics you would like to discuss, questions you have for our team, further demos you would like to see, and any high or low points you would like to share. This is an open space for our users to discuss any topics they would like to talk about with our team.

Please list topics of discussion in this thread OR you can ask questions during the Q&A portion of the call.

I will be sending the meeting invite out to those who signed up here; if you would like an invite, please sign up and I'll send the invite to you!

Some exciting news: The Xbox team will share their experience with bicep and give us a look into their codebase so make sure to show up with questions!

@stephaniezyen stephaniezyen added the enhancement New feature or request label Oct 12, 2021
@ghost ghost added the Needs: Triage 🔍 label Oct 12, 2021
@WhitWaldo
Copy link

It might be more of a documentation question, but I'd love to learn more about the visitor implementation the linter uses.

I've spent fleeting moments looking at ways to contribute rules for the linter and been stumped at how to globalize the messages and access properties off specifically named keys (e.g. is the subnets array within a virtual network empty) as opposed to the rules in there now (globally look for parameters not in use anywhere).

@alex-frankel
Copy link
Collaborator

but I'd love to learn more about the visitor implementation the linter uses.

Good suggestion. @StephenWeatherford is going to walk us through the linter codebase. I wouldn't say we are necessarily ready to take contributions for linters (we don't have any contribution docs atm), but hopefully this can be a jump start for those interested.

We are also going to review the latest registry updates. The private registry capability should be released by the time we have this call and we can go over the latest registry reference syntax, alias config and auth config.

@lordlinus
Copy link

keen to hear if there are any updates on this request #4023

@aristosvo
Copy link

keen to hear if there are any updates on this request #4023

And in general a discussion about resources which are not idempotent. Where to properly report them, how to work around them in a "Bicep" way (not the feature flags again). Bicep has to deal with this, I'm just two weeks into Bicep (and therefore ARM), but this is a real pain. I understand it is not a Bicep responsibility, but it heavily reflects on the tool and its usability.

@Agazoth
Copy link

Agazoth commented Oct 18, 2021

I would like to hear about the roadmap for other "providers" like AAD.

@brwilkinson
Copy link
Collaborator

@aristosvo

And in general a discussion about resources which are not idempotent. .... I'm just two weeks into Bicep (and therefore ARM), but this is a real pain

Feel free to open up individual discussions for the particular issues that you are facing, we should be able to point you in the right direction. I recommend to just open 1 discussion at a time, since what you observe from the first discussion may help you across multiple providers Etc. It's difficult to cover these in the community call, however discussions would be a great place to start.

@octaviancretu
Copy link

Are there any plans to support foreach operator for resource/module collections?

param vnetRGName string 
param vnetName string
param subnetNames array = []

resource vnet 'Microsoft.Network/virtualNetworks@2021-02-01' existing ={
  name: vnetName
  scope: resourceGroup(vnetRGName)
}

resource subnets 'Microsoft.Network/virtualNetworks/subnets@2021-02-01' existing =  [for subnetName in subnetNames: {
  name : '${vnetName}/${subnetName}'
  scope: resourceGroup(vnetRGName)
}]

resource dtLab 'Microsoft.DevTestLab/labs@2018-10-15-preview' = {
  name: name
  location: regionId
  tags: resourceTags
  properties: {
    labStorageType: 'Premium'
    isolateLabResources: labIsolation
    vmCreationResourceGroupId: resourceGroup().id 
    mandatoryArtifactsResourceIdsWindows:mandatoryArtifactsResourceIdsWindows
  }
  identity: {
    type: identityType
  }
}

resource name_DevTestVNET 'Microsoft.DevTestLab/labs/virtualNetworks@2018-10-15-preview' = {
  parent: dtLab
  name: vnet.name
  location: regionId
  properties: {
    externalProviderResourceId: vnet.id 
    subnetOverrides: [for subnet in subnets: {
      labSubNetName: subnet.name
      resourceId: subnet.id
      useInVmCreationPermission: 'Allow'
      usePublicIpAddressPermission: 'Deny'
    }]

  }
}

I receive the following error message:
Error BCP144: Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression.
The workaround for this particular scenario would be to use it as follows concatenation of resource ids as bellow.

resource name_DevTestVNET 'Microsoft.DevTestLab/labs/virtualNetworks@2018-10-15-preview' = {
  [...]
  properties: {
    externalProviderResourceId: vnet.id 
    subnetOverrides: [for subnetName in subnetNames: {
      labSubNetName: subnetName
      resourceId: '${resourceId(vnetRGName,'Microsoft.Network/virtualNetworks',vnetName)}/subnets/${subnetName}'
      useInVmCreationPermission: 'Allow'
      usePublicIpAddressPermission: 'Deny'
    }]

  }
}

However in more complex scenarios if we want to access multiple properties of the existing resource this would be very tricky. Do you plan to add this in the near future? Or do you have any other better suggestion to work with such scenarios?
I have a lot of such scenarios for different already existing resources, where I can not apply tricks like entering a number at the end of the resource name and then loop over them.

Thanks!

@henriksen
Copy link

An update on where #2245 and #2246 is in the roadmap. Looking like 0.5, 1.0 or beyond? Currently building a bicep structure for a non-trivial mono-repo and both of those would be very helpful in breaking up bicep files in reusable modules.

Also, how the AAD provider is doing :)

@rouke-broersma
Copy link

Would love if #4884 could be discussed because we have plans for this feature but as I commented on that issue we unfortunately can't use it in the current state.

@alex-frankel
Copy link
Collaborator

@octaviancretu -- do you mind opening a separate issue to discuss this one? There are a few things going on in your code sample that are worth unpacking in more detail. Not sure it will make sense to do that on the call today.

@octaviancretu
Copy link

@octaviancretu -- do you mind opening a separate issue to discuss this one? There are a few things going on in your code sample that are worth unpacking in more detail. Not sure it will make sense to do that on the call today.

@alex-frankel - I have opened #4954 with the description.

@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants