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

[Modules] Reduce parameter names to necessary baseline #2686

Merged
merged 8 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions modules/Microsoft.ApiManagement/service/backends/deploy.bicep
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
@description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
@sys.description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
param apiManagementServiceName string

@description('Required. Backend Name.')
@sys.description('Required. Backend Name.')
param name string

@description('Optional. Backend Credentials Contract Properties.')
@sys.description('Optional. Backend Credentials Contract Properties.')
param credentials object = {}

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Backend Description.')
param backendDescription string = ''
@sys.description('Optional. Backend Description.')
param description string = ''

@description('Optional. Backend communication protocol. - http or soap.')
@sys.description('Optional. Backend communication protocol. - http or soap.')
param protocol string = 'http'

@description('Optional. Backend Proxy Contract Properties.')
@sys.description('Optional. Backend Proxy Contract Properties.')
param proxy object = {}

@description('Optional. Management Uri of the Resource in External System. This URL can be the Arm Resource ID of Logic Apps, Function Apps or API Apps.')
@sys.description('Optional. Management Uri of the Resource in External System. This URL can be the Arm Resource ID of Logic Apps, Function Apps or API Apps.')
param resourceId string = ''

@description('Optional. Backend Service Fabric Cluster Properties.')
@sys.description('Optional. Backend Service Fabric Cluster Properties.')
param serviceFabricCluster object = {}

@description('Optional. Backend Title.')
@sys.description('Optional. Backend Title.')
param title string = ''

@description('Optional. Backend TLS Properties.')
@sys.description('Optional. Backend TLS Properties.')
param tls object = {
validateCertificateChain: false
validateCertificateName: false
}

