Skip to content

Create a platform API for Azure SQL Database#2

Draft
Yeseh with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-1
Draft

Create a platform API for Azure SQL Database#2
Yeseh with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-1

Conversation

Copilot AI commented May 19, 2025

Copy link
Copy Markdown

This PR implements a new platform API for Azure SQL Database using the Azure Resource Orchestrator.

Features

  • Creates a complete Azure SQL Database resource with private endpoint connectivity
  • Links with an existing canvas for resource organization and identity management
  • Adds necessary permissions to the canvas managed identity for the SQL resources
  • Configures a private endpoint for secure connectivity to the database

Implementation Details

The implementation consists of:

  1. A new ResourceGraphDefinition in infrastructure/platform-apis/azuresqldatabase.yaml that defines:

    • SQL Server with configurable administrator credentials
    • SQL Database with configurable tier and size
    • Private endpoint for secure connectivity
    • Role assignments for the canvas managed identity
  2. Example usage in examples/azure-sql-database.yaml showing how to:

    • Reference an existing canvas
    • Configure SQL server settings
    • Set up database parameters
    • Specify private endpoint subnet
  3. Documentation in examples/README.md with:

    • Prerequisites
    • Security considerations
    • Deployment instructions

Usage

Users can create an Azure SQL database instance by referencing their canvas and specifying the database configuration:

apiVersion: kro.run/v1alpha1
kind: AzureSqlDatabase
metadata:
  name: example-sql-database
  namespace: canvas-my-app-prd
spec:
  canvasName: my-app
  canvasEnvironment: prd
  serverName: myappserver001
  location: westeurope
  administratorLogin: sqladmin
  administratorLoginPassword: "${SECRET_PASSWORD}"
  databaseName: appdb
  privateEndpointSubnetId: "/subscriptions/..."

Fixes #1.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits May 19, 2025 22:55
Co-authored-by: Yeseh <48557715+Yeseh@users.noreply.github.com>
Co-authored-by: Yeseh <48557715+Yeseh@users.noreply.github.com>
Copilot AI changed the title [WIP] Create a platform api for azure sql database Create a platform API for Azure SQL Database May 19, 2025
Copilot AI requested a review from Yeseh May 19, 2025 22:59
Copilot finished work on behalf of Yeseh May 19, 2025 23:00

resources:
# Get canvas information for reference
- id: canvas

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass the canvas managed identity in as an existing resource. Do not create it here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added existing: true to the canvas resource to properly reference it as an existing resource rather than creating it. This change is in commit 45ed1db.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing is not a valid property, undo this change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the existing: true property from the canvas resource in commit d48aff1. The file has been restored to its original state.

Co-authored-by: Yeseh <48557715+Yeseh@users.noreply.github.com>
…property

Co-authored-by: Yeseh <48557715+Yeseh@users.noreply.github.com>
Copilot finished work on behalf of Yeseh May 20, 2025 01: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.

Create a platform api for azure sql database

2 participants