Skip to content

[Feature Request]: Discuss environment() function usage vs hardcoded value for privateDNSZone names #2224

@eriqua

Description

@eriqua

Description

This issue is related to modules supporting Private Endpoints.
As part of the self-contained dependencies module testing, we are deploying privateDNSZone resources.
For some modules, currently only storage accounts and sql servers, we are leveraging the environment() function to derive the name of the privateDNSZone to create.

e.g. 'privatelink.blob.${environment().suffixes.storage}' = 'privatelink.blob.core.windows.net'

There are currently inconsistencies in environment() suffixes formatting, either including initial dot or not (Check https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-deployment#example-1)

  "suffixes": {
    "acrLoginServer": ".azurecr.io",
    "azureDatalakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net",
    "azureDatalakeStoreFileSystem": "azuredatalakestore.net",
    "azureFrontDoorEndpointSuffix": "azurefd.net",
    "keyvaultDns": ".vault.azure.net",
    "sqlServerHostname": ".database.windows.net",
    "storage": "core.windows.net"
  }

This is also tracked by Azure/bicep#5103

Discuss advantages of leveraging the environment() function (OPT1) vs the hardcoded value (OPT2).
Depending on the above:

  1. OPT1 Align all privateDNSZone names to leverage the environment() function where not used (e.g. KeyVault, ACR)
  2. OPT2 Align all privateDNSZone names to use hardcoded values

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions