I am trying to provision a Azure Cosmos DB for PostgreSQL Cluster instance using arm template but I don't see a field to set the database name.

Anshul Sharma 20 Reputation points
2024-04-01T09:18:58.1233333+00:00

I am following this doc - https://learn.microsoft.com/en-us/azure/templates/microsoft.dbforpostgresql/servergroupsv2?pivots=deployment-language-arm-template to provision a Azure Cosmos DB for PostgreSQL Cluster but there is no field to specify the databaseName , and it creates the cluster with database name "citus" by default . Is there a way to set the custom database name ?
When provisioning from the portal I see there is text field to enter database name so I guess the resource does support custom database names.

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
633 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,439 questions
Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. Anveshreddy Nimmala 2,150 Reputation points Microsoft Vendor
    2024-04-01T10:35:25.54+00:00

    Hello Anshul Sharma,

    Welcome to microsoft Q&A, Thankyou for posting your query here.

    please find below arm template to provision a Azure Cosmos DB for PostgreSQL Cluster with desired Database came.

    {
        "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "serverGroupName": {
                "type": "string"
            },
            "databaseName": {
                "type": "string"
            },
            "location": {
                "type": "string"
            },
            "administratorLoginPassword": {
                "type": "secureString"
            },
            "postgresqlVersion": {
                "type": "string"
            },
            "coordinatorVcores": {
                "type": "int"
            },
            "coordinatorStorageSizeMB": {
                "type": "int"
            },
            "numWorkers": {
                "type": "int"
            },
            "workerVcores": {
                "type": "int"
            },
            "workerStorageSizeMB": {
                "type": "int"
            },
            "enableHa": {
                "type": "bool"
            },
            "enableGeoBackup": {
                "type": "bool"
            },
            "coordinatorServerEdition": {
                "type": "string"
            },
            "enablePublicIpAccess": {
                "type": "bool"
            },
            "serverGroupTags": {
                "type": "object"
            }
        },
        "variables": {},
        "resources": [
            {
                "name": "[parameters('serverGroupName')]",
                "type": "Microsoft.DBforPostgreSQL/serverGroupsv2",
                "apiVersion": "2023-03-02-preview",
                "location": "[parameters('location')]",
                "tags": "[parameters('serverGroupTags')]",
                "properties": {
                    "databaseName": "[parameters('databaseName')]",
                    "administratorLogin": "citus",
                    "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
                    "enableHa": "[parameters('enableHa')]",
                    "enableGeoBackup": "[parameters('enableGeoBackup')]",
                    "postgresqlVersion": "[parameters('postgresqlVersion')]",
                    "coordinatorVCores": "[parameters('coordinatorVcores')]",
                    "coordinatorStorageQuotaInMb": "[parameters('coordinatorStorageSizeMB')]",
                    "coordinatorServerEdition": "[parameters('coordinatorServerEdition')]",
                    "nodeCount": "[parameters('numWorkers')]",
                    "nodeVCores": "[parameters('workerVcores')]",
                    "nodeStorageQuotaInMb": "[parameters('workerStorageSizeMB')]",
                    "nodeServerEdition": "MemoryOptimized",
                    "nodeEnablePublicIpAccess": "[parameters('enablePublicIpAccess')]"
                },
                "dependsOn": []
            }
        ],
        "outputs": {}
    }
    

    Hope this helps you,If an answer has been helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!a6cee2ad-1134-434b-8384-c97b6c4c9a58

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful