Set-WebSitesConnectionString

Sets a database connection string.

Syntax

Set-WebSitesConnectionString
   [-ConnectionString] <String>
   [-Type] <DatabaseType>
   [-RemoteSettings <RemoteSettings>]
   [-SuppressRequestIdLine]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-WebSitesConnectionString cmdlet sets a database connection string for the specified database type. You can set connection strings for either a hosting database or a metering database.

Examples

Example 1: Set a hosting database connection string

PS C:\> Set-WebSitesConnectionString -Type "Hosting" -ConnectionString "Data Source=CN-SERVER01;Initial Catalog=Hosting;User ID=Hosting_HostingAdmin;Password=Password01!"

This command modifies the connection string for the hosting database.

Required Parameters

-ConnectionString

Specifies a connection string for a hosting database. Connection strings contain information about a data source and how to connect to it; this information includes such things as the server and database name, and the name and password of the user account making the connection. For example:

-ConnectionString "Server=tcp:contosodb.database.windows.net;Database=Personel;User ID=admin@contoso.com;Password=p@ssw0rd;Trusted_Connection=False;Encrypt=True;"

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Type

Specifies the database type. Valid values are:

  • Hosting
  • Metering

For example:

-Type "Hosting"

Type:DatabaseType
Parameter Sets:Hosting, Metering
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-RemoteSettings

{{Fill RemoteSettings Description}}

Type:RemoteSettings
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SuppressRequestIdLine

{{Fill SuppressRequestIdLine Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False