Microsoft.ApiManagement/service/workspaces/apis/policies: "name" has to be equal to "policy"
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 44
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 29
Description
### Resource Type
Microsoft.ApiManagement/service/workspaces/apis/policies
### Api Version
2023-03-01-preview
### Issue Type
Confusing error message on deployment
### Other Notes
When I try to deploy a policy with bicep it just throws:
```
[{"code":"BadRequest","message":""}]
```
After a lot of trial and error I got it working after changing the "name" property to "policy". I can't imagine this being intended. If it is please provide a more accurate error message.
### Bicep Repro
resource policy 'Microsoft.ApiManagement/service/workspaces/apis/policies@2023-03-01-preview' = {
name: 'anyNameOtherThanPolicyFails'
parent: api
properties: {
value: loadTextContent('jwt-policy.xml')
format: 'rawxml'
}
}
### Confirm
- [X] I have read the troubleshooting guide and looked for duplicates.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the TypeScript definition for Microsoft.ApiManagement/service/workspaces/apis/policies at API version 2023-03-01-preview, then reproduce the deployment using the Bicep example and its policy resource name. Determine whether the definition documents or validates the required name; done means the restriction is accurately represented or the deployment reports a useful error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100