Skip to content
Docs Try Aspire

Aspire.Hosting.Azure.PostgreSQL

Official
📦 Aspire.Hosting.Azure.PostgreSQL v13.2.0-preview.1.26159.1
57 Functions
20 Types

Types

Functions

function addAzureEnvironment builder
Adds the shared Azure environment resource to the application model
addAzureEnvironment(): AzureEnvironmentResource
function addAzureInfrastructure builder
Adds an Azure provisioning resource to the application model
addAzureInfrastructure(name: string, configureInfrastructure: (obj: AzureResourceInfrastructure) => void): AzureProvisioningResource
function addAzureKeyVault builder
Adds an Azure Key Vault resource
addAzureKeyVault(name: string): AzureKeyVaultResource
function addAzurePostgresFlexibleServer builder
Adds an Azure PostgreSQL Flexible Server resource
addAzurePostgresFlexibleServer(name: string): AzurePostgresFlexibleServerResource
function addAzureProvisioning
Adds Azure provisioning services to the distributed application builder
addAzureProvisioning(): IDistributedApplicationBuilder
function addAzureUserAssignedIdentity builder
Adds an Azure user-assigned identity resource
addAzureUserAssignedIdentity(name: string): AzureUserAssignedIdentityResource
function addBicepTemplate builder
Adds an Azure Bicep template resource from a file
addBicepTemplate(name: string, bicepFile: string): AzureBicepResource
function addBicepTemplateString builder
Adds an Azure Bicep template resource from inline Bicep content
addBicepTemplateString(name: string, bicepContent: string): AzureBicepResource
function addDatabase builder
Adds an Azure PostgreSQL database
addDatabase(name: string, databaseName?: string): AzurePostgresFlexibleServerDatabaseResource
function addDatabase builder
Adds a PostgreSQL database
addDatabase(name: string, databaseName?: string): PostgresDatabaseResource
function addPostgres builder
Adds a PostgreSQL server resource
addPostgres(name: string, userName?: ParameterResource, password?: ParameterResource, port?: number): PostgresServerResource
function addSecret builder
Adds a secret to the Azure Key Vault from a parameter resource
addSecret(name: string, parameterResource: ParameterResource): AzureKeyVaultSecretResource
function addSecretFromExpression builder
Adds a secret to the Azure Key Vault from a reference expression
addSecretFromExpression(name: string, value: ReferenceExpression): AzureKeyVaultSecretResource
function addSecretWithName builder
Adds a named secret to the Azure Key Vault from a parameter resource
addSecretWithName(name: string, secretName: string, parameterResource: ParameterResource): AzureKeyVaultSecretResource
function addSecretWithNameFromExpression builder
Adds a named secret to the Azure Key Vault from a reference expression
addSecretWithNameFromExpression(name: string, secretName: string, value: ReferenceExpression): AzureKeyVaultSecretResource
function asExisting builder
Marks an Azure resource as existing in both run and publish modes
asExisting(nameParameter: ParameterResource, resourceGroupParameter: ParameterResource): IAzureResource
function clearDefaultRoleAssignments builder
Clears the default Azure role assignments from a resource
clearDefaultRoleAssignments(): IAzureResource
function configureInfrastructure builder
Configures the Azure provisioning infrastructure callback
configureInfrastructure(configure: (obj: AzureResourceInfrastructure) => void): AzureProvisioningResource
function getBicepIdentifier
Gets the normalized Bicep identifier for an Azure resource
getBicepIdentifier(): string
function getOutput
Gets an output reference from an Azure Bicep template resource
getOutput(name: string): BicepOutputReference
function getSecret
Gets a secret reference from the Azure Key Vault
getSecret(secretName: string): IAzureKeyVaultSecretReference
function isExisting
Determines whether a resource is marked as existing
isExisting(): boolean
function publishAsConnectionString builder
Publishes an Azure resource to the manifest as a connection string
publishAsConnectionString(): IAzureResource
function publishAsExisting builder
Marks an Azure resource as existing in publish mode
publishAsExisting(name: string, resourceGroup: string): IAzureResource
function publishAsExistingFromParameters builder
Marks an Azure resource as existing in publish mode by using parameter resources
publishAsExistingFromParameters(nameParameter: ParameterResource, resourceGroupParameter: ParameterResource): IAzureResource
function runAsContainer builder
Configures the Azure PostgreSQL Flexible Server resource to run locally in a container
runAsContainer(configureContainer?: (obj: PostgresServerResource) => void): AzurePostgresFlexibleServerResource
function runAsExisting builder
Marks an Azure resource as existing in run mode
runAsExisting(name: string, resourceGroup: string): IAzureResource
function runAsExistingFromParameters builder
Marks an Azure resource as existing in run mode by using parameter resources
runAsExistingFromParameters(nameParameter: ParameterResource, resourceGroupParameter: ParameterResource): IAzureResource
function withAzureUserAssignedIdentity builder
Associates an Azure user-assigned identity with a compute resource
withAzureUserAssignedIdentity(identityResourceBuilder: AzureUserAssignedIdentityResource): IComputeResource
function withCreationScript builder
Defines the SQL script for database creation
withCreationScript(script: string): PostgresDatabaseResource
function withDataBindMount builder
Adds a data bind mount for PostgreSQL
withDataBindMount(source: string, isReadOnly?: boolean): PostgresServerResource
function withDataVolume builder
Adds a data volume for PostgreSQL
withDataVolume(name?: string, isReadOnly?: boolean): PostgresServerResource
function withEnvironmentFromKeyVaultSecret builder
Sets an environment variable from an Azure Key Vault secret reference
withEnvironmentFromKeyVaultSecret(name: string, secretReference: IAzureKeyVaultSecretReference): IResourceWithEnvironment
function withEnvironmentFromOutput builder
Sets an environment variable from a Bicep output reference
withEnvironmentFromOutput(name: string, bicepOutputReference: BicepOutputReference): IResourceWithEnvironment
function withHostPort builder
Sets the host port for pgAdmin
withHostPort(port: number): PgAdminContainerResource
function withHostPort builder
Sets the host port for pgweb
withHostPort(port: number): PgWebContainerResource
function withHostPort builder
Sets the host port for PostgreSQL
withHostPort(port: number): PostgresServerResource
function withInitFiles builder
Copies init files to PostgreSQL
withInitFiles(source: string): PostgresServerResource
function withKeyVaultRoleAssignments builder
Assigns Key Vault roles to a resource
withKeyVaultRoleAssignments(target: AzureKeyVaultResource, roles: AzureKeyVaultRole[]): IResource
function withLocation builder
Sets the Azure location for the shared Azure environment resource
withLocation(location: ParameterResource): AzureEnvironmentResource
function withParameter builder
Adds a Bicep parameter without a value
withParameter(name: string): AzureBicepResource
function withParameterFromConnectionString builder
Adds a Bicep parameter from a connection string resource builder
withParameterFromConnectionString(name: string, value: IResourceWithConnectionString): AzureBicepResource
function withParameterFromEndpoint builder
Adds a Bicep parameter from an endpoint reference
withParameterFromEndpoint(name: string, value: EndpointReference): AzureBicepResource
function withParameterFromOutput builder
Adds a Bicep parameter from another Bicep output reference
withParameterFromOutput(name: string, value: BicepOutputReference): AzureBicepResource
function withParameterFromParameter builder
Adds a Bicep parameter from a parameter resource builder
withParameterFromParameter(name: string, value: ParameterResource): AzureBicepResource
function withParameterFromReferenceExpression builder
Adds a Bicep parameter from a reference expression
withParameterFromReferenceExpression(name: string, value: ReferenceExpression): AzureBicepResource
function withParameterStringValue builder
Adds a Bicep parameter with a string value
withParameterStringValue(name: string, value: string): AzureBicepResource
function withParameterStringValues builder
Adds a Bicep parameter with a string list value
withParameterStringValues(name: string, value: string[]): AzureBicepResource
function withPassword builder
Configures the PostgreSQL password
withPassword(password: ParameterResource): PostgresServerResource
function withPasswordAuthentication builder
Configures password authentication for Azure PostgreSQL Flexible Server
withPasswordAuthentication(userName?: ParameterResource, password?: ParameterResource): AzurePostgresFlexibleServerResource
function withPasswordAuthenticationWithKeyVault builder
Configures password authentication using a specified Azure Key Vault resource
withPasswordAuthenticationWithKeyVault(keyVaultBuilder: IAzureKeyVaultResource, userName?: ParameterResource, password?: ParameterResource): AzurePostgresFlexibleServerResource
function withPgAdmin builder
Adds pgAdmin 4 management UI
withPgAdmin(configureContainer?: (obj: PgAdminContainerResource) => void, containerName?: string): PostgresServerResource
function withPgWeb builder
Adds pgweb management UI
withPgWeb(configureContainer?: (obj: PgWebContainerResource) => void, containerName?: string): PostgresServerResource
function withPostgresMcp builder
Adds a Postgres MCP server container
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => void, containerName?: string): AzurePostgresFlexibleServerDatabaseResource
function withPostgresMcp builder
Adds Postgres MCP server
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => void, containerName?: string): PostgresDatabaseResource
function withResourceGroup builder
Sets the Azure resource group for the shared Azure environment resource
withResourceGroup(resourceGroup: ParameterResource): AzureEnvironmentResource
function withUserName builder
Configures the PostgreSQL user name
withUserName(userName: ParameterResource): PostgresServerResource

Enums