[Microsoft.ApiManagement/service/products/apis]: existing doesn't work
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 44
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 29
Description
### 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](https://learn.microsoft.com/en-us/rest/api/apimanagement/product-api/check-entity-exists?view=rest-apimanagement-2022-08-01&tabs=HTTP), 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
```bicep
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
- [X] I have read the troubleshooting guide and looked for duplicates.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the Bicep example for Microsoft.ApiManagement/service/products/apis@2022-08-01 and compare the existence check with the Product API check-entity-exists REST documentation. Determine whether this resource should support existing through HEAD or reject existing, then verify the dependsOn scenario and the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100