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

Latest API versions not available #2754

Closed
th0ger opened this issue May 20, 2021 · 11 comments · Fixed by #2778
Closed

Latest API versions not available #2754

th0ger opened this issue May 20, 2021 · 11 comments · Fixed by #2778
Labels
documentation Improvements or additions to documentation

Comments

@th0ger
Copy link

th0ger commented May 20, 2021

I've update all my bicep resources to the latest API versions, according to what's documented in Azure templates reference.

But one resource provider Microsoft.Authorization/roleAssignments only goes up to 2020-04-01-preview in bicep, while the roleAssignments documentation also defines 2020-08-01-preview and 2020-10-01-preview.

If using latest version I get:

Resource type "Microsoft.Authorization/roleAssignments@2020-10-01-preview" does not have types available.bicep(BCP081)

I expect the latest and greatest API versions to be always available, since it's stated: Day 0 resource provider support. Any Azure resource — whether in private or public preview or GA — can be provisioned using Bicep.

It it not clear to me, If I need to upgrade Bicep version to get latest API versions. Do they ship with Bicep? Do they ship with VS Code extension? Or are they looked up dynamically at runtime?

If this is working as intended, please consider clarifying the documentation, as I could not find anything on this subject.

@th0ger th0ger added the enhancement New feature or request label May 20, 2021
@ghost ghost added the Needs: Triage 🔍 label May 20, 2021
@alex-frankel
Copy link
Collaborator

The types get updated with new releases of the bicep extension (and CLI). We are planning to separate this so we can ship types more frequently separate from bicep releases.

I'm surprised these types are missing since they are not recent. @anthony-c-martin - is our type gen missing these? @th0ger - do you mind adding these missing types to #784?

Even if a type is missing, it is still possible to provision that resource with bicep. If a type is missing, there is less validation that we can do, but it won't block deployment. That's what we mean by Day 0 support. It's probably worth clarifying this in docs - we will take care of this.

@alex-frankel alex-frankel added documentation Improvements or additions to documentation types and removed Needs: Triage 🔍 enhancement New feature or request labels May 20, 2021
@th0ger
Copy link
Author

th0ger commented May 20, 2021

@alex-frankel thanks for the quick reply.
I'm on the latest Bicep version v.0.3.539 (both VSCode & CLI).

This is not critical, I just updated the versions to make sure Intellisense list all the latest properties.

Anyway, it's good to know that Bicep/az won't block unknown types. Especially in CI/CD context where the build server/docker image may not be fully up to date.

@jchauncey
Copy link

I have a question about private resource types. I am trying to create 1es cloud image and a 1es hosted pool but bicep is complaining. How does support for private resource types work?

╰ bicep --version                                                                                                                                        12:34:56   
Bicep CLI version 0.3.1 (d0f5c9b164)

@alex-frankel
Copy link
Collaborator

If it does not have a public swagger spec, we will not generate a type for it. It should not block deployment though.

@jchauncey
Copy link

k i havent tried a deployment yet but these are the errors/warnings im getting when i decompiled the arm template -

Error BCP017: Expected a resource identifier at this location.
Warning BCP081: Resource type "Microsoft.CloudTest/hostedpools@2020-05-07" does not have types available.

and it definitely screws up syntax highlighting in vscode because it cant find the resource type.

@alex-frankel
Copy link
Collaborator

Can you share the code sample? The warning shouldn't cause a highlighting error, but that error might be. Curious to see what is happening.

@jchauncey
Copy link

jchauncey commented May 21, 2021

nm it was the resource name causing the issues.

@alex-frankel
Copy link
Collaborator

you are not allowed to have hyphens (-) in identifier names in bicep. Ideally the decompiler would catch this and change it, but in the meantime you can change hosted-agent-pool -> hostedAgentPool and you should be good to go.

You can also change imageName: 'agent-pool-image' -> imageName: agent_pool_image.name and get rid of the dependsOn property since there will be an implied dependency.

@alex-frankel
Copy link
Collaborator

Going to close this one since the original missing type info is now captured in #784

@th0ger
Copy link
Author

th0ger commented May 21, 2021

@alex-frankel does #784 also cover the documentation update?

@alex-frankel
Copy link
Collaborator

Nope - thank you for the reminder :)

@alex-frankel alex-frankel reopened this May 21, 2021
alex-frankel added a commit that referenced this issue May 24, 2021
* Small readme tweaks, removed a known limitation

Fixes #2754

* Addressing feedback

* change wording
@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants