Skip to content

refactor: centralize Azure resource naming with abbreviations.json and update Bicep templates #1795

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

Harmanpreet-Microsoft
Copy link
Contributor

Purpose

This pull request introduces a significant update to the infrastructure codebase, primarily focusing on the centralization and standardization of resource naming conventions through the use of abbreviations. It also includes adjustments to parameter definitions and resource configurations to align with the new naming scheme.

Centralized Resource Naming with Abbreviations:

  • Added a comprehensive abbreviations.json file to define standardized abbreviations for various resource types across categories such as AI, compute, databases, and networking. This enables consistent and concise naming conventions for resources. (infra/abbreviations.json)

Refactoring Resource Names:

  • Updated resource name definitions in infra/main.bicep to use the abbreviations from abbreviations.json. Examples include:
    • Replacing cosmos-${resourceToken} with ${abbrs.databases.cosmosDBDatabase}${resourceToken} for Cosmos DB.
    • Replacing openai-${resourceToken} with ${abbrs.ai.openAIService}${resourceToken} for Azure OpenAI resources.
    • Replacing kv-${resourceToken} with ${abbrs.security.keyVault}${resourceToken} for Key Vault.

Parameter Adjustments:

  • Removed default concatenation logic for miName in infra/core/security/managed-identity.bicep and passed it explicitly from the main module using the new abbreviation-based approach. [1] [2]

Code Simplification:

  • Replaced inline string concatenations with variables referencing the centralized abbreviations, ensuring maintainability and reducing duplication in resource definitions. (infra/main.bicep) [1] [2]

This refactor enhances consistency, readability, and scalability of the infrastructure codebase by leveraging a single source of truth for resource abbreviations.

  • ...

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft merged commit 5d79d5d into dev May 12, 2025
6 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the dev-refactorbicep branch May 12, 2025 10:32
@Roopan-Microsoft Roopan-Microsoft restored the dev-refactorbicep branch May 12, 2025 10:33
@Roopan-Microsoft Roopan-Microsoft deleted the dev-refactorbicep branch May 12, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants