Redigera

Dela via


Submit and approve catalog items

People must submit their catalog items for approval and an administrator must approve them before others can use them.

To submit an item to the catalog, you need:

  • A solution or package deployer package containing the item you want to submit.

  • A submission metadata JSON document.

    Use the pac catalog create-submission command to get an example submission metadata JSON document. You must edit this document and more submission attributes can be added. More information: Submission attributes

Submission attributes

Before you can submit items to a catalog, you must prepare a JSON document that describes the items you want to submit.

To help you, the pac catalog create-submission command generates a sample submission.json file.

You need to edit this file to submit an item. Here's an example:

{
  "modelVersion": "1.0.0.0",
  "operation": "CreateOrUpdate",
  "sourcePortal": 526430005,
  "businessJustification": "Power Platform custom connector for Conference API",
  "publisherDetails": {
    "publisherId": "ContosoConferencesTeam",
    "publisherDisplayName": "Catalog Conferences Team"
  },
  "catalogItemDefinition": {
    "id": "ContosoConferencesCustomConnector",
    "displayName": "Contoso Conference Custom Connector",
    "description": "Demo Custom connector to query Conference Speakers & Sessions",
    "offer": {
      "type": "Component_Collection",
      "deploymentType": "Normal",
      "engineeringName": {
        "firstName": "Jennifer",
        "lastName": "Wilkins",
        "email": "jwilkins@contoso.com",
        "phoneNumber": "555-111-1234"
      },
      "supportName": {
        "firstName": "Aidan",
        "lastName": "Hunt",
        "email": "ahunt@contoso.com",
        "phoneNumber": "555-111-1234"
      }
    }
  }
}

Learn about the valid properties for the submission file

Submit items to the catalog

Items submitted to the catalog need to be included within a package deployer package. A package deployer package contains a solution zip file and some optional instructions to apply when deploying the package. If you don't have a package deployer package, you can create one for the solution that contains your items.

After your submission metadata JSON document is ready, use the pac catalog submit command to submit it.

Use the required --path parameter to refer to the catalog submission JSON document.

If you already have a package deployer package:

  • Use the --package-zip parameter to refer to the package deployer package.
  • Otherwise, use the --solution-zip parameter to refer to this solution. The submit command creates the package behind the scenes.

If you want to combine polling the status of your submission request, use the --poll-status parameter. Otherwise, use the pac catalog status command as described in Check status of catalog submissions.

pac catalog submit -p "BuildDemoSubmission.json" -sz "ContosoConference_1_0_0_1_managed.zip"
Creating package for catalog submit request...
Connected to... TestCatalog
Connected as user@domain
Tracking id for this submission is 0e6b119d-80f3-ed11-8849-000d3a0a2d9d

What is Microsoft Power Platform CLI?

Create package deployer package from an unmanaged solution

When you use the mspcat_SubmitCatalogApprovalRequest message with the SDK for .NET or Web API as described in Submit items to the catalog, the submission JSON file must include a CatalogItemDefinition packageFile property set to specify a URL in the filesaslink to download a package deployer package file. You don't need to do this with the pac catalog submit command because it does this for you.

This URL can represent anywhere that Dataverse can download a file without any credentials, but we don't recommend you place the files on public download location. Instead, you can use the Package Submission Store (mspcat_PackageStore) table to generate a package deployer package using an unmanaged solution from any environment in your tenant. This process generates a record in this table that contains a package in the PackageFile (mspcat_PackageFile) file column. You can then use the GetFileSasUrl message to get a shared access signature (SAS) URL to enable anonymous downloading of the file within 1 hour. Because the URL is only valid within an hour, this process should be automated so that access to download the file doesn't expire.

Note

This example uses the mspcat_PackageStore.mspcat_packagefile column, but the GetFileSasUrl message can provide a SAS URL for any file or image column in Dataverse. Learn more about granting limited access to Dataverse files using shared access signatures

Process

  1. Create a Package Submission Store (mspcat_PackageStore) record with these values

    Column Value
    mspcat_name The name of the unmanaged solution
    mspcat_solutionuniquename The unique name of the unmanaged solution
    mspcat_intendeddeploymenttype 526430000 for Standard deployment
    mspcat_operation 958090001 for Create Package
  2. Update the statuscode value from 958090003 for Draft to 958090004 for Submitted.

    This update starts the process.

  3. Wait for statuscode to change to 958090001 for Completed.

  4. Use GetFileSasUrl to get a URL for the mspcat_PackageStore.mspcat_packagefile column. This returns a GetFileSasUrlResponse object.

  5. Create a CatalogFileAsset JSON object setting these properties:

    Property Value
    name GetFileSasUrlResponse.FileName
    filesaslink GetFileSasUrlResponse.SasUrl
  6. Set this to the CatalogItemDefinition packageFile property of the JSON submission file.

  7. Use the mspcat_SubmitCatalogApprovalRequest to send the submission as described in Submit items to the catalog

The PAC CLI pac catalog submit command manages this for you.

Check status of catalog submissions

The statuscode Choices/Options options of the Approval Request (mspcat_certificationrequest) table. Completed (2) represents a successful submission.

Value Label
1 Submitted
526430001 InProgress
526430002 Waiting On Submitter
526430003 Pending Deployment
526430008 Draft
526430009 Processing
2 Completed
526430000 Abandoned
526430004 Rejected
526430005 Marketing Content
526430006 Duplicate Request
526430010 Failed Prevalidation

Use the pac catalog status command to check the status of catalog submissions.

pac catalog status --tracking-id 0e6b119d-80f3-ed11-8849-000d3a0a2d9d --type submit
Connected to... TestCatalog
Connected as user@domain
Status of the Submit request: Submitted

What is Microsoft Power Platform CLI?

Approve catalog submissions

Catalog submissions are typically approved within the Power Platform Catalog Manager application.

There's no PAC CLI command to perform this operation.

Next steps