@description('Required. Runtime URL of the Backend.')
@sys.description('Required. Runtime URL of the Backend.')
param url string

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
Expand All @@ -58,7 +58,7 @@ resource backend 'Microsoft.ApiManagement/service/backends@2021-08-01' = {
parent: service
properties: {
title: !empty(title) ? title : null
description: !empty(backendDescription) ? backendDescription : null
description: !empty(description) ? description : null
resourceId: !empty(resourceId) ? resourceId : null
properties: {
serviceFabricCluster: !empty(serviceFabricCluster) ? serviceFabricCluster : null
Expand All @@ -71,11 +71,11 @@ resource backend 'Microsoft.ApiManagement/service/backends@2021-08-01' = {
}
}

@description('The resource ID of the API management service backend.')
@sys.description('The resource ID of the API management service backend.')
output resourceId string = backend.id

@description('The name of the API management service backend.')
@sys.description('The name of the API management service backend.')
output name string = backend.name

@description('The resource group the API management service backend was deployed into.')
@sys.description('The resource group the API management service backend was deployed into.')
output resourceGroupName string = resourceGroup().name
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ The following resources are required to be able to deploy this resource.

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `backendDescription` | string | `''` | Backend Description. |
| `credentials` | object | `{object}` | Backend Credentials Contract Properties. |
| `description` | string | `''` | Backend Description. |
| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
| `protocol` | string | `'http'` | Backend communication protocol. - http or soap. |
| `proxy` | object | `{object}` | Backend Proxy Contract Properties. |
Expand Down
24 changes: 12 additions & 12 deletions modules/Microsoft.ApiManagement/service/caches/deploy.bicep
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
@sys.description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
param apiManagementServiceName string

@description('Required. Identifier of the Cache entity. Cache identifier (should be either \'default\' or valid Azure region identifier).')
@sys.description('Required. Identifier of the Cache entity. Cache identifier (should be either \'default\' or valid Azure region identifier).')
param name string

@description('Required. Runtime connection string to cache. Can be referenced by a named value like so, {{<named-value>}}.')
@sys.description('Required. Runtime connection string to cache. Can be referenced by a named value like so, {{<named-value>}}.')
param connectionString string

@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
@sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Cache description.')
param cacheDescription string = ''
@sys.description('Optional. Cache description.')
param description string = ''

@description('Optional. Original uri of entity in external system cache points to.')
@sys.description('Optional. Original uri of entity in external system cache points to.')
param resourceId string = ''

@description('Required. Location identifier to use cache from (should be either \'default\' or valid Azure region identifier).')
@sys.description('Required. Location identifier to use cache from (should be either \'default\' or valid Azure region identifier).')
param useFromLocation string

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
Expand All @@ -39,18 +39,18 @@ resource cache 'Microsoft.ApiManagement/service/caches@2021-08-01' = {
name: name
parent: service
properties: {
description: !empty(cacheDescription) ? cacheDescription : null
description: !empty(description) ? description : null
connectionString: connectionString
useFromLocation: useFromLocation
resourceId: !empty(resourceId) ? resourceId : null
}
}

@description('The resource ID of the API management service cache.')
@sys.description('The resource ID of the API management service cache.')
output resourceId string = cache.id

@description('The name of the API management service cache.')
@sys.description('The name of the API management service cache.')
output name string = cache.name

@description('The resource group the API management service cache was deployed into.')
@sys.description('The resource group the API management service cache was deployed into.')
output resourceGroupName string = resourceGroup().name
2 changes: 1 addition & 1 deletion modules/Microsoft.ApiManagement/service/caches/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This module deploys an API Management Service Cache.

| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `cacheDescription` | string | `''` | Cache description. |
| `description` | string | `''` | Cache description. |
| `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). |
| `resourceId` | string | `''` | Original uri of entity in external system cache points to. |

Expand Down
28 changes: 14 additions & 14 deletions modules/Microsoft.ApiManagement/service/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ module backends_resource 'backends/deploy.bicep' = [for (backend, index) in back
params: {
apiManagementServiceName: apiManagementService.name
url: contains(backend, 'url') ? backend.url : ''
backendDescription: contains(backend, 'backendDescription') ? backend.backendDescription : ''
description: contains(backend, 'description') ? backend.description : ''
credentials: contains(backend, 'credentials') ? backend.credentials : {}
name: backend.name
protocol: contains(backend, 'protocol') ? backend.protocol : 'http'
Expand All @@ -337,7 +337,7 @@ module caches_resource 'caches/deploy.bicep' = [for (cache, index) in caches: {
name: '${uniqueString(deployment().name, location)}-Apim-Cache-${index}'
params: {
apiManagementServiceName: apiManagementService.name
cacheDescription: contains(cache, 'cacheDescription') ? cache.cacheDescription : ''
description: contains(cache, 'description') ? cache.description : ''
connectionString: cache.connectionString
name: cache.name
resourceId: contains(cache, 'resourceId') ? cache.resourceId : ''
Expand All @@ -352,16 +352,16 @@ module identityProvider_resource 'identityProviders/deploy.bicep' = [for (identi
apiManagementServiceName: apiManagementService.name
name: identityProvider.name
enableIdentityProviders: contains(identityProvider, 'enableIdentityProviders') ? identityProvider.enableIdentityProviders : false
identityProviderAllowedTenants: contains(identityProvider, 'identityProviderAllowedTenants') ? identityProvider.identityProviderAllowedTenants : []
identityProviderAuthority: contains(identityProvider, 'identityProviderAuthority') ? identityProvider.identityProviderAuthority : ''
identityProviderClientId: contains(identityProvider, 'identityProviderClientId') ? identityProvider.identityProviderClientId : ''
identityProviderClientSecret: contains(identityProvider, 'identityProviderClientSecret') ? identityProvider.identityProviderClientSecret : ''
identityProviderPasswordResetPolicyName: contains(identityProvider, 'identityProviderPasswordResetPolicyName') ? identityProvider.identityProviderPasswordResetPolicyName : ''
identityProviderProfileEditingPolicyName: contains(identityProvider, 'identityProviderProfileEditingPolicyName') ? identityProvider.identityProviderProfileEditingPolicyName : ''
identityProviderSignInPolicyName: contains(identityProvider, 'identityProviderSignInPolicyName') ? identityProvider.identityProviderSignInPolicyName : ''
identityProviderSignInTenant: contains(identityProvider, 'identityProviderSignInTenant') ? identityProvider.identityProviderSignInTenant : ''
identityProviderSignUpPolicyName: contains(identityProvider, 'identityProviderSignUpPolicyName') ? identityProvider.identityProviderSignUpPolicyName : ''
identityProviderType: contains(identityProvider, 'identityProviderType') ? identityProvider.identityProviderType : 'aad'
allowedTenants: contains(identityProvider, 'allowedTenants') ? identityProvider.allowedTenants : []
authority: contains(identityProvider, 'authority') ? identityProvider.authority : ''
clientId: contains(identityProvider, 'clientId') ? identityProvider.clientId : ''
clientSecret: contains(identityProvider, 'clientSecret') ? identityProvider.clientSecret : ''
passwordResetPolicyName: contains(identityProvider, 'passwordResetPolicyName') ? identityProvider.passwordResetPolicyName : ''
profileEditingPolicyName: contains(identityProvider, 'profileEditingPolicyName') ? identityProvider.profileEditingPolicyName : ''
signInPolicyName: contains(identityProvider, 'signInPolicyName') ? identityProvider.signInPolicyName : ''
signInTenant: contains(identityProvider, 'signInTenant') ? identityProvider.signInTenant : ''
signUpPolicyName: contains(identityProvider, 'signUpPolicyName') ? identityProvider.signUpPolicyName : ''
type: contains(identityProvider, 'type') ? identityProvider.type : 'aad'
enableDefaultTelemetry: enableReferencedModulesTelemetry
}
}]
Expand All @@ -373,7 +373,7 @@ module namedValues_resource 'namedValues/deploy.bicep' = [for (namedValue, index
displayName: namedValue.displayName
keyVault: contains(namedValue, 'keyVault') ? namedValue.keyVault : {}
name: namedValue.name
namedValueTags: contains(namedValue, 'namedValueTags') ? namedValue.namedValueTags : []
tags: contains(namedValue, 'tags') ? namedValue.tags : []
secret: contains(namedValue, 'secret') ? namedValue.secret : false
value: contains(namedValue, 'value') ? namedValue.value : newGuidValue
enableDefaultTelemetry: enableReferencedModulesTelemetry
Expand Down Expand Up @@ -408,7 +408,7 @@ module products_resource 'products/deploy.bicep' = [for (product, index) in prod
approvalRequired: contains(product, 'approvalRequired') ? product.approvalRequired : false
groups: contains(product, 'groups') ? product.groups : []
name: product.name
productDescription: contains(product, 'productDescription') ? product.productDescription : ''
description: contains(product, 'description') ? product.description : ''
state: contains(product, 'state') ? product.state : 'published'
subscriptionRequired: contains(product, 'subscriptionRequired') ? product.subscriptionRequired : false
subscriptionsLimit: contains(product, 'subscriptionsLimit') ? product.subscriptionsLimit : 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ param enableDefaultTelemetry bool = true
param enableIdentityProviders bool = false

@description('Optional. List of Allowed Tenants when configuring Azure Active Directory login. - string.')
param identityProviderAllowedTenants array = []
param allowedTenants array = []

@description('Optional. OpenID Connect discovery endpoint hostname for AAD or AAD B2C.')
param identityProviderAuthority string = ''
param authority string = ''

@description('Conditional. Client ID of the Application in the external Identity Provider. Required if identity provider is used.')
param identityProviderClientId string = ''
param clientId string = ''

@description('Conditional. Client secret of the Application in external Identity Provider, used to authenticate login request. Required if identity provider is used.')
@secure()
param identityProviderClientSecret string = ''
param clientSecret string = ''

@description('Optional. Password Reset Policy Name. Only applies to AAD B2C Identity Provider.')
#disable-next-line secure-secrets-in-params // Not a secret
param identityProviderPasswordResetPolicyName string = ''
param passwordResetPolicyName string = ''

@description('Optional. Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.')
param identityProviderProfileEditingPolicyName string = ''
param profileEditingPolicyName string = ''

@description('Optional. Signin Policy Name. Only applies to AAD B2C Identity Provider.')
param identityProviderSignInPolicyName string = ''
param signInPolicyName string = ''

@description('Optional. The TenantId to use instead of Common when logging into Active Directory.')
param identityProviderSignInTenant string = ''
param signInTenant string = ''

@description('Optional. Signup Policy Name. Only applies to AAD B2C Identity Provider.')
param identityProviderSignUpPolicyName string = ''
param signUpPolicyName string = ''

@description('Optional. Identity Provider Type identifier.')
@allowed([
Expand All @@ -45,12 +45,12 @@ param identityProviderSignUpPolicyName string = ''
'microsoft'
'twitter'
])
param identityProviderType string = 'aad'
param type string = 'aad'

@description('Required. Identity provider name.')
param name string

var isAadB2C = (identityProviderType == 'aadB2C')
var isAadB2C = (type == 'aadB2C')

resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
Expand All @@ -72,16 +72,16 @@ resource identityProvider 'Microsoft.ApiManagement/service/identityProviders@202
name: name
parent: service
properties: {
type: identityProviderType
signinTenant: identityProviderSignInTenant
allowedTenants: identityProviderAllowedTenants
authority: identityProviderAuthority
signupPolicyName: isAadB2C ? identityProviderSignUpPolicyName : null
signinPolicyName: isAadB2C ? identityProviderSignInPolicyName : null
profileEditingPolicyName: isAadB2C ? identityProviderProfileEditingPolicyName : null
passwordResetPolicyName: isAadB2C ? identityProviderPasswordResetPolicyName : null
clientId: identityProviderClientId
clientSecret: identityProviderClientSecret
type: type
signinTenant: signInTenant
allowedTenants: allowedTenants
authority: authority
signupPolicyName: isAadB2C ? signUpPolicyName : null
signinPolicyName: isAadB2C ? signInPolicyName : null
profileEditingPolicyName: isAadB2C ? profileEditingPolicyName : null
passwordResetPolicyName: isAadB2C ? passwordResetPolicyName : null
clientId: clientId
clientSecret: clientSecret
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ This module deploys API Management Service Identity Provider.
| Parameter Name | Type | Default Value | Description |
| :-- | :-- | :-- | :-- |
| `apiManagementServiceName` | string | | The name of the parent API Management service. Required if the template is used in a standalone deployment. |
| `identityProviderClientId` | string | `''` | Client ID of the Application in the external Identity Provider. Required if identity provider is used. |
| `identityProviderClientSecret` | securestring | `''` | Client secret of the Application in external Identity Provider, used to authenticate login request. Required if identity provider is used. |
| `clientId` | string | `''` | Client ID of the Application in the external Identity Provider. Required if identity provider is used. |
| `clientSecret` | securestring | `''` | Client secret of the Application in external Identity Provider, used to authenticate login request. Required if identity provider is used. |

**Optional parameters**

| Parameter Name | Type | Default Value | Allowed Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `allowedTenants` | array | `[]` | | List of Allowed Tenants when configuring Azure Active Directory login. - string. |
| `authority` | string | `''` | | OpenID Connect discovery endpoint hostname for AAD or AAD B2C. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
| `enableIdentityProviders` | bool | `False` | | Used to enable the deployment of the identityProviders child resource. |
| `identityProviderAllowedTenants` | array | `[]` | | List of Allowed Tenants when configuring Azure Active Directory login. - string. |
| `identityProviderAuthority` | string | `''` | | OpenID Connect discovery endpoint hostname for AAD or AAD B2C. |
| `identityProviderPasswordResetPolicyName` | string | `''` | | Password Reset Policy Name. Only applies to AAD B2C Identity Provider. |
| `identityProviderProfileEditingPolicyName` | string | `''` | | Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. |
| `identityProviderSignInPolicyName` | string | `''` | | Signin Policy Name. Only applies to AAD B2C Identity Provider. |
| `identityProviderSignInTenant` | string | `''` | | The TenantId to use instead of Common when logging into Active Directory. |
| `identityProviderSignUpPolicyName` | string | `''` | | Signup Policy Name. Only applies to AAD B2C Identity Provider. |
| `identityProviderType` | string | `'aad'` | `[aad, aadB2C, facebook, google, microsoft, twitter]` | Identity Provider Type identifier. |
| `passwordResetPolicyName` | string | `''` | | Password Reset Policy Name. Only applies to AAD B2C Identity Provider. |
| `profileEditingPolicyName` | string | `''` | | Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. |
| `signInPolicyName` | string | `''` | | Signin Policy Name. Only applies to AAD B2C Identity Provider. |
| `signInTenant` | string | `''` | | The TenantId to use instead of Common when logging into Active Directory. |
| `signUpPolicyName` | string | `''` | | Signup Policy Name. Only applies to AAD B2C Identity Provider. |
| `type` | string | `'aad'` | `[aad, aadB2C, facebook, google, microsoft, twitter]` | Identity Provider Type identifier. |


## Outputs
Expand Down
Loading