Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 29 additions & 13 deletions .azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,20 @@ jobs:
# INVOKE TEST #
# ----------- #
$functionInput = @{
templateFilePath = $templateFilePath
parameterFilePath = Join-Path '$(ParametersRepoRoot)' '${{ deploymentBlock.path }}'
location = '${{ parameters.location }}'
resourceGroupName = '${{ parameters.resourceGroupName }}'
subscriptionId = '${{ parameters.subscriptionId }}'
managementGroupId = '${{ parameters.managementGroupId }}'
templateFilePath = $templateFilePath
parameterFilePath = Join-Path '$(ParametersRepoRoot)' '${{ deploymentBlock.path }}'
location = '${{ parameters.location }}'
resourceGroupName = '${{ parameters.resourceGroupName }}'
subscriptionId = '${{ parameters.subscriptionId }}'
managementGroupId = '${{ parameters.managementGroupId }}'
additionalParameters = @{}
}

$projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json
if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) {
$functionInput['additionalParameters'] += @{
enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry
}
}

Write-Verbose "Invoke task with" -Verbose
Expand Down Expand Up @@ -272,13 +280,21 @@ jobs:
# INVOKE DEPLOYMENT #
# ----------------- #
$functionInput = @{
templateFilePath = $templateFilePath
parameterFilePath = Join-Path '$(parametersRepoRoot)' '${{ deploymentBlock.path }}'
location = '${{ parameters.location }}'
resourceGroupName = '${{ parameters.resourceGroupName }}'
subscriptionId = '${{ parameters.subscriptionId }}'
managementGroupId = '${{ parameters.managementGroupId }}'
doNotThrow = $true
templateFilePath = $templateFilePath
parameterFilePath = Join-Path '$(parametersRepoRoot)' '${{ deploymentBlock.path }}'
location = '${{ parameters.location }}'
resourceGroupName = '${{ parameters.resourceGroupName }}'
subscriptionId = '${{ parameters.subscriptionId }}'
managementGroupId = '${{ parameters.managementGroupId }}'
doNotThrow = $true
additionalParameters = @{}
}

$projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json
if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) {
$functionInput['additionalParameters'] += @{
enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry
}
}

Write-Verbose "Invoke task with" -Verbose
Expand Down
42 changes: 29 additions & 13 deletions .github/actions/templates/validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,20 @@ runs:
# INVOKE TEST #
# ----------- #
$functionInput = @{
templateFilePath = '${{ inputs.templateFilePath }}'
parameterFilePath = '${{ inputs.parameterFilePath }}'
location = '${{ inputs.location }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
subscriptionId = '${{ inputs.subscriptionId }}'
managementGroupId = '${{ inputs.managementGroupId }}'
templateFilePath = '${{ inputs.templateFilePath }}'
parameterFilePath = '${{ inputs.parameterFilePath }}'
location = '${{ inputs.location }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
subscriptionId = '${{ inputs.subscriptionId }}'
managementGroupId = '${{ inputs.managementGroupId }}'
additionalParameters = @{}
}

$projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json
if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) {
$functionInput['additionalParameters'] += @{
enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry
}
}

Write-Verbose "Invoke task with" -Verbose
Expand All @@ -172,13 +180,21 @@ runs:
. (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceDeployment' 'New-ModuleDeployment.ps1')

$functionInput = @{
templateFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.templateFilePath }}'
parameterFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.parameterFilePath }}'
location = '${{ inputs.location }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
subscriptionId = '${{ inputs.subscriptionId }}'
managementGroupId = '${{ inputs.managementGroupId }}'
doNotThrow = $true
templateFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.templateFilePath }}'
parameterFilePath = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.parameterFilePath }}'
location = '${{ inputs.location }}'
resourceGroupName = '${{ inputs.resourceGroupName }}'
subscriptionId = '${{ inputs.subscriptionId }}'
managementGroupId = '${{ inputs.managementGroupId }}'
doNotThrow = $true
additionalParameters = @{}
}

$projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json
if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) {
$functionInput['additionalParameters'] += @{
enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry
}
}

Write-Verbose "Invoke task with" -Verbose
Expand Down
10 changes: 5 additions & 5 deletions arm/.global/global.module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -600,16 +600,16 @@ Describe 'Deployment template tests' -Tag Template {
$moduleFolderName,
$templateContent
)
$CuaIDFlag = @()
$enableDefaultTelemetryFlag = @()
$Schemaverion = $templateContent.'$schema'
if ((($Schemaverion.Split('/')[5]).Split('.')[0]) -eq (($RGdeployment.Split('/')[5]).Split('.')[0])) {
if (($templateContent.resources.type -ccontains 'Microsoft.Resources/deployments' -and $templateContent.resources.condition -like "*[not(empty(parameters('cuaId')))]*") -or ($templateContent.resources.resources.type -ccontains 'Microsoft.Resources/deployments' -and $templateContent.resources.resources.condition -like "*[not(empty(parameters('cuaId')))]*")) {
$CuaIDFlag += $true
if (($templateContent.resources.type -ccontains 'Microsoft.Resources/deployments' -and $templateContent.resources.condition -like "*[parameters('enableDefaultTelemetry')]*") -or ($templateContent.resources.resources.type -ccontains 'Microsoft.Resources/deployments' -and $templateContent.resources.resources.condition -like "*[parameters('enableDefaultTelemetry')]*")) {
$enableDefaultTelemetryFlag += $true
} else {
$CuaIDFlag += $false
$enableDefaultTelemetryFlag += $false
}
}
$CuaIDFlag | Should -Not -Contain $false
$enableDefaultTelemetryFlag | Should -Not -Contain $false
}

It "[<moduleFolderName>] The Location should be defined as a parameter, with the default value of 'resourceGroup().Location' or global for ResourceGroup deployment scope" -TestCases $deploymentFolderTestCases {
Expand Down

This file was deleted.

17 changes: 12 additions & 5 deletions arm/Microsoft.AnalysisServices/servers/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ param roleAssignments array = []
@description('Optional. Tags of the resource.')
param tags object = {}

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. The name of logs that will be streamed.')
@allowed([
Expand Down Expand Up @@ -93,9 +93,16 @@ var diagnosticsMetrics = [for metric in metricsToEnable: {
}
}]

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource server 'Microsoft.AnalysisServices/servers@2017-08-01' = {
Expand Down
2 changes: 1 addition & 1 deletion arm/Microsoft.AnalysisServices/servers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ The following resources are required to be able to deploy this resource.

| Parameter Name | Type | Default Value | Possible Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `cuaId` | string | | | Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered |
| `diagnosticEventHubAuthorizationRuleId` | string | | | Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | | | Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogsRetentionInDays` | int | `365` | | Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticStorageAccountId` | string | | | Optional. Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | | | Optional. Resource ID of the diagnostic log analytics workspace. |
| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `firewallSettings` | object | `{object}` | | Optional. The inbound firewall rules to define on the server. If not specified, firewall is disabled. |
| `location` | string | `[resourceGroup().location]` | | Optional. Location for all Resources. |
| `lock` | string | `NotSpecified` | `[CanNotDelete, NotSpecified, ReadOnly]` | Optional. Specify the type of lock. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ param clientIdSecretName string
@description('Required. Name of the secret that stores the 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.')
param clientSecretSecretName string

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.')
param defaultScope string = ''
Expand Down Expand Up @@ -66,9 +66,16 @@ var defaultAuthorizationMethods = [
]
var setAuthorizationMethods = union(authorizationMethods, defaultAuthorizationMethods)

module pid_cuaId '../authorizationServers/.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource keyVault 'Microsoft.KeyVault/vaults@2019-09-01' existing = {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"publisherName": {
"value": "<<namePrefix>>-az-amorg-x-001"
},
"cuaId": {
"value": "00000-0-000000"
},
"apis": {
"value": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"publisherName": {
"value": "<<namePrefix>>-az-amorg-x-001"
},
"cuaId": {
"value": "00000-0-000000"
},
"portalSettings": {
"value": [
{
Expand Down

This file was deleted.

17 changes: 12 additions & 5 deletions arm/Microsoft.ApiManagement/service/apiVersionSets/deploy.bicep
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
@description('Required. The name of the of the API Management service.')
param apiManagementServiceName string

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. API Version set name')
param name string = 'default'

@description('Optional. API Version set properties')
param properties object = {}

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource service 'Microsoft.ApiManagement/service@2021-08-01' existing = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This module deploys API Management Service APIs Version Set.
| Parameter Name | Type | Default Value | Possible Values | Description |
| :-- | :-- | :-- | :-- | :-- |
| `apiManagementServiceName` | string | | | Required. The name of the of the API Management service. |
| `cuaId` | string | | | Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered |
| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `name` | string | `default` | | Optional. API Version set name |
| `properties` | object | `{object}` | | Optional. API Version set properties |

Expand Down

This file was deleted.

17 changes: 12 additions & 5 deletions arm/Microsoft.ApiManagement/service/apis/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ param apiVersionDescription string = ''
@description('Optional. Collection of authentication settings included into this API.')
param authenticationSettings object = {}

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Description of the API. May include HTML formatting tags.')
param apiDescription string = ''
Expand Down Expand Up @@ -94,9 +94,16 @@ param value string = ''
@description('Optional. Criteria to limit import of WSDL to a subset of the document.')
param wsdlSelector object = {}

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource service 'Microsoft.ApiManagement/service@2021-08-01' existing = {
Expand Down

This file was deleted.

17 changes: 12 additions & 5 deletions arm/Microsoft.ApiManagement/service/apis/policies/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ param apiName string
@description('Optional. The name of the policy')
param name string = 'policy'

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''
@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).')
param enableDefaultTelemetry bool = true

@description('Optional. Format of the policyContent.')
@allowed([
Expand All @@ -22,9 +22,16 @@ param format string = 'xml'
@description('Required. Contents of the Policy as defined by the format.')
param value string

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
name: 'pid-${cuaId}'
params: {}
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
}
}
}

resource service 'Microsoft.ApiManagement/service@2021-08-01' existing = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module deploys API Management Service APIs policies.
| :-- | :-- | :-- | :-- | :-- |
| `apiManagementServiceName` | string | | | Required. The name of the of the API Management service. |
| `apiName` | string | | | Required. The name of the of the API. |
| `cuaId` | string | | | Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered |
| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `format` | string | `xml` | `[rawxml, rawxml-link, xml, xml-link]` | Optional. Format of the policyContent. |
| `name` | string | `policy` | | Optional. The name of the policy |
| `value` | string | | | Required. Contents of the Policy as defined by the format. |
Expand Down
4 changes: 2 additions & 2 deletions arm/Microsoft.ApiManagement/service/apis/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ The following resources are required to be able to deploy this resource.
| `apiVersionDescription` | string | | | Optional. Description of the API Version. |
| `apiVersionSetId` | string | | | Optional. Indicates the Version identifier of the API version set |
| `authenticationSettings` | object | `{object}` | | Optional. Collection of authentication settings included into this API. |
| `cuaId` | string | | | Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered |
| `displayName` | string | | | Required. API name. Must be 1 to 300 characters long. |
| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). |
| `format` | string | `openapi` | `[wadl-xml, wadl-link-json, swagger-json, swagger-link-json, wsdl, wsdl-link, openapi, openapi+json, openapi-link, openapi+json-link]` | Optional. Format of the Content in which the API is getting imported. |
| `isCurrent` | bool | `True` | | Optional. Indicates if API revision is current API revision. |
| `name` | string | | | Required. API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. |
Expand All @@ -39,7 +39,7 @@ The following resources are required to be able to deploy this resource.
| `serviceUrl` | string | | | Optional. Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. |
| `sourceApiId` | string | | | Optional. API identifier of the source API. |
| `subscriptionKeyParameterNames` | object | `{object}` | | Optional. Protocols over which API is made available. |
| `subscriptionRequired` | bool | | | Optional. Specifies whether an API or Product subscription is required for accessing the API. |
| `subscriptionRequired` | bool | `False` | | Optional. Specifies whether an API or Product subscription is required for accessing the API. |
| `type` | string | `http` | `[http, soap]` | Optional. Type of API. |
| `value` | string | | | Optional. Content value when Importing an API. |
| `wsdlSelector` | object | `{object}` | | Optional. Criteria to limit import of WSDL to a subset of the document. |
Expand Down

This file was deleted.

Loading