二头肌API管理多个产品
我正在使用二头肌文件创建API管理,但是当我尝试创建一个产品时,仅当我在模板中仅创建一个产品时才能起作用。是否有某种方式创建与API管理相关的多个产品的方法,以下是示例批准
resource apim 'Microsoft.ApiManagement/service@2021-08-01' existing = {
name: 'apim'
}
resource lambdaStoreApi 'Microsoft.ApiManagement/service/apis@2020-12-01' = {
name: 'api'
parent: apim
properties:{
format: 'swagger-json'
value: loadTextContent('./swagger.json')
path: 'path'
}
}
resource product1 'Microsoft.ApiManagement/service/products@2020-12-01' = {
name: '${apim.name}/product1'
properties: {
displayName: 'displayName'
description: 'description'
subscriptionRequired: true
approvalRequired: false
state: 'published'
}
}
resource product2 'Microsoft.ApiManagement/service/products@2020-12-01' = {
name: '${apim.name}/product2'
properties: {
displayName: 'displayName'
description: 'description'
subscriptionRequired: true
approvalRequired: false
state: 'published'
}
}
我会出现错误“已经存在相同名称的产品” ,但前提是我尝试使用超过1个产品。
有什么方法可以使用多个产品创建?
I'm creating a api managment using bicep files, but when i try to create a products it works only when i created just one in the template. Is there somehow a way to create multiple products related with api management, below is the sample approch
resource apim 'Microsoft.ApiManagement/service@2021-08-01' existing = {
name: 'apim'
}
resource lambdaStoreApi 'Microsoft.ApiManagement/service/apis@2020-12-01' = {
name: 'api'
parent: apim
properties:{
format: 'swagger-json'
value: loadTextContent('./swagger.json')
path: 'path'
}
}
resource product1 'Microsoft.ApiManagement/service/products@2020-12-01' = {
name: '${apim.name}/product1'
properties: {
displayName: 'displayName'
description: 'description'
subscriptionRequired: true
approvalRequired: false
state: 'published'
}
}
resource product2 'Microsoft.ApiManagement/service/products@2020-12-01' = {
name: '${apim.name}/product2'
properties: {
displayName: 'displayName'
description: 'description'
subscriptionRequired: true
approvalRequired: false
state: 'published'
}
}
I am getting error "Product with the same name already exists", but only if I try with more than 1 product.
Is there some way to create with more than one product?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看:
displayName
(产品名称)也必须是唯一的。您只需要给这个属性一个独特的价值:Looking at the documentation:
The
displayName
(product name) also have to be unique. You just need to give this property a unique value: