Skip to content

pacx webresources setEnvImage

github-actions[bot] edited this page Jul 12, 2026 · 4 revisions

Sets the image that will be shown in the top left corner of the title bar. This setting applies for all MDAs of a given environment.

Aliases

pacx webresources setLogo
pacx webresources setOrgImage
pacx wr setEnvImage
pacx wr setLogo
pacx wr setOrgImage

Usage

This command updates the modern CustomThemeDefinition setting and the related theme webresource logo node as described here.

Workflow overview

The command performs the following steps:

  1. Connects to the current Dataverse environment.
  2. Retrieves and validates the specified logo webresource (must be PNG, JPG, or GIF).
  3. If --appId or --appName is provided, resolves the target app context.
  4. Reads the current CustomThemeDefinition setting value (app-level or org-level).
  5. Creates or updates the theme webresource with the new logo reference.
  6. Publishes the updated theme webresource.

Important: the --color parameter

The --color parameter specifies the base palette color for the theme header.

It is REQUIRED when creating a new theme for the first time. Without it, the theme XML will be incomplete and the logo will not display in the UI.

When updating an existing theme, --color is optional. If omitted, the existing color is preserved. If provided, it overrides the current value.

Scenarios

Scenario 1: First-time setup (no theme exists)

No CustomThemeDefinition setting is configured yet. The command creates a new theme webresource, adds it to the specified solution (or the default solution), and saves the setting.

--color is mandatory in this case.

pacx webresources setEnvImage -n new_logo.png --color '#0078D4' --solution MySolution

Scenario 2: First-time setup with a local theme file

You have a local theme.xml file that you want to use as the base. The command reads the local file, updates the logo reference, creates the webresource, and saves both remotely and locally.

If the local file already contains a basePaletteColor, --color is optional. Otherwise, it is required.

pacx webresources setEnvImage -n new_logo.png --localThemeFile .\new_\themes\theme.xml --solution MySolution

Scenario 3: Updating an existing remote theme

The CustomThemeDefinition setting already points to a theme webresource on the server. The command retrieves the existing theme, updates the logo reference, and publishes.

--color is optional and will override the existing color only if provided.

pacx webresources setEnvImage -n new_logo.png

Scenario 4: Updating an existing theme and syncing to a local file

The theme already exists remotely. You want to update the logo and also save the updated theme XML to a local file for version control.

pacx webresources setEnvImage -n new_logo.png --localThemeFile .\new_\themes\theme.xml

Scenario 5: App-specific theme (instead of environment-level)

Use --appId or --appName to set the logo for a specific Model-Driven App rather than the entire environment.

pacx webresources setEnvImage -n new_logo.png --appName SalesHub --color "#107C10"
pacx webresources setEnvImage -n new_logo.png --appId 00000000-0000-0000-0000-000000000000

Scenario 6: Theme setting exists but webresource is missing

If the CustomThemeDefinition setting points to a webresource that no longer exists (e.g., deleted manually), the command will fail with an error. In this case, you must either recreate the webresource manually or clear the setting and re-run the command as a first-time setup.

Summary table

Setting exists Theme WR exists Local file --color required Behavior
No No No Yes Creates new theme and setting
No No Yes Depends on file Reads local file, creates WR and setting
Yes Yes No No Updates remote theme
Yes Yes Yes No Updates remote and saves to local
Yes No - - Error: WR not found

Additional examples

# First-time setup at environment level with a blue theme
pacx webresources setEnvImage -n new_logo.png --color "#0078D4" --solution MySolution

# Update existing theme with a new logo (no color change)
pacx webresources setEnvImage -n new_logo_v2.png

# Update existing theme and change color
pacx webresources setEnvImage -n new_logo.png --color '#E74C3C'

# Set logo for a specific app by name
pacx webresources setEnvImage -n new_logo.png --appName SalesHub --color '#107C10'

# Use a local theme file as base
pacx webresources setEnvImage -n new_logo.png --localThemeFile .\new_\themes\theme.xml --solution MySolution

Arguments

Long Name Short Name Required? Description Default value Valid values