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

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

Open
1 task done
scrocquesel-ml150 opened this issue May 3, 2024 · 1 comment
Open
1 task done

Comments

@scrocquesel-ml150
Copy link

Resource Type

Microsoft.ApiManagement/service/products/apis

Api Version

2022-08-01

Issue Type

Other

Other Notes

Follow-up from Azure/bicep#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

  • I have read the troubleshooting guide and looked for duplicates.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants