Skip to content

Commit

Permalink
Merge branch 'main' into container-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
oZakari authored Jan 29, 2024
2 parents a25aabe + ee0c549 commit 4270fec
Show file tree
Hide file tree
Showing 448 changed files with 2,594 additions and 2,605 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"features": {
"azure-cli": "latest",
"dotnet": "7.0",
"ghcr.io/devcontainers/features/node:1": "none"
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/powershell:1": {}
}
}
19 changes: 10 additions & 9 deletions .github/ISSUE_TEMPLATE/avm_module_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ body:
description: Which existing AVM module is this issue related to?
options:
- "Other, as defined below..."
# - "avm/ptn/avd-lza/insights"
# - "avm/ptn/avd-lza/management-plane"
# - "avm/ptn/avd-lza/networking"
# - "avm/ptn/avd-lza/session-hosts"
# - "avm/ptn/security/security-center"
# - "avm/res/aad/domain-service"
- "avm/res/analysis-services/server"
- "avm/res/api-management/service"
# - "avm/res/app-configuration/configuration-store"
# - "avm/res/app/container-app"
- "avm/res/app/managed-environment"
# - "avm/res/app-configuration/configuration-store"
- "avm/res/automation/automation-account"
- "avm/res/batch/batch-account"
- "avm/res/cache/redis"
Expand All @@ -63,10 +68,10 @@ body:
# - "avm/res/container-instance/container-group"
- "avm/res/container-registry/registry"
- "avm/res/container-service/managed-cluster"
- "avm/res/databricks/access-connector"
- "avm/res/databricks/workspace"
- "avm/res/data-factory/factory"
- "avm/res/data-protection/backup-vault"
- "avm/res/databricks/access-connector"
- "avm/res/databricks/workspace"
- "avm/res/db-for-my-sql/flexible-server"
- "avm/res/db-for-postgre-sql/flexible-server"
# - "avm/res/desktop-virtualization/application-group"
Expand Down Expand Up @@ -168,11 +173,7 @@ body:
- "avm/res/web/serverfarm"
- "avm/res/web/site"
- "avm/res/web/static-site"
# - "avm/ptn/avd-lza/insights"
# - "avm/ptn/avd-lza/management-plane"
# - "avm/ptn/avd-lza/networking"
# - "avm/ptn/avd-lza/session-hosts"
# - "avm/ptn/security/security-center"

validations:
required: true
- type: input
Expand Down Expand Up @@ -201,6 +202,6 @@ body:
id: correlation-id
attributes:
label: (Optional) Correlation Id
description: Please provide a correlation id f available and appropriate.
description: Please provide a correlation id if available and appropriate.
validations:
required: false
77 changes: 41 additions & 36 deletions .github/actions/templates/avm-validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,32 @@
## ACTION PARAMETERS ##
##-------------------------------------------##
##
## |=====================================================================================================================================================================================|
## | Parameter | Required | Default | Description | Example |
## |---------------------------|----------|---------|-------------------------------------------------------|----------------------------------------------------------------------------|
## | templateFilePath | true | '' | The path to the template file to use for deployment | 'modules/api-management/service/main.bicep' |
## | location | true | '' | The location to use for deployment | 'WestEurope' |
## | subscriptionId | false | '' | The subscriptionId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | managementGroupId | false | '' | The managementGroupId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | customTokens | false | '' | Additional token pairs in json format. | '{"tokenName":"tokenValue"}' |
## | removeDeployment | false | 'true' | Set "true" to set module up for removal | 'true' |
## |=====================================================================================================================================================================================|
## |======================================================================================================================================================================================|
## | Parameter | Required | Default | Description | Example |
## |----------------------------|----------|---------|-------------------------------------------------------|----------------------------------------------------------------------------|
## | modulePath | true | '' | The path to the module file directory | 'modules/api-management/service/main.bicep'
## | templateFilePath | true | '' | The path to the template file to use for deployment | 'modules/api-management/service/tests/e2e/maix/main.test.bicep' |
## | deploymentMetadataLocation | true | '' | The location to store the deployment metadata | 'WestEurope' |
## | subscriptionId | false | '' | The subscriptionId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | managementGroupId | false | '' | The managementGroupId to deploy to | '1a97b80a-4dda-4f50-ab53-349e29344654' |
## | customTokens | false | '' | Additional token pairs in json format. | '{"tokenName":"tokenValue"}' |
## | removeDeployment | false | 'true' | Set "true" to set module up for removal | 'true' |
## |======================================================================================================================================================================================|
##
#########################################################

name: "Deploy module"
description: "Deploy module"

