Skip to content

Commit

Permalink
fix: Entra and Local Auth failure `avm/res/db for postgre sql/flexibl…
Browse files Browse the repository at this point in the history
…e server` (#3346)

## Description

Closes #3257 

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.db-for-postgre-sql.flexible-server](https://github.com/arnoldna/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml/badge.svg?branch=avm%2Fres%2Fdb-for-postgre-sql%2Fflexible-server)](https://github.com/arnoldna/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.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: Alexander Sehr <[email protected]>
Co-authored-by: Axel B. Andersen <[email protected]>
Co-authored-by: Javier Cevallos <[email protected]>
Co-authored-by: John <[email protected]>
Co-authored-by: Máté Barabás <[email protected]>
Co-authored-by: hundredacres <[email protected]>
Co-authored-by: Rainer Halanek <[email protected]>
Co-authored-by: JFolberth <[email protected]>
Co-authored-by: René Hézser <[email protected]>
Co-authored-by: Fabio Masciotra <[email protected]>
Co-authored-by: Erika Gressi <[email protected]>
Co-authored-by: Peter Budai <[email protected]>
  • Loading branch information
13 people authored Sep 24, 2024
1 parent ae8eb14 commit 4a052e8
Show file tree
Hide file tree
Showing 69 changed files with 6,118 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/avm/ptn/authorization/policy-assignment/ @Azure/avm-ptn-authorization-policyassignment-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/ptn/authorization/resource-role-assignment/ @Azure/avm-ptn-authorization-resourceroleassignment-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/ptn/authorization/role-assignment/ @Azure/avm-ptn-authorization-roleassignment-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/ptn/authorization/subscription-role-assignment/ @Azure/avm-ptn-authorization-subscriptionroleassignment-module-owners-bicep @Azure/avm-module-reviewers-bicep
#/avm/ptn/avd-lza/insights/ @Azure/avm-ptn-avd-lza-insights-module-owners-bicep @Azure/avm-module-reviewers-bicep
#/avm/ptn/avd-lza/management-plane/ @Azure/avm-ptn-avd-lza-managementplane-module-owners-bicep @Azure/avm-module-reviewers-bicep
#/avm/ptn/avd-lza/networking/ @Azure/avm-ptn-avd-lza-networking-module-owners-bicep @Azure/avm-module-reviewers-bicep
Expand Down Expand Up @@ -63,6 +62,7 @@
/avm/res/desktop-virtualization/host-pool/ @Azure/avm-res-desktopvirtualization-hostpool-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/desktop-virtualization/scaling-plan/ @Azure/avm-res-desktopvirtualization-scalingplan-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/desktop-virtualization/workspace/ @Azure/avm-res-desktopvirtualization-workspace-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/dev-ops-infrastructure/pool/ @Azure/avm-res-devopsinfrastructure-pool-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/dev-test-lab/lab/ @Azure/avm-res-devtestlab-lab-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/digital-twins/digital-twins-instance/ @Azure/avm-res-digitaltwins-digitaltwinsinstance-module-owners-bicep @Azure/avm-module-reviewers-bicep
/avm/res/document-db/database-account/ @Azure/avm-res-documentdb-databaseaccount-module-owners-bicep @Azure/avm-module-reviewers-bicep
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/avm_module_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ body:
- "avm/res/desktop-virtualization/host-pool"
- "avm/res/desktop-virtualization/scaling-plan"
- "avm/res/desktop-virtualization/workspace"
- "avm/res/dev-ops-infrastructure/pool"
- "avm/res/dev-test-lab/lab"
- "avm/res/digital-twins/digital-twins-instance"
- "avm/res/document-db/database-account"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "avm.ptn.authorization.subscription-role-assignment"
name: "avm.res.dev-ops-infrastructure.pool"

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,15 +28,15 @@ on:
paths:
- ".github/actions/templates/avm-**"
- ".github/workflows/avm.template.module.yml"
- ".github/workflows/avm.ptn.authorization.subscription-role-assignment.yml"
- "avm/ptn/authorization/subscription-role-assignment/**"
- ".github/workflows/avm.res.dev-ops-infrastructure.pool.yml"
- "avm/res/dev-ops-infrastructure/pool/**"
- "avm/utilities/pipelines/**"
- "!avm/utilities/pipelines/platform/**"
- "!*/**/README.md"

env:
modulePath: "avm/ptn/authorization/subscription-role-assignment"
workflowPath: ".github/workflows/avm.ptn.authorization.subscription-role-assignment.yml"
modulePath: "avm/res/dev-ops-infrastructure/pool"
workflowPath: ".github/workflows/avm.res.dev-ops-infrastructure.pool.yml"

concurrency:
group: ${{ github.workflow }}
Expand Down
6 changes: 3 additions & 3 deletions avm/ptn/deployment-script/import-image-to-acr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module importImageToAcr 'br/public:avm/ptn/deployment-script/import-image-to-acr
cleanupPreference: 'OnExpiration'
location: '<location>'
managedIdentities: '<managedIdentities>'
newImageName: 'your-image-name:tag'
newImageName: 'application/your-image-name:tag'
overwriteExistingImage: true
storageAccountResourceId: '<storageAccountResourceId>'
subnetResourceIds: '<subnetResourceIds>'
Expand Down Expand Up @@ -163,7 +163,7 @@ module importImageToAcr 'br/public:avm/ptn/deployment-script/import-image-to-acr
"value": "<managedIdentities>"
},
"newImageName": {
"value": "your-image-name:tag"
"value": "application/your-image-name:tag"
},
"overwriteExistingImage": {
"value": true
Expand Down Expand Up @@ -395,7 +395,7 @@ The new image name in the ACR. You can use this to import a publically available

- Required: No
- Type: string
- Default: `[last(split(parameters('image'), '/'))]`
- Default: `[string(skip(parameters('image'), add(indexOf(parameters('image'), '/'), 1)))]`
- Example: `your-image-name:tag`

### Parameter: `overwriteExistingImage`
Expand Down
6 changes: 4 additions & 2 deletions avm/ptn/deployment-script/import-image-to-acr/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ param sourceRegistryPassword string = ''
@metadata({
example: 'your-image-name:tag'
})
param newImageName string = last(split(image, '/'))
param newImageName string = string(skip(image, indexOf(image, '/') + 1))

@description('Optional. The image will be overwritten if it already exists in the ACR with the same tag. Default is false.')
param overwriteExistingImage bool = false
Expand Down Expand Up @@ -234,7 +234,9 @@ output deploymentScriptOutput string[] = imageImport.outputs.deploymentScriptLog
@description('An array of the imported images.')
output importedImage importedImageType = {
originalImage: image
acrHostedImage: '${acr.properties.loginServer}${string(skip(image, indexOf(image,'/')))}'
acrHostedImage: empty(newImageName)
? '${acr.properties.loginServer}${string(skip(image, indexOf(image,'/')))}'
: '${acr.properties.loginServer}/${newImageName}'
}

// ================ //
Expand Down
6 changes: 3 additions & 3 deletions avm/ptn/deployment-script/import-image-to-acr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15179702678978782456"
"templateHash": "13166673091432959100"
},
"name": "import-image-to-acr",
"description": "This modules deployes an image to an Azure Container Registry.",
Expand Down Expand Up @@ -127,7 +127,7 @@
},
"newImageName": {
"type": "string",
"defaultValue": "[last(split(parameters('image'), '/'))]",
"defaultValue": "[string(skip(parameters('image'), add(indexOf(parameters('image'), '/'), 1)))]",
"metadata": {
"example": "your-image-name:tag",
"description": "Optional. The new image name in the ACR. You can use this to import a publically available image with a custom name for later updating from e.g., your build pipeline."
Expand Down Expand Up @@ -910,7 +910,7 @@
},
"value": {
"originalImage": "[parameters('image')]",
"acrHostedImage": "[format('{0}{1}', reference('acr').loginServer, string(skip(parameters('image'), indexOf(parameters('image'), '/'))))]"
"acrHostedImage": "[if(empty(parameters('newImageName')), format('{0}{1}', reference('acr').loginServer, string(skip(parameters('image'), indexOf(parameters('image'), '/')))), format('{0}/{1}', reference('acr').loginServer, parameters('newImageName')))]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module testDeployment '../../../main.bicep' = [
// commented out, as the user is not available in the test environment
// sourceRegistryUsername: 'username'
// sourceRegistryPassword: keyVault.getSecret(dependencies.outputs.keyVaultSecretName)
newImageName: 'your-image-name:tag'
newImageName: 'application/your-image-name:tag'
cleanupPreference: 'OnExpiration'
assignRbacRole: true
managedIdentities: { userAssignedResourcesIds: [dependencies.outputs.managedIdentityResourceId] }
Expand Down
137 changes: 123 additions & 14 deletions avm/res/cognitive-services/account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This module deploys a Cognitive Service.
| `Microsoft.CognitiveServices/accounts` | [2023-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2023-05-01/accounts) |
| `Microsoft.CognitiveServices/accounts/deployments` | [2023-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2023-05-01/accounts/deployments) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.KeyVault/vaults/secrets` | [2023-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2023-07-01/vaults/secrets) |
| `Microsoft.Network/privateEndpoints` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-11-01/privateEndpoints) |
| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-11-01/privateEndpoints/privateDnsZoneGroups) |

Expand All @@ -33,13 +34,14 @@ The following section provides usage examples for the module, which were used to
- [Using `AIServices` with `deployments` in parameter set and private endpoints](#example-1-using-aiservices-with-deployments-in-parameter-set-and-private-endpoints)
- [Using `AIServices` with `deployments` in parameter set](#example-2-using-aiservices-with-deployments-in-parameter-set)
- [Using only defaults](#example-3-using-only-defaults)
- [Using large parameter set](#example-4-using-large-parameter-set)
- [Using `OpenAI` and `deployments` in parameter set with private endpoint](#example-5-using-openai-and-deployments-in-parameter-set-with-private-endpoint)
- [As Speech Service](#example-6-as-speech-service)
- [Using Customer-Managed-Keys with System-Assigned identity](#example-7-using-customer-managed-keys-with-system-assigned-identity)
- [Using Customer-Managed-Keys with User-Assigned identity](#example-8-using-customer-managed-keys-with-user-assigned-identity)
- [WAF-aligned](#example-9-waf-aligned)
- [Storing keys of service in key vault](#example-3-storing-keys-of-service-in-key-vault)
- [Using only defaults](#example-4-using-only-defaults)
- [Using large parameter set](#example-5-using-large-parameter-set)
- [Using `OpenAI` and `deployments` in parameter set with private endpoint](#example-6-using-openai-and-deployments-in-parameter-set-with-private-endpoint)
- [As Speech Service](#example-7-as-speech-service)
- [Using Customer-Managed-Keys with System-Assigned identity](#example-8-using-customer-managed-keys-with-system-assigned-identity)
- [Using Customer-Managed-Keys with User-Assigned identity](#example-9-using-customer-managed-keys-with-user-assigned-identity)
- [WAF-aligned](#example-10-waf-aligned)

### Example 1: _Using `AIServices` with `deployments` in parameter set and private endpoints_

Expand Down Expand Up @@ -237,7 +239,71 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 3: _Using only defaults_
### Example 3: _Storing keys of service in key vault_

This instance deploys the module and stores its keys in a key vault.


<details>

<summary>via Bicep module</summary>

```bicep
module account 'br/public:avm/res/cognitive-services/account:<version>' = {
name: 'accountDeployment'
params: {
// Required parameters
kind: 'SpeechServices'
name: 'csakv001'
// Non-required parameters
location: '<location>'
secretsExportConfiguration: {
accessKey1Name: 'csakv001-accessKey1'
accessKey2Name: 'csakv001-accessKey2'
keyVaultResourceId: '<keyVaultResourceId>'
}
}
}
```

</details>
<p>

<details>

<summary>via JSON Parameter file</summary>

```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"kind": {
"value": "SpeechServices"
},
"name": {
"value": "csakv001"
},
// Non-required parameters
"location": {
"value": "<location>"
},
"secretsExportConfiguration": {
"value": {
"accessKey1Name": "csakv001-accessKey1",
"accessKey2Name": "csakv001-accessKey2",
"keyVaultResourceId": "<keyVaultResourceId>"
}
}
}
}
```

</details>
<p>

### Example 4: _Using only defaults_

This instance deploys the module with the minimum set of required parameters.

Expand Down Expand Up @@ -289,7 +355,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 4: _Using large parameter set_
### Example 5: _Using large parameter set_

This instance deploys the module with most of its features enabled.

Expand Down Expand Up @@ -581,7 +647,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 5: _Using `OpenAI` and `deployments` in parameter set with private endpoint_
### Example 6: _Using `OpenAI` and `deployments` in parameter set with private endpoint_

This instance deploys the module with the AI model deployment feature and private endpoint.

Expand Down Expand Up @@ -689,7 +755,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 6: _As Speech Service_
### Example 7: _As Speech Service_

This instance deploys the module as a Speech Service.

Expand Down Expand Up @@ -803,7 +869,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 7: _Using Customer-Managed-Keys with System-Assigned identity_
### Example 8: _Using Customer-Managed-Keys with System-Assigned identity_

This instance deploys the module using Customer-Managed-Keys using a System-Assigned Identity. This required the service to be deployed twice, once as a pre-requisite to create the System-Assigned Identity, and once to use it for accessing the Customer-Managed-Key secret.

Expand Down Expand Up @@ -885,7 +951,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 8: _Using Customer-Managed-Keys with User-Assigned identity_
### Example 9: _Using Customer-Managed-Keys with User-Assigned identity_

This instance deploys the module using Customer-Managed-Keys using a User-Assigned Identity to access the Customer-Managed-Key secret.

Expand Down Expand Up @@ -973,7 +1039,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
</details>
<p>

### Example 9: _WAF-aligned_
### Example 10: _WAF-aligned_

This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.

Expand Down Expand Up @@ -1146,6 +1212,7 @@ module account 'br/public:avm/res/cognitive-services/account:<version>' = {
| [`restore`](#parameter-restore) | bool | Restore a soft-deleted cognitive service at deployment time. Will fail if no such soft-deleted resource exists. |
| [`restrictOutboundNetworkAccess`](#parameter-restrictoutboundnetworkaccess) | bool | Restrict outbound network access. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`secretsExportConfiguration`](#parameter-secretsexportconfiguration) | object | Key vault reference and secret settings for the module's secrets export. |
| [`sku`](#parameter-sku) | string | SKU of the Cognitive Services resource. Use 'Get-AzCognitiveServicesAccountSku' to determine a valid combinations of 'kind' and 'SKU' for your Azure region. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |
| [`userOwnedStorage`](#parameter-userownedstorage) | array | The storage accounts for this resource. |
Expand Down Expand Up @@ -2142,6 +2209,47 @@ The principal type of the assigned principal ID.
]
```

### Parameter: `secretsExportConfiguration`

Key vault reference and secret settings for the module's secrets export.

- Required: No
- Type: object

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`keyVaultResourceId`](#parameter-secretsexportconfigurationkeyvaultresourceid) | string | The key vault name where to store the keys and connection strings generated by the modules. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`accessKey1Name`](#parameter-secretsexportconfigurationaccesskey1name) | string | The name for the accessKey1 secret to create. |
| [`accessKey2Name`](#parameter-secretsexportconfigurationaccesskey2name) | string | The name for the accessKey2 secret to create. |

### Parameter: `secretsExportConfiguration.keyVaultResourceId`

The key vault name where to store the keys and connection strings generated by the modules.

- Required: Yes
- Type: string

### Parameter: `secretsExportConfiguration.accessKey1Name`

The name for the accessKey1 secret to create.

- Required: No
- Type: string

### Parameter: `secretsExportConfiguration.accessKey2Name`

The name for the accessKey2 secret to create.

- Required: No
- Type: string

### Parameter: `sku`

SKU of the Cognitive Services resource. Use 'Get-AzCognitiveServicesAccountSku' to determine a valid combinations of 'kind' and 'SKU' for your Azure region.
Expand Down Expand Up @@ -2192,6 +2300,7 @@ The storage accounts for this resource.
| :-- | :-- | :-- |
| `endpoint` | string | The service endpoint of the cognitive services account. |
| `endpoints` | | All endpoints available for the cognitive services account, types depends on the cognitive service kind. |
| `exportedSecrets` | | A hashtable of references to the secrets exported to the provided Key Vault. The key of each reference is each secret's name. |
| `location` | string | The location the resource was deployed into. |
| `name` | string | The name of the cognitive services account. |
| `resourceGroupName` | string | The resource group the cognitive services account was deployed into. |
Expand Down
Loading

0 comments on commit 4a052e8

Please sign in to comment.