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

Question on missing properties for bicep resource (Microsoft.Resources/deployments) #1391

Closed
kevball2 opened this issue Jan 27, 2021 · 3 comments
Labels
question Further information is requested

Comments

@kevball2
Copy link

Wanted to confirm an issue I was seeing.

Creating a resource object but missing some properties in the bicep IntelliSense. Is this due to an issue with the ARM API?

From ARM microsoft.resources/deployments

The resourceGroup property is unavailable in bicep. From the deploymentproperties-object the template property is not available as well though templatelink does work.

I was trying to convert the following ARM code over the bicep -

"properties": { 
                "mode": "Incremental",
                "template": {
                    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
                    "contentVersion": "1.0.0.0",
                    "resources": [
                        {
                            "type": "Microsoft.Network/virtualNetworks/subnets",
                            "apiVersion": "2019-09-01",
                            "name": "[concat(parameters('vnetName'), '/', parameters('subnetName'))]",
                            "properties": "[if(and(equals(parameters('subnetOption'), 'existing'), not(equals(parameters('privateEndpointType'), 'none'))), union(reference(variables('subnet'), '2019-09-01'), variables('subnetPolicyForPE')), json('null'))]"
                        }
                    ]
                }

I am guessing it is something with how bicep gets properties for the ARM templates correct? Is it something that Microsoft would have to fix?

Really liking the bicep language so far keep up the great work!

@ghost ghost added the Needs: Triage 🔍 label Jan 27, 2021
@kevball2 kevball2 changed the title Question on missing properties for bicep resouce (Microsoft.Resouces/deployments) Question on missing properties for bicep resource (Microsoft.Resources/deployments) Jan 27, 2021
@alex-frankel
Copy link
Collaborator

In general, if a property is missing from intellisense, it is because the swagger that defines the contract of the REST API is inaccurate in some way.

However, for this particular example, we have an issue with our type generation system that missed the subscription and resourceGroup properties of the microsoft.resources/deployments resource. We have issue #145 tracking the fix, which should be done before 0.3 releases.

You also may be able to accomplish this with modules (doc) which have a scope property that will allow you to target another resource group:
https://github.com/Azure/bicep/blob/main/docs/spec/modules.md#defining-and-configuring-module-scopes

@alex-frankel alex-frankel added question Further information is requested and removed Needs: Triage 🔍 labels Jan 27, 2021
@kevball2
Copy link
Author

kevball2 commented Feb 3, 2021

In general, if a property is missing from intellisense, it is because the swagger that defines the contract of the REST API is inaccurate in some way.

However, for this particular example, we have an issue with our type generation system that missed the subscription and resourceGroup properties of the microsoft.resources/deployments resource. We have issue #145 tracking the fix, which should be done before 0.3 releases.

You also may be able to accomplish this with modules (doc) which have a scope property that will allow you to target another resource group:
https://github.com/Azure/bicep/blob/main/docs/spec/modules.md#defining-and-configuring-module-scopes

Thanks Alex,
For now, I just omitted that section of the ARM template that I was converting. I'll watch the #145 issue and try adding in the section again once that one is resolved.

@alex-frankel
Copy link
Collaborator

Closing now that #145 is done

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

No branches or pull requests

2 participants