# AzurePostgresFlexibleServerResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.PostgreSQL](/reference/api/csharp/aspire.hosting.azure.postgresql.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresFlexibleServerResource.cs)
- Inherits: `AzureProvisioningResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithEndpoints`, `IValueProvider`, `IValueWithReferences`, `IAzurePrivateEndpointTarget`

Represents an resource for Azure Postgres Flexible Server.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzurePostgresFlexibleServerResource
    : Aspire.Hosting.Azure.AzureProvisioningResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IAzurePrivateEndpointTarget
{
    // ...
}
```

## Constructors

- [AzurePostgresFlexibleServerResource(string, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/constructors.md#constructor-string-action-azureresourceinfrastructure) -- Represents an resource for Azure Postgres Flexible Server.

## Properties

- [Annotations](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#annotations) : `ResourceAnnotationCollection` `get`
- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection template for the manifest for the Azure Postgres Flexible Server.
- [Databases](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#databases) : `IReadOnlyDictionary<string, string>` `get` -- A dictionary where the key is the resource name and the value is the database name.
- [Host](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#host) : `ReferenceExpression` `get` -- Gets the host for the PostgreSQL server.
- [HostName](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#hostname) : `ReferenceExpression` `get` -- Gets the host name for the PostgreSQL server.
- [Id](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#id) : `BicepOutputReference` `get` -- Gets the "id" output reference for the resource.
- [IsContainer](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#iscontainer) : `bool` `get` -- Gets a value indicating whether the current resource represents a container. If so the actual resource is not running in Azure.
- [JdbcConnectionString](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#jdbcconnectionstring) : `ReferenceExpression` `get` -- Gets the JDBC connection string for the server.
- [NameOutputReference](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#nameoutputreference) : `BicepOutputReference` `get` -- Gets the "name" output reference for the resource.
- [Password](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#password) : `ReferenceExpression?` `get` -- Gets the password for the PostgreSQL server when password authentication is enabled.
- [Port](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#port) : `ReferenceExpression` `get` -- Gets the port for the PostgreSQL server.
- [UriExpression](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the PostgreSQL server.
- [UsePasswordAuthentication](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#usepasswordauthentication) : `bool` `get` -- Gets a value indicating whether the resource uses password authentication.
- [UserName](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/properties.md#username) : `ReferenceExpression?` `get` -- Gets the user name for the PostgreSQL server when password authentication is enabled.

## Methods

- [AddAsExistingResource(AzureResourceInfrastructure)](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/methods.md#addasexistingresource-azureresourceinfrastructure) : `ProvisionableResource`
- [AddRoleAssignments(IAddRoleAssignmentsContext)](/reference/api/csharp/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource/methods.md#addroleassignments-iaddroleassignmentscontext)
