Skip to content

Commit

Permalink
feat: enables developer portal for avm/res/api-management/service (#…
Browse files Browse the repository at this point in the history
…4358)

## Description

The developer portal can be enabled on an API Management.

Closes #4353 

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.api-management.service](https://github.com/ReneHezser/bicep-registry-modules/actions/workflows/avm.res.api-management.service.yml/badge.svg?branch=api-management-dev-portal)](https://github.com/ReneHezser/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:
- [ ] 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.
- [x] 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`.
  - [ ] 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

---------

Co-authored-by: Alexander Sehr <[email protected]>
  • Loading branch information
ReneHezser and AlexanderSehr authored Feb 3, 2025
1 parent 3ce4603 commit cc74059
Show file tree
Hide file tree
Showing 22 changed files with 121 additions and 88 deletions.
21 changes: 20 additions & 1 deletion avm/res/api-management/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This module deploys an API Management Service. The default deployment is set to

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.ApiManagement/service` | [2023-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ApiManagement/2023-05-01-preview/service) |
| `Microsoft.ApiManagement/service` | [2024-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ApiManagement/2024-05-01/service) |
| `Microsoft.ApiManagement/service/apis` | [2022-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ApiManagement/2022-08-01/service/apis) |
| `Microsoft.ApiManagement/service/apis/diagnostics` | [2022-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ApiManagement/2022-08-01/service/apis/diagnostics) |
| `Microsoft.ApiManagement/service/apis/policies` | [2022-08-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.ApiManagement/2022-08-01/service/apis/policies) |
Expand Down Expand Up @@ -223,6 +223,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
publisherEmail: '[email protected]'
publisherName: 'az-amorg-x-001'
// Non-required parameters
enableDeveloperPortal: true
location: '<location>'
sku: 'Developer'
}
Expand Down Expand Up @@ -252,6 +253,9 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"value": "az-amorg-x-001"
},
// Non-required parameters
"enableDeveloperPortal": {
"value": true
},
"location": {
"value": "<location>"
},
Expand All @@ -277,6 +281,7 @@ param name = 'apisdev001'
param publisherEmail = '[email protected]'
param publisherName = 'az-amorg-x-001'
// Non-required parameters
param enableDeveloperPortal = true
param location = '<location>'
param sku = 'Developer'
```
Expand Down Expand Up @@ -1027,6 +1032,7 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
publisherEmail: '[email protected]'
publisherName: 'az-amorg-x-001'
// Non-required parameters
enableDeveloperPortal: true
location: '<location>'
sku: 'BasicV2'
}
Expand Down Expand Up @@ -1056,6 +1062,9 @@ module service 'br/public:avm/res/api-management/service:<version>' = {
"value": "az-amorg-x-001"
},
// Non-required parameters
"enableDeveloperPortal": {
"value": true
},
"location": {
"value": "<location>"
},
Expand All @@ -1081,6 +1090,7 @@ param name = 'apisv2s001'
param publisherEmail = '[email protected]'
param publisherName = 'az-amorg-x-001'
// Non-required parameters
param enableDeveloperPortal = true
param location = '<location>'
param sku = 'BasicV2'
```
Expand Down Expand Up @@ -1768,6 +1778,7 @@ param tags = {
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
| [`disableGateway`](#parameter-disablegateway) | bool | Property only valid for an API Management service deployed in multiple locations. This can be used to disable the gateway in master region. |
| [`enableClientCertificate`](#parameter-enableclientcertificate) | bool | Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. |
| [`enableDeveloperPortal`](#parameter-enabledeveloperportal) | bool | Enable the Developer Portal. The developer portal is not supported on the Consumption SKU. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`hostnameConfigurations`](#parameter-hostnameconfigurations) | array | Custom hostname configuration of the API Management service. |
| [`identityProviders`](#parameter-identityproviders) | array | Identity providers. |
Expand Down Expand Up @@ -2067,6 +2078,14 @@ Property only meant to be used for Consumption SKU Service. This enforces a clie
- Type: bool
- Default: `False`

### Parameter: `enableDeveloperPortal`

Enable the Developer Portal. The developer portal is not supported on the Consumption SKU.

- Required: No
- Type: bool
- Default: `False`

### Parameter: `enableTelemetry`

Enable/Disable usage telemetry for module.
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.32.4.45862",
"templateHash": "6933064912114035873"
"version": "0.33.13.18514",
"templateHash": "6801592949576181154"
},
"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.32.4.45862",
"templateHash": "12163322755329801860"
"version": "0.33.13.18514",
"templateHash": "4899675580903703157"
},
"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.32.4.45862",
"templateHash": "4506327834932641473"
"version": "0.33.13.18514",
"templateHash": "11063536724422240669"
},
"name": "API Management Service APIs",
"description": "This module deploys an API Management Service API."
Expand Down Expand Up @@ -279,8 +279,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "10490034185325317076"
"version": "0.33.13.18514",
"templateHash": "8003925948340237461"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy."
Expand Down Expand Up @@ -425,8 +425,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "12163322755329801860"
"version": "0.33.13.18514",
"templateHash": "4899675580903703157"
},
"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.32.4.45862",
"templateHash": "10490034185325317076"
"version": "0.33.13.18514",
"templateHash": "8003925948340237461"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy."
Expand Down
4 changes: 2 additions & 2 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.32.4.45862",
"templateHash": "6983473596111316129"
"version": "0.33.93.31351",
"templateHash": "6804762094873651550"
},
"name": "API Management Service Authorization Servers",
"description": "This module deploys an API Management Service Authorization Server."
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.32.4.45862",
"templateHash": "3000731728856797182"
"version": "0.33.93.31351",
"templateHash": "4453336321720967633"
},
"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.32.4.45862",
"templateHash": "16830396354199134703"
"version": "0.33.93.31351",
"templateHash": "18419808380672694533"
},
"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.32.4.45862",
"templateHash": "13378170063684269324"
"version": "0.33.93.31351",
"templateHash": "13263983509172438133"
},
"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/logger/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "15370135778757304817"
"version": "0.33.93.31351",
"templateHash": "9800847829037569395"
},
"name": "API Management Service Loggers",
"description": "This module deploys an API Management Service Logger."
Expand Down
6 changes: 5 additions & 1 deletion avm/res/api-management/service/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ param subscriptions array = []
@description('Optional. Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.')
param publicIpAddressResourceId string?

@description('Optional. Enable the Developer Portal. The developer portal is not supported on the Consumption SKU.')
param enableDeveloperPortal bool = false

var authorizationServerList = !empty(authorizationServers) ? authorizationServers.secureList : []

var formattedUserAssignedIdentities = reduce(
Expand Down Expand Up @@ -224,7 +227,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT
}
}

resource service 'Microsoft.ApiManagement/service@2023-05-01-preview' = {
resource service 'Microsoft.ApiManagement/service@2024-05-01' = {
name: name
location: location
tags: tags
Expand Down Expand Up @@ -259,6 +262,7 @@ resource service 'Microsoft.ApiManagement/service@2023-05-01-preview' = {
minApiVersion: '2021-08-01'
}
restore: restore
developerPortalStatus: sku != 'Consumption' ? (enableDeveloperPortal ? 'Enabled' : 'Disabled') : null
}
}

Expand Down
Loading

0 comments on commit cc74059

Please sign in to comment.