inputs:
modulePath:
descriptio: "The path to the module file directory used to determine the resource location"
required: true
templateFilePath:
description: "The path to the template file to use for deployment"
required: true
location:
description: "The location to use for deployment"
deploymentMetadataLocation:
description: "The location to store the deployment metadata"
required: true
subscriptionId:
description: "The subscription ID to deploy to"
Expand All @@ -59,8 +63,8 @@ runs:

# [Set Deployment Location] task(s)
# ---------------------------
- name: "Get Deployment Location"
id: get-deployment-location
- name: "Get Resource Location"
id: get-resource-location
uses: azure/powershell@v1
with:
azPSVersion: "latest"
Expand All @@ -69,22 +73,22 @@ runs:
Write-Output '::group::Get Recommended Regions'
# Load used functions
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'e2eValidation' 'regionSelector' 'Get-AzDeploymentRegion.ps1')
. (Join-Path $env:GITHUB_WORKSPACE 'avm' 'utilities' 'pipelines' 'e2eValidation' 'regionSelector' 'Get-AzAvailableResourceLocation.ps1')
# Set fucntion input parameters
$functionInput = @{
usePairedRegionsOnly = $true
useKnownRegionsOnly = $true
ModuleRoot = '${{ inputs.modulePath }}'
GlobalResourceGroupLocation = '${{ inputs.deploymentMetadataLocation }}'
}
Write-Verbose "Invoke function with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
$location = Get-AzDeploymentRegion @functionInput
$resourceLocation = Get-AzAvailableResourceLocation @functionInput -Verbose
$deploymentLocation = @{}
Write-Verbose ('{0}-{1}' -f 'deploymentLocation', $location) -Verbose
Write-Output ('{0}={1}' -f 'deploymentLocation', $location) >> $env:GITHUB_OUTPUT
Write-Verbose ('{0}-{1}' -f 'resourceLocation', $resourceLocation) -Verbose
Write-Output ('{0}={1}' -f 'resourceLocation', $resourceLocation) >> $env:GITHUB_OUTPUT
Write-Output '::endgroup::'
Expand Down Expand Up @@ -170,7 +174,6 @@ runs:
# Prepare general parameters
# --------------------------
# Fetching parameters
$location = '${{ steps.get-deployment-location.outputs.deploymentLocation }}'
$subscriptionId = '${{ inputs.subscriptionId }}'
$managementGroupId = '${{ inputs.managementGroupId }}'
Expand All @@ -189,12 +192,14 @@ runs:
# Invoke validation #
# ----------------- #
$functionInput = @{
TemplateFilePath = $moduleTestFilePath
Location = $location
SubscriptionId = $subscriptionId
ManagementGroupId = $managementGroupId
AdditionalParameters = @{}
RepoRoot = $env:GITHUB_WORKSPACE
TemplateFilePath = $moduleTestFilePath
DeploymentMetadataLocation = '${{ inputs.deploymentMetadataLocation }}'
SubscriptionId = $subscriptionId
ManagementGroupId = $managementGroupId
RepoRoot = $env:GITHUB_WORKSPACE
AdditionalParameters = @{
resourceLocation = '${{ steps.get-resource-location.outputs.resourceLocation }}'
}
}
Write-Verbose 'Invoke task with' -Verbose
Expand All @@ -220,7 +225,6 @@ runs:
# Prepare general parameters
# --------------------------
$location ='${{ steps.get-deployment-location.outputs.deploymentLocation }}'
$subscriptionId = '${{ inputs.subscriptionId }}'
$managementGroupId = '${{ inputs.managementGroupId }}'
Expand All @@ -239,16 +243,17 @@ runs:
# Invoke deployment #
# ----------------- #
$functionInput = @{
TemplateFilePath = $moduleTestFilePath
Location = $location
SubscriptionId = $subscriptionId
ManagementGroupId = $managementGroupId
DoNotThrow = $true
RepoRoot = $env:GITHUB_WORKSPACE
AdditionalParameters = @{}
TemplateFilePath = $moduleTestFilePath
DeploymentMetadataLocation = '${{ inputs.deploymentMetadataLocation }}'
SubscriptionId = $subscriptionId
ManagementGroupId = $managementGroupId
DoNotThrow = $true
RepoRoot = $env:GITHUB_WORKSPACE
AdditionalParameters = @{
resourceLocation = '${{ steps.get-resource-location.outputs.resourceLocation }}'
}
}
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you haven't already, read the full [contribution guide](https://github.com/Azure/bicep-registry-modules/blob/main/CONTRIBUTING.md). The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, edit the PR description and run through the relevant checklist below.

Enable GitHub Worksflows in your fork to enable auto-generation of assets with our [GitHub Action](/.github/workflows/push-auto-generate.yml).
Enable GitHub Workflows in your fork to enable auto-generation of assets with our [GitHub Action](/.github/workflows/push-auto-generate.yml).
To trigger GitHub Actions after auto-generation, [add a GitHub PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) as a secret in your forked repository called `PAT`.

## Adding a new module
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/avm.template.module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ jobs:
- name: "Run deployment validation with test file [${{ matrix.testCases.path }}]"
uses: ./.github/actions/templates/avm-validateModuleDeployment
with:
modulePath: "${{ inputs.modulePath }}"
templateFilePath: "${{ inputs.modulePath }}/${{ matrix.testCases.path }}"
deploymentMetadataLocation: "WestEurope"
subscriptionId: "${{ secrets.ARM_SUBSCRIPTION_ID }}"
managementGroupId: "${{ secrets.ARM_MGMTGROUP_ID }}"
removeDeployment: "${{ fromJson(inputs.workflowInput).removeDeployment }}"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.netrc
moduleIndex.json
moduleIndex.json
.DS_Store
6 changes: 3 additions & 3 deletions avm/res/analysis-services/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This instance deploys the module with the minimum set of required parameters.

```bicep
module server 'br/public:avm/res/analysis-services/server:<version>' = {
name: '${uniqueString(deployment().name, location)}-test-assmin'
name: '${uniqueString(deployment().name, resourceLocation)}-test-assmin'
params: {
// Required parameters
name: 'assmin'
Expand Down Expand Up @@ -96,7 +96,7 @@ This instance deploys the module with most of its features enabled.

```bicep
module server 'br/public:avm/res/analysis-services/server:<version>' = {
name: '${uniqueString(deployment().name, location)}-test-assmax'
name: '${uniqueString(deployment().name, resourceLocation)}-test-assmax'
params: {
// Required parameters
name: 'assmax'
Expand Down Expand Up @@ -278,7 +278,7 @@ This instance deploys the module in alignment with the best-practices of the Azu

```bicep
module server 'br/public:avm/res/analysis-services/server:<version>' = {
name: '${uniqueString(deployment().name, location)}-test-asswaf'
name: '${uniqueString(deployment().name, resourceLocation)}-test-asswaf'
params: {
// Required parameters
name: 'asswaf'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata description = 'This instance deploys the module with the minimum set of
param resourceGroupName string = 'dep-${namePrefix}-analysisservices.servers-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = 'northeurope'
param resourceLocation string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'assmin'
Expand All @@ -28,7 +28,7 @@ param namePrefix string = '#_namePrefix_#'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
location: resourceLocation
}

// ============== //
Expand All @@ -38,9 +38,9 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}'
location: location
location: resourceLocation
}
}]
16 changes: 8 additions & 8 deletions avm/res/analysis-services/server/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata description = 'This instance deploys the module with most of its featur
param resourceGroupName string = 'dep-${namePrefix}-analysisservices.servers-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = 'northeurope'
param resourceLocation string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'assmax'
Expand All @@ -28,29 +28,29 @@ param namePrefix string = '#_namePrefix_#'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-nestedDependencies'
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: location
location: resourceLocation
}
}

// Diagnostics
// ===========
module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/templates/diagnostic.dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-diagnosticDependencies'
name: '${uniqueString(deployment().name, resourceLocation)}-diagnosticDependencies'
params: {
storageAccountName: 'dep${namePrefix}azsa${serviceShort}01'
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: location
location: resourceLocation
}
}

Expand All @@ -61,10 +61,10 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}'
location: location
location: resourceLocation
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata description = 'This instance deploys the module in alignment with the b
param resourceGroupName string = 'dep-${namePrefix}-analysisservices.servers-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = 'northeurope'
param resourceLocation string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'asswaf'
Expand All @@ -28,20 +28,20 @@ param namePrefix string = '#_namePrefix_#'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
location: resourceLocation
}

// Diagnostics
// ===========
module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/templates/diagnostic.dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-diagnosticDependencies'
name: '${uniqueString(deployment().name, resourceLocation)}-diagnosticDependencies'
params: {
storageAccountName: 'dep${namePrefix}azsa${serviceShort}01'
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: location
location: resourceLocation
}
}

Expand All @@ -52,10 +52,10 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
@batchSize(1)
module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ]: {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-test-${serviceShort}-${iteration}'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}'
location: location
location: resourceLocation
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
Expand Down
Loading

0 comments on commit 4270fec

Please sign in to comment.