Closed Tbohunek closed 1 year ago
Hi @Tbohunek ,
Thank you for taking time to report this issue!
Yes, it seems Microsoft.Compute/galleries@2021-10-01
is not embedded in this release, so it can't provide schema validation, I'll look into this and add it in the next release.
And it's not recommended to define id
, name
, identity
, tags
and type
inside the body, because there're top-level fields for these properties. Also, it seems that identifier
is not returned from the response, to disable the plan-diff, you can add ignore_missing_property=true
to the resource block.
- identifier = {
- uniqueName = "ssss-GALLERY"
} -> null
Cool, thanks @ms-henglu! ignore_missing_property=true
didn't make a difference to the plan output.
Note that I didn't define id
,name
etc in body()
, but I created the resource via az sig create
and then imported into terraform. I think the diff comes from how azapi
unaware of compute/galleries
.
I thought azapi
was completely universal for any resource type. Is that not the case? Is there a list somewhere of the supported type
s?
Hi @Tbohunek ,
ignore_missing_property=true didn't make a difference to the plan output.
I guess you need to run terraform apply
again, then azapi will update the state.
I thought azapi was completely universal for any resource type. Is that not the case? Is there a list somewhere of the supported types?
azapi can work without resource type schema, but some features can't be used, for example body validation, remove the unnecessary field when import the resource. We update the embedded schema every month, ideally it will have every resource type that you want to use.
If you want to see the list, you can check the changelog, for example, v0.5.0: https://github.com/ms-henglu/bicep-types-az/tree/813d8bbc9ecf432a2a0ff2769627592fae34369f/generated. And strongly recommended to install AzApi VSCode Extension, it provides a rich authoring experience to help you use the AzApi provider.
Thank you @ms-henglu for explanations. Clear. Looking forward to new provider release. :)
I didn't run terraform apply
yet as I don't want to break things. I'll wait for provider update.
I tried the azapi
extension, however it's not usable now because it breaks the color-coding from terraform
extension from Anton Kulikov. Check that out to see if you can adjust your extension to work together.
I'll close this issue since it's resolved, please feel free to reopen it, thanks!
I can't create Compute Gallery with Azapi. Schema validation fails:
Disabling validation results in the body not parsed properly:
Import worked. Config is minimal for the moment.