Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
83 stars 26 forks source link

[Microsoft.ApiManagement/service/products/apis]: existing doesn't work #2145

Open scrocquesel-ml150 opened 4 months ago

scrocquesel-ml150 commented 4 months ago

Resource Type

Microsoft.ApiManagement/service/products/apis

Api Version

2022-08-01

Issue Type

Other

Other Notes

Follow-up from https://github.com/Azure/bicep/discussions/13933:

resource productApi 'Microsoft.ApiManagement/service/products/apis@2022-08-01' existing = {
}

This fails during deployment with the error message: "The requested resource does not support the HTTP method 'GET'."

I aim for the deployment to execute a read operation to confirm the resource's existence and then use it in a dependsOn clause for another resource.

According to the documentation, there is no GET operation available as the resource lacks properties. A HEAD request should be possible.

Either Bicep should somehow generate a HEAD request, or it should prohibit the use of existing in this scenario.

Bicep Repro

resource apim 'Microsoft.ApiManagement/service@2022-08-01' existing = {
  name: 'myapim'

  resource product 'products' existing = {
    name: 'myproduct'
  }
}

resource productApi 'Microsoft.ApiManagement/service/products/apis@2022-08-01' existing ={
  parent: apim::product
  name: 'apiName'
}

resource xx 'zzz' = {
    name: 'foo'
    dependsOn: [
        productApi
    ]
} 

Confirm

microsoft-github-policy-service[bot] commented 3 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adrianhall, @KedarJoshi. Please see https://aka.ms/biceptypesinfo for troubleshooting help.