# Aspire.Hosting.Azure.PostgreSQL

- Module: `Aspire.Hosting.Azure.PostgreSQL`
- Version: `13.2.0`
- Source: [GitHub](https://github.com/microsoft/aspire)
- Functions: `57`
- Types: `20`

## Types

- [AzureBicepResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurebicepresource.md) -- `handle` - 9 members
- [AzureEnvironmentResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azureenvironmentresource.md) -- `handle` - 2 members
- [AzureKeyVaultResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurekeyvaultresource.md) -- `handle` - 5 members
- [AzureKeyVaultSecretResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurekeyvaultsecretresource.md) -- `handle` - 0 members
- [AzurePostgresFlexibleServerDatabaseResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurepostgresflexibleserverdatabaseresource.md) -- `handle` - 1 members
- [AzurePostgresFlexibleServerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md) -- `handle` - 4 members
- [AzureProvisioningResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azureprovisioningresource.md) -- `handle` - 1 members
- [AzureResourceInfrastructure](/reference/api/typescript/aspire.hosting.azure.postgresql/azureresourceinfrastructure.md) -- `handle` - 3 members
- [AzureUserAssignedIdentityResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azureuserassignedidentityresource.md) -- `handle` - 0 members
- [BicepOutputReference](/reference/api/typescript/aspire.hosting.azure.postgresql/bicepoutputreference.md) -- `handle` - 3 members
- [IAzureKeyVaultResource](/reference/api/typescript/aspire.hosting.azure.postgresql/iazurekeyvaultresource.md) -- `interface` - 0 members
- [IAzureKeyVaultSecretReference](/reference/api/typescript/aspire.hosting.azure.postgresql/iazurekeyvaultsecretreference.md) -- `interface` - 0 members
- [IAzureResource](/reference/api/typescript/aspire.hosting.azure.postgresql/iazureresource.md) -- `interface` - 9 members
- [PgAdminContainerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/pgadmincontainerresource.md) -- `handle` - 1 members
- [PgWebContainerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/pgwebcontainerresource.md) -- `handle` - 1 members
- [PostgresDatabaseResource](/reference/api/typescript/aspire.hosting.azure.postgresql/postgresdatabaseresource.md) -- `handle` - 8 members
- [PostgresMcpContainerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/postgresmcpcontainerresource.md) -- `handle` - 0 members
- [PostgresServerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/postgresserverresource.md) -- `handle` - 26 members

## Functions

- [addAzureEnvironment](/reference/api/typescript/aspire.hosting.azure.postgresql/addazureenvironment.md) -- `method` -- Adds the shared Azure environment resource to the application model
- [addAzureInfrastructure](/reference/api/typescript/aspire.hosting.azure.postgresql/addazureinfrastructure.md) -- `method` -- Adds an Azure provisioning resource to the application model
- [addAzureKeyVault](/reference/api/typescript/aspire.hosting.azure.postgresql/addazurekeyvault.md) -- `method` -- Adds an Azure Key Vault resource
- [addAzurePostgresFlexibleServer](/reference/api/typescript/aspire.hosting.azure.postgresql/addazurepostgresflexibleserver.md) -- `method` -- Adds an Azure PostgreSQL Flexible Server resource
- [addAzureProvisioning](/reference/api/typescript/aspire.hosting.azure.postgresql/addazureprovisioning.md) -- `method` -- Adds Azure provisioning services to the distributed application builder
- [addAzureUserAssignedIdentity](/reference/api/typescript/aspire.hosting.azure.postgresql/addazureuserassignedidentity.md) -- `method` -- Adds an Azure user-assigned identity resource
- [addBicepTemplate](/reference/api/typescript/aspire.hosting.azure.postgresql/addbiceptemplate.md) -- `method` -- Adds an Azure Bicep template resource from a file
- [addBicepTemplateString](/reference/api/typescript/aspire.hosting.azure.postgresql/addbiceptemplatestring.md) -- `method` -- Adds an Azure Bicep template resource from inline Bicep content
- [addDatabase](/reference/api/typescript/aspire.hosting.azure.postgresql/adddatabase.md) -- `method` -- Adds an Azure PostgreSQL database
- [addDatabase](/reference/api/typescript/aspire.hosting.azure.postgresql/adddatabase.md) -- `method` -- Adds a PostgreSQL database
- [addPostgres](/reference/api/typescript/aspire.hosting.azure.postgresql/addpostgres.md) -- `method` -- Adds a PostgreSQL server resource
- [addSecret](/reference/api/typescript/aspire.hosting.azure.postgresql/addsecret.md) -- `method` -- Adds a secret to the Azure Key Vault from a parameter resource
- [addSecretFromExpression](/reference/api/typescript/aspire.hosting.azure.postgresql/addsecretfromexpression.md) -- `method` -- Adds a secret to the Azure Key Vault from a reference expression
- [addSecretWithName](/reference/api/typescript/aspire.hosting.azure.postgresql/addsecretwithname.md) -- `method` -- Adds a named secret to the Azure Key Vault from a parameter resource
- [addSecretWithNameFromExpression](/reference/api/typescript/aspire.hosting.azure.postgresql/addsecretwithnamefromexpression.md) -- `method` -- Adds a named secret to the Azure Key Vault from a reference expression
- [asExisting](/reference/api/typescript/aspire.hosting.azure.postgresql/asexisting.md) -- `method` -- Marks an Azure resource as existing in both run and publish modes by using parameter resources
- [clearDefaultRoleAssignments](/reference/api/typescript/aspire.hosting.azure.postgresql/cleardefaultroleassignments.md) -- `method` -- Clears the default Azure role assignments from a resource
- [configureInfrastructure](/reference/api/typescript/aspire.hosting.azure.postgresql/configureinfrastructure.md) -- `method` -- Configures the Azure provisioning infrastructure callback
- [getBicepIdentifier](/reference/api/typescript/aspire.hosting.azure.postgresql/getbicepidentifier.md) -- `method` -- Gets the normalized Bicep identifier for an Azure resource
- [getOutput](/reference/api/typescript/aspire.hosting.azure.postgresql/getoutput.md) -- `method` -- Gets an output reference from an Azure Bicep template resource
- [getSecret](/reference/api/typescript/aspire.hosting.azure.postgresql/getsecret.md) -- `method` -- Gets a secret reference from the Azure Key Vault
- [isExisting](/reference/api/typescript/aspire.hosting.azure.postgresql/isexisting.md) -- `method` -- Determines whether a resource is marked as existing
- [publishAsConnectionString](/reference/api/typescript/aspire.hosting.azure.postgresql/publishasconnectionstring.md) -- `method` -- Publishes an Azure resource to the manifest as a connection string
- [publishAsExisting](/reference/api/typescript/aspire.hosting.azure.postgresql/publishasexisting.md) -- `method` -- Marks an Azure resource as existing in publish mode
- [publishAsExistingFromParameters](/reference/api/typescript/aspire.hosting.azure.postgresql/publishasexistingfromparameters.md) -- `method` -- Marks an Azure resource as existing in publish mode by using parameter resources
- [runAsContainer](/reference/api/typescript/aspire.hosting.azure.postgresql/runascontainer.md) -- `method` -- Configures the Azure PostgreSQL Flexible Server resource to run locally in a container
- [runAsExisting](/reference/api/typescript/aspire.hosting.azure.postgresql/runasexisting.md) -- `method` -- Marks an Azure resource as existing in run mode
- [runAsExistingFromParameters](/reference/api/typescript/aspire.hosting.azure.postgresql/runasexistingfromparameters.md) -- `method` -- Marks an Azure resource as existing in run mode by using parameter resources
- [withAzureUserAssignedIdentity](/reference/api/typescript/aspire.hosting.azure.postgresql/withazureuserassignedidentity.md) -- `method` -- Associates an Azure user-assigned identity with a compute resource
- [withCreationScript](/reference/api/typescript/aspire.hosting.azure.postgresql/withcreationscript.md) -- `method` -- Defines the SQL script for database creation
- [withDataBindMount](/reference/api/typescript/aspire.hosting.azure.postgresql/withdatabindmount.md) -- `method` -- Adds a data bind mount for PostgreSQL
- [withDataVolume](/reference/api/typescript/aspire.hosting.azure.postgresql/withdatavolume.md) -- `method` -- Adds a data volume for PostgreSQL
- [withEnvironmentFromKeyVaultSecret](/reference/api/typescript/aspire.hosting.azure.postgresql/withenvironmentfromkeyvaultsecret.md) -- `method` -- Sets an environment variable from an Azure Key Vault secret reference
- [withEnvironmentFromOutput](/reference/api/typescript/aspire.hosting.azure.postgresql/withenvironmentfromoutput.md) -- `method` -- Sets an environment variable from a Bicep output reference
- [withHostPort](/reference/api/typescript/aspire.hosting.azure.postgresql/withhostport.md) -- `method` -- Sets the host port for pgAdmin
- [withHostPort](/reference/api/typescript/aspire.hosting.azure.postgresql/withhostport.md) -- `method` -- Sets the host port for pgweb
- [withHostPort](/reference/api/typescript/aspire.hosting.azure.postgresql/withhostport.md) -- `method` -- Sets the host port for PostgreSQL
- [withInitFiles](/reference/api/typescript/aspire.hosting.azure.postgresql/withinitfiles.md) -- `method` -- Copies init files to PostgreSQL
- [withKeyVaultRoleAssignments](/reference/api/typescript/aspire.hosting.azure.postgresql/withkeyvaultroleassignments.md) -- `method` -- Assigns Key Vault roles to a resource
- [withLocation](/reference/api/typescript/aspire.hosting.azure.postgresql/withlocation.md) -- `method` -- Sets the Azure location for the shared Azure environment resource
- [withParameter](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameter.md) -- `method` -- Adds a Bicep parameter without a value
- [withParameterFromConnectionString](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterfromconnectionstring.md) -- `method` -- Adds a Bicep parameter from a connection string resource builder
- [withParameterFromEndpoint](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterfromendpoint.md) -- `method` -- Adds a Bicep parameter from an endpoint reference
- [withParameterFromOutput](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterfromoutput.md) -- `method` -- Adds a Bicep parameter from another Bicep output reference
- [withParameterFromParameter](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterfromparameter.md) -- `method` -- Adds a Bicep parameter from a parameter resource builder
- [withParameterFromReferenceExpression](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterfromreferenceexpression.md) -- `method` -- Adds a Bicep parameter from a reference expression
- [withParameterStringValue](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterstringvalue.md) -- `method` -- Adds a Bicep parameter with a string value
- [withParameterStringValues](/reference/api/typescript/aspire.hosting.azure.postgresql/withparameterstringvalues.md) -- `method` -- Adds a Bicep parameter with a string list value
- [withPassword](/reference/api/typescript/aspire.hosting.azure.postgresql/withpassword.md) -- `method` -- Configures the PostgreSQL password
- [withPasswordAuthentication](/reference/api/typescript/aspire.hosting.azure.postgresql/withpasswordauthentication.md) -- `method` -- Configures password authentication for Azure PostgreSQL Flexible Server
- [withPasswordAuthenticationWithKeyVault](/reference/api/typescript/aspire.hosting.azure.postgresql/withpasswordauthenticationwithkeyvault.md) -- `method` -- Configures password authentication using a specified Azure Key Vault resource
- [withPgAdmin](/reference/api/typescript/aspire.hosting.azure.postgresql/withpgadmin.md) -- `method` -- Adds pgAdmin 4 management UI
- [withPgWeb](/reference/api/typescript/aspire.hosting.azure.postgresql/withpgweb.md) -- `method` -- Adds pgweb management UI
- [withPostgresMcp](/reference/api/typescript/aspire.hosting.azure.postgresql/withpostgresmcp.md) -- `method` -- Adds a Postgres MCP server container
- [withPostgresMcp](/reference/api/typescript/aspire.hosting.azure.postgresql/withpostgresmcp.md) -- `method` -- Adds Postgres MCP server
- [withResourceGroup](/reference/api/typescript/aspire.hosting.azure.postgresql/withresourcegroup.md) -- `method` -- Sets the Azure resource group for the shared Azure environment resource
- [withUserName](/reference/api/typescript/aspire.hosting.azure.postgresql/withusername.md) -- `method` -- Configures the PostgreSQL user name

## Enums

- [AzureKeyVaultRole](/reference/api/typescript/aspire.hosting.azure.postgresql/azurekeyvaultrole.md) -- `enum` - 13 values
- [DeploymentScope](/reference/api/typescript/aspire.hosting.azure.postgresql/deploymentscope.md) -- `enum` - 4 values
