Skip to content

Commit

Permalink
fix: add displayName to more submodules (Azure#3342)
Browse files Browse the repository at this point in the history
## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes Azure#123
Fixes Azure#456
Closes Azure#123
Closes Azure#456
-->

Fixes Azure#3328 

- Add option to set displayName for authorizationserver, product,
subscription resources

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.api-management.service](https://github.com/tony-box/bicep-registry-modules/actions/workflows/avm.res.api-management.service.yml/badge.svg?branch=feat%2Fapim_apiupdate)](https://github.com/tony-box/bicep-registry-modules/actions/workflows/avm.res.api-management.service.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [x] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Tony Box <[email protected]>
  • Loading branch information
tony-box and Tony Box authored Sep 30, 2024
1 parent 720edc0 commit 2a43532
Show file tree
Hide file tree
Showing 28 changed files with 194 additions and 87 deletions.
12 changes: 12 additions & 0 deletions avm/res/api-management/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
clientId: 'apimclientid'
clientRegistrationEndpoint: 'http://localhost'
clientSecret: '<clientSecret>'
displayName: 'AuthServer1'
grantTypes: [
'authorizationCode'
]
Expand Down Expand Up @@ -404,6 +405,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
}
]
approvalRequired: false
displayName: 'Starter'
groups: [
{
name: 'developers'
Expand Down Expand Up @@ -436,6 +438,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
subnetResourceId: '<subnetResourceId>'
subscriptions: [
{
displayName: 'testArmSubscriptionAllApis'
name: 'testArmSubscriptionAllApis'
scope: '/apis'
}
Expand Down Expand Up @@ -525,6 +528,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"clientId": "apimclientid",
"clientRegistrationEndpoint": "http://localhost",
"clientSecret": "<clientSecret>",
"displayName": "AuthServer1",
"grantTypes": [
"authorizationCode"
],
Expand Down Expand Up @@ -663,6 +667,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
}
],
"approvalRequired": false,
"displayName": "Starter",
"groups": [
{
"name": "developers"
Expand Down Expand Up @@ -703,6 +708,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"subscriptions": {
"value": [
{
"displayName": "testArmSubscriptionAllApis",
"name": "testArmSubscriptionAllApis",
"scope": "/apis"
}
Expand Down Expand Up @@ -837,6 +843,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
clientId: 'apimClientid'
clientRegistrationEndpoint: 'https://localhost'
clientSecret: '<clientSecret>'
displayName: 'AuthServer1'
grantTypes: [
'authorizationCode'
]
Expand Down Expand Up @@ -973,6 +980,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
]
subscriptions: [
{
displayName: 'testArmSubscriptionAllApis'
name: 'testArmSubscriptionAllApis'
scope: '/apis'
}
Expand Down Expand Up @@ -1048,6 +1056,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"clientId": "apimClientid",
"clientRegistrationEndpoint": "https://localhost",
"clientSecret": "<clientSecret>",
"displayName": "AuthServer1",
"grantTypes": [
"authorizationCode"
],
Expand Down Expand Up @@ -1212,6 +1221,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"subscriptions": {
"value": [
{
"displayName": "testArmSubscriptionAllApis",
"name": "testArmSubscriptionAllApis",
"scope": "/apis"
}
Expand Down Expand Up @@ -1927,6 +1937,8 @@ A list of availability zones denoting where the resource needs to come from. Onl

## Notes

The latest version of this module only includes supported versions of the API Management resource. All unsupported versions of API Management have been removed from the related parameters. See the [API Management stv1 platform retirement](!https://learn.microsoft.com/en-us/azure/api-management/breaking-changes/stv1-platform-retirement-august-2024) article for more details.

### Parameter Usage: `apiManagementServicePolicy`

<details>
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api-version-set/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "17159723717884761443"
"version": "0.30.23.60470",
"templateHash": "2492486199367242598"
},
"name": "API Management Service API Version Sets",
"description": "This module deploys an API Management Service API Version Set.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api/diagnostics/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15630166564208731013"
"version": "0.30.23.60470",
"templateHash": "2531959928497745895"
},
"name": "API Management Service APIs Diagnostics.",
"description": "This module deploys an API Management Service API Diagnostics.",
Expand Down
12 changes: 6 additions & 6 deletions avm/res/api-management/service/api/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "17160750790361326516"
"version": "0.30.23.60470",
"templateHash": "17036957862982683599"
},
"name": "API Management Service APIs",
"description": "This module deploys an API Management Service API.",
Expand Down Expand Up @@ -283,8 +283,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2474188503939052987"
"version": "0.30.23.60470",
"templateHash": "5643177447182050438"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy.",
Expand Down Expand Up @@ -430,8 +430,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15630166564208731013"
"version": "0.30.23.60470",
"templateHash": "2531959928497745895"
},
"name": "API Management Service APIs Diagnostics.",
"description": "This module deploys an API Management Service API Diagnostics.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api/policy/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2474188503939052987"
"version": "0.30.23.60470",
"templateHash": "5643177447182050438"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy.",
Expand Down
8 changes: 8 additions & 0 deletions avm/res/api-management/service/authorization-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This module deploys an API Management Service Authorization Server.
| [`authorizationEndpoint`](#parameter-authorizationendpoint) | string | OAuth authorization endpoint. See <http://tools.ietf.org/html/rfc6749#section-3.2>. |
| [`clientId`](#parameter-clientid) | securestring | Client or app ID registered with this authorization server. |
| [`clientSecret`](#parameter-clientsecret) | securestring | Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. |
| [`displayName`](#parameter-displayname) | string | API Management Service Authorization Servers name. Must be 1 to 50 characters long. |
| [`grantTypes`](#parameter-granttypes) | array | Form of an authorization grant, which the client uses to request the access token. - authorizationCode, implicit, resourceOwnerPassword, clientCredentials. |
| [`name`](#parameter-name) | string | Identifier of the authorization server. |

Expand Down Expand Up @@ -69,6 +70,13 @@ Client or app secret registered with this authorization server. This property wi
- Required: Yes
- Type: securestring

### Parameter: `displayName`

API Management Service Authorization Servers name. Must be 1 to 50 characters long.

- Required: Yes
- Type: string

### Parameter: `grantTypes`

Form of an authorization grant, which the client uses to request the access token. - authorizationCode, implicit, resourceOwnerPassword, clientCredentials.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata owner = 'Azure/module-maintainers'
@description('Required. Identifier of the authorization server.')
param name string

@description('Required. API Management Service Authorization Servers name. Must be 1 to 50 characters long.')
@maxLength(50)
param displayName string

@description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
param apiManagementServiceName string

Expand Down Expand Up @@ -85,7 +89,7 @@ resource authorizationServer 'Microsoft.ApiManagement/service/authorizationServe
bearerTokenSendingMethods: bearerTokenSendingMethods
resourceOwnerUsername: resourceOwnerUsername
resourceOwnerPassword: resourceOwnerPassword
displayName: name
displayName: displayName
clientRegistrationEndpoint: clientRegistrationEndpoint
authorizationEndpoint: authorizationEndpoint
grantTypes: grantTypes
Expand Down
13 changes: 10 additions & 3 deletions avm/res/api-management/service/authorization-server/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "4256977187793378377"
"version": "0.30.23.60470",
"templateHash": "17927787726774417819"
},
"name": "API Management Service Authorization Servers",
"description": "This module deploys an API Management Service Authorization Server.",
Expand All @@ -18,6 +18,13 @@
"description": "Required. Identifier of the authorization server."
}
},
"displayName": {
"type": "string",
"maxLength": 50,
"metadata": {
"description": "Required. API Management Service Authorization Servers name. Must be 1 to 50 characters long."
}
},
"apiManagementServiceName": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -154,7 +161,7 @@
"bearerTokenSendingMethods": "[parameters('bearerTokenSendingMethods')]",
"resourceOwnerUsername": "[parameters('resourceOwnerUsername')]",
"resourceOwnerPassword": "[parameters('resourceOwnerPassword')]",
"displayName": "[parameters('name')]",
"displayName": "[parameters('displayName')]",
"clientRegistrationEndpoint": "[parameters('clientRegistrationEndpoint')]",
"authorizationEndpoint": "[parameters('authorizationEndpoint')]",
"grantTypes": "[parameters('grantTypes')]",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/backend/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2365531440872951056"
"version": "0.30.23.60470",
"templateHash": "14706757128951530017"
},
"name": "API Management Service Backends",
"description": "This module deploys an API Management Service Backend.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/cache/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "3234729148013684780"
"version": "0.30.23.60470",
"templateHash": "2750555671183513052"
},
"name": "API Management Service Caches",
"description": "This module deploys an API Management Service Cache.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/identity-provider/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "12757169124799431378"
"version": "0.30.23.60470",
"templateHash": "1342690797398622979"
},
"name": "API Management Service Identity Providers",
"description": "This module deploys an API Management Service Identity Provider.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/loggers/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "12986610229102962453"
"version": "0.30.23.60470",
"templateHash": "12834599511984803283"
},
"name": "API Management Service Loggers",
"description": "This module deploys an API Management Service Logger.",
Expand Down
3 changes: 3 additions & 0 deletions avm/res/api-management/service/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ module service_authorizationServers 'authorization-server/main.bicep' = [
params: {
apiManagementServiceName: service.name
name: authorizationServer.name
displayName: authorizationServer.displayName
authorizationEndpoint: authorizationServer.authorizationEndpoint
authorizationMethods: authorizationServer.?authorizationMethods ?? ['GET']
bearerTokenSendingMethods: authorizationServer.?bearerTokenSendingMethods ?? ['authorizationHeader']
Expand Down Expand Up @@ -467,6 +468,7 @@ module service_products 'product/main.bicep' = [
for (product, index) in products: {
name: '${uniqueString(deployment().name, location)}-Apim-Product-${index}'
params: {
displayName: product.displayName
apiManagementServiceName: service.name
apis: product.?apis ?? []
approvalRequired: product.?approvalRequired ?? false
Expand All @@ -490,6 +492,7 @@ module service_subscriptions 'subscription/main.bicep' = [
params: {
apiManagementServiceName: service.name
name: subscription.name
displayName: subscription.displayName
allowTracing: subscription.?allowTracing
ownerId: subscription.?ownerId
primaryKey: subscription.?primaryKey
Expand Down
Loading

0 comments on commit 2a43532

Please sign in to comment.