- 18 Jul 2020
- 2 Minutes to read
- Updated on 18 Jul 2020
- 2 Minutes to read
Rules are used to auto-assign the unmapped resources to the required scope, environment and logical resource.
- User can add, delete and apply rules by using the buttons provided at the top
- The created rules can also be edited at anytime
Resource Map level rules
These rules will be used to assign the unmapped resources to the required scope, environment and logical resource. Default rules will be available to assign the resource to the required scope, environment and logical resource respectively with default tag names.
Scope level rules
These rules can be used to assign the unmapped resources in the scope to the required environment and logical resource. The scope rules come in to play if you use tag names other than the tags defined in the rules of Resources section of Resource Map.
How to use rules?
Follow the below steps to use the Resource map rules
Create the required tags for the resource in the Azure Portal. For example, I have a logic app named BAM Staging with the three tags.
Scope Path - This tag is used to assign the resource to the required scope. The scope path can be copied from the summary section of Scopes
Environment - This tag is used to assign the resource to the required environment
Logical resource - This tag is used to assign the resource to the required logical resource
Edit the tag names in Resource map rules with the tags you use in the azure resources
Click on the Apply Rules button
Now you can see the resources mapped to the required Environment, logical resource and scope.
If the need is to create the Rules with Resource group name, Resource Type and Name of the resource along with Tag Name, user can go for Advanced filtering. The following operators can be used for comparison.
- Equal to(=)
- Not Equal to(!=)
You can also use the following logical operators to combine multiple conditions
Following are some of the examples for creating Advanced rules
ResourceGroup = "Development"
Name like "%dev%"
Name like "%dev%" and ResourceGroup = "Development"
scope like "%dev%"
Here a tag with key scope must be present in the resource
The resources matching the rule will be mapped to the selected scope.
This advanced rules can also be created to map the resources to the required Environment and Logical resource.
- The rules will be applied when the resources are synced manually and during auto-sync.
- The rules can also be applied manually by clicking the Apply rules button.
- When a matching logical resource in an environment is not found, a new logical resource will be created.
- If a resource has more than one matching tags, the resource will not be auto-assigned.
- Since the rule application is done in the background, it may take up to two minutes to reflect the resource mappings in the Serverless360 portal.