Distribution policies - example

You create distribution policies to determine how apps are distributed to your cloud deployments. Distribution policies are mandatory when you want to distribute apps from Qlik Sense Enterprise to Qlik Cloud Services or Qlik Sense Enterprise for elastic deployments. Once created, any published app that matches the criteria in the distribution policy is distributed to the defined targets and then automatically redistributed if it is changed, for example, after a reload.

In this topic you will find examples of how to create a distribution policy.

Creating a distribution policy

You create the distribution policy in the QMC. When you distribute apps, you also need to define where they should be published and who should have access to them. For that purpose you use custom properties, which you also create in the QMC.

Example: A distribution policy for distributing apps to different deployments and countries

Begin by creating the custom properties and then use them in the distribution policy.

Creating custom properties for deployments and countries

The first custom property will contain countries as values. With this custom property, you define to which collections (countries) you distribute an app.

Предупреждение: Custom property names must be in lowercase. If you use uppercase letters, the app will not show up in the collections, and there will be no error message.

Выполните следующие действия.

  1. In the QMC, open the Custom properties section.

  2. Click P Create new.

  3. Name the custom property collections.

  4. Under Resource types, select Apps.

  5. Under Values, click P Create new.

  6. Type US as a value.

  7. Add the following values in the same way: Canada, Sweden, Norway, Nordics, Germany.

  8. Click Apply.

You follow the same steps to create the second custom property.

Выполните следующие действия.

  • Create a custom property called deployments, with the values Elastic and CloudService.

    With this custom property you define to which deployments (QSE for elastic deployments or QCS) you distribute an app.

Now you have two custom properties that you can use in the distribution policy.

Creating an additional custom property for granting a user group access to an app

Примечание: The following custom properties are primarily intended for use in multi-cloud.

In addition to deciding to which deployment and collection to publish an app, you must, for access control, create a custom property groupswithaccess, to define which group or groups of users that should have access to the app.

Выполните следующие действия.

  • Create a custom property in the same way as before, with the name groupswithaccess, and the values RD, Sales, and Dev.

When you are in the hub and click Publish, you set which user groups that should have access to the app.

Подсказка: In a similar manner to groupswithaccess, you can also create a custom property userswithaccess to assign access to individual users.

Creating the distribution policy

Выполните следующие действия.

  1. In the QMC, open the Distribution policies section.

  2. Click P Create new.

  3. Name the distribution policy DistributeToDeployments.

  4. Under Basic, verify that the resource filter value is App_* and the action Distribute is selected.

  5. In the rule editor keep the values subject, name, =, and value. You only need to add the following to the last field: resource.@deployments.

    The Conditions box in the Advanced section should have the following string: ((subject.name=resource.@deployments)). This could be read as follows:

    "If the deployment name equals the custom property of the app, the app will be distributed to that deployment."

  6. Click Validate rule.

    The rule syntax is checked, and, if valid, a confirmation is displayed.

  7. Click Apply to save the rule.

For a presentation of distribution policies in use, see Step-by-step - Publishing an app to a collection.