Set D365WebConfigDatabase - FH-Inway/d365fo.tools GitHub Wiki
Set the database connection details
Set-D365WebConfigDatabase [-DatabaseServer] <String> [-DatabaseName] <String> [-SqlUser] <String>
[-SqlPwd] <String> [[-Path] <Object>] [<CommonParameters>]
Overwrite the current database connection details directly in the web.config file
Used when you want to connect a DEV box directly to a Tier2 database, and want to debug something that requires better data than usual
Set-D365WebConfigDatabase -DatabaseServer TestServer.database.windows.net -DatabaseName AxDB -SqlUser User123 -SqlPwd "Password123"
Will overwrite Server, Database, Username and Password directly in the web.config file. It will save all details unencrypted.
The name of the database server
Obtain when you request JIT (Just-in-Time) access through the LCS portal
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The name of the database
Obtain when you request JIT (Just-in-Time) access through the LCS portal
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The login name for the SQL Server instance
Obtain when you request JIT (Just-in-Time) access through the LCS portal
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The password for the SQL Server user
Obtain when you request JIT (Just-in-Time) access through the LCS portal
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to the web.config file that you want to update with new SQL connection details
Default is: "K:\AosService\WebRoot\web.config" or what else drive that is recognized by the D365FO components as the service drive
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: $(Join-Path -Path $Script:AOSPath -ChildPath $Script:WebConfig)
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Tags: DEV, Tier2, DB, Database, Debug, JIT, LCS, Azure DB
Author: Mötz Jensen (@Splaxi)