MR
Mayur Rathi
@mayurrathi
⭐ 5 GitHub stars

Azure Resource Manager Postgresql Dotnet

|

mkdir -p ./skills/azure-resource-manager-postgresql-dotnet && curl -sfL https://raw.githubusercontent.com/mayurrathi/awesome-agent-skills/main/skills/azure-resource-manager-postgresql-dotnet/SKILL.md -o ./skills/azure-resource-manager-postgresql-dotnet/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Azure.ResourceManager.PostgreSql (.NET)


Azure Resource Manager SDK for managing PostgreSQL Flexible Server deployments.


Installation


```bash

dotnet add package Azure.ResourceManager.PostgreSql

dotnet add package Azure.Identity

```


**Current Version**: v1.2.0 (GA)

**API Version**: 2023-12-01-preview


> **Note**: This skill focuses on PostgreSQL Flexible Server. Single Server is deprecated and scheduled for retirement.


Environment Variables


```bash

AZURE_SUBSCRIPTION_ID=<your-subscription-id>

AZURE_RESOURCE_GROUP=<your-resource-group>

AZURE_POSTGRESQL_SERVER_NAME=<your-postgresql-server>

```


Authentication


```csharp

using Azure.Identity;

using Azure.ResourceManager;

using Azure.ResourceManager.PostgreSql;

using Azure.ResourceManager.PostgreSql.FlexibleServers;


ArmClient client = new ArmClient(new DefaultAzureCredential());

```


Resource Hierarchy


```

Subscription

└── ResourceGroup

└── PostgreSqlFlexibleServer # PostgreSQL Flexible Server instance

├── PostgreSqlFlexibleServerDatabase # Database within the server

├── PostgreSqlFlexibleServerFirewallRule # IP firewall rules

├── PostgreSqlFlexibleServerConfiguration # Server parameters

├── PostgreSqlFlexibleServerBackup # Backup information

├── PostgreSqlFlexibleServerActiveDirectoryAdministrator # Entra ID admin

└── PostgreSqlFlexibleServerVirtualEndpoint # Read replica endpoints

```


Core Workflows


1. Create PostgreSQL Flexible Server


```csharp

using Azure.ResourceManager.PostgreSql.FlexibleServers;

using Azure.ResourceManager.PostgreSql.FlexibleServers.Models;


ResourceGroupResource resourceGroup = await client

.GetDefaultSubscriptionAsync()

.Result

.GetResourceGroupAsync("my-resource-group");


PostgreSqlFlexibleServerCollection servers = resourceGroup.GetPostgreSqlFlexibleServers();


PostgreSqlFlexibleServerData data = new PostgreSqlFlexibleServerData(AzureLocation.EastUS)

{

Sku = new PostgreSqlFlexibleServerSku("Standard_D2ds_v4", PostgreSqlFlexibleServerSkuTier.GeneralPurpose),

AdministratorLogin = "pgadmin",

AdministratorLoginPassword = "YourSecurePassword123!",

Version = PostgreSqlFlexibleServerVersion.Ver16,

Storage = new PostgreSqlFlexibleServerStorage

{

StorageSizeInGB = 128,

AutoGrow = StorageAutoGrow.Enabled,

Tier = PostgreSqlStorageTierName.P30

},

Backup = new PostgreSqlFlexibleServerBackupProperties

{

BackupRetentionDays = 7,

GeoRedundantBackup = PostgreSqlFlexibleServerGeoRedundantBackupEnum.Disabled

},

HighAvailability = new PostgreSqlFlexibleServerHighAvailability

{

Mode = PostgreSqlFlexibleServerHighAvailabilityMode.ZoneRedundant,

StandbyAvailabilityZone = "2"

},

AvailabilityZone = "1",

AuthConfig = new PostgreSqlFlexibleServerAuthConfig

{

ActiveDirectoryAuth = PostgreSqlFlexibleServerActiveDirectoryAuthEnum.Enabled,

PasswordAuth = PostgreSqlFlexibleServerPasswordAuthEnum.Enabled

}

};


ArmOperation<PostgreSqlFlexibleServerResource> operation = await servers

.CreateOrUpdateAsync(WaitUntil.Completed, "my-postgresql-server", data);


PostgreSqlFlexibleServerResource server = operation.Value;

Console.WriteLine($"Server created: {server.Data.FullyQualifiedDomainName}");

```


2. Create Database


```csharp

PostgreSqlFlexibleServerResource server = await resourceGroup

.GetPostgreSqlFlexibleServerAsync("my-postgresql-server");


PostgreSqlFlexibleServerDatabaseCollection databases = server.GetPostgreSqlFlexibleServerDatabases();


PostgreSqlFlexibleServerDatabaseData dbData = new PostgreSqlFlexibleServerDatabaseData

{

Charset = "UTF8",

Collation = "en_US.utf8"

};


ArmOperation<PostgreSqlFlexibleServerDatabaseResource> operation = await databases

.CreateOrUpdateAsync(WaitUntil.Completed, "myappdb", dbData);


PostgreSqlFlexibleServerDatabaseResource database = operation.Value;

Console.WriteLine($"Databa

🎯 Best For

  • Claude users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Azure Resource Manager Postgresql Dotnet to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Azure Resource Manager Postgresql Dotnet compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Azure Resource Manager Postgresql Dotnet?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Azure Resource Manager Postgresql Dotnet?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/azure-resource-manager-postgresql-dotnet/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills