Skip to content

Export Provider metadata to another environment with Sidra CLI tool

Provider metadata Import/Export is an easy and convenient way to replicate the Provider metadata in one Sidra environment to a different environment.

This tutorial describes how to perform such operations through the help of Sidra CLI tool, using its Provider command.

1. Introduction

Sidra CLI tool is a command-line interface utility to simplify Sidra installations, deployments and upgrades.

Sidra CLI tool includes additional utilities, such as the Provider Import/Export in order to simplify the process of setting up and promoting metadata across Sidra environments.

Internally, the CLI tool collects the exported data to be imported at the destination in a transparent way to the user. This means the CLI command do not allow for the exported data from the source environment to be available in a standalone format.

2. Pre-requirements

Sidra CLI tool needs to be present, with its prerequisites installed, in order to execute the commands described below. Sidra CLI tool has a command to install its prerequisites.

Additionally, it is needed that an Azure DevOps profile has been created with the common shared information for a series of steps, that is, the profile command.

More information on how to set up an Azure DevOps profile through the CLI tool is described here.

When using the Sidra CLI tool, we will execute this profile command always at the destination environment,

therefore the destination environment will be the one where the profile command will be pointing to, that is, the environment where the Provider metadata will be copied to.

Internally, the profile command will expose the info about where the subscription and KeyVault where we will bring the data.

This will be the environment that has the KeyVault in which to bring all the info from the source environment, and which will be submitted through the subsequent CLI command parameters.

Step 1: Register the source to import data

Next, continuing from the destination environment (where the Provider metadata will be copied to), the whole import/export command is executed through a couple of commands.

The first command is the provider registerimportsource command, which will set up the needed parameters to execute the import command:

  • destinationTenantId: The destination Azure subscription where the Provider metadata will be copied to. This parameter is required for validation purposes.
  • sourceInstallationId: The installation Id for the installation where the data will be copied from (source). This is a string that will be used as a prefix when storing the secrets for the source environment in the destination KeyVault. For example, for the string "impsource", the names of the secrets stored will be "impsource--IdentityServer", "impsource--SidraCoreApiUrl", etc.
  • sourceSidraCoreApiUrl: The secret value that contains the root of the Sidra Core API URL of the source environment (where the data will be copied from).
  • sourceIdentityServerUrl: The secret value that contains the root of the Identity Server API URL of the source environment (where the data will be copied from).
  • sourceTransferClientSecret: The secret value that contains the source Client Secret of the source environment.
  • sourceTransferClientId: The scret value that contains the source Client ID. Example: "coreClient".

    provider registerimportsource --destinationTenantId <destinationTenantId> --sourceInstallationId <sourceInstallationId> --sourceSidraCoreApiUrl <sourceSidraCoreApiUrl> --sourceIdentityServerUrl <sourceIdentityServerUrl> --sourceTransferClientSecret <sourceTransferClientSecret> --sourceTransferClientId <sourceTransferClientId>

The command provider registerimportsource is required for registering a series of secrets that are needed inside the KeyVault.

Sidra CLI register import source

Step 2: Import metadata

After registering the import source data, the next step is executing the provider import command.

provider import --destinationTenantId <destinationTenantId> --sourceInstallationId <sourceInstallation ID> --datafactoryId <datafactoryId> --providerItemsId <providerItemsId>

where:

  • destinationTenantId: The destination Azure subscription where the Provider metadata will be copied to. This parameter is required for validation purposes.
  • sourceInstallationId:The installation Id for the installation where the data will be copied from (source).
  • datafactoryId: The Data Factory Id at source. Example: 1.
  • providerItemsId: The list of Provider Item IDs to copy the data from. Example: "['5c384fed-84cc-44a6-b34a-b060bf102a6e']".

There is not an Export command, as it is not intended to do an explicit export of the Provider metadata outside of the action of importing the metadata into a different Sidra installation.

Sidra CLI import source


Last update: 2023-06-22