Resource Templates
This page contains the base examples for mapping Azure resources to Port.
This base example thrives to provide a simpler and more abstract way to map Azure resources to Port.
The simplification is achieved by using the generic cloudResource
blueprint, which can be used to map any Azure resource to Port.
Mapping Azure Subscriptionsโ
In the following example you will ingest your Azure Subscriptions to Port, you may use the following Port blueprint definitions and integration configuration:
Subscription Blueprint
{
"identifier": "azureSubscription",
"title": "Azure Subscription",
"icon": "Azure",
"schema": {
"properties": {},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
Mapping configuration for Azure Subscriptions
resources:
- kind: subscription
selector:
query: 'true'
apiVersion: '2022-09-01'
port:
entity:
mappings:
identifier: .id
title: .display_name
blueprint: '"azureSubscription"'
properties: {}
Here are the API references we used to create those blueprints and app config:
Mapping Resource Groupsโ
The Resource Group has a relation to the Subscription, so the creation of the Subscription blueprint is required.
In the following example you will ingest your Azure Resource Groups to Port, you may use the following Port blueprint definitions and integration configuration:
Resource Group blueprint
{
"identifier": "azureResourceGroup",
"description": "This blueprint represents an Azure Resource Group in our software catalog",
"title": "Resource Group",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string"
},
"tags": {
"title": "Tags",
"type": "object"
}
}
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"subscription": {
"target": "azureSubscription",
"title": "Subscription",
"required": false,
"many": false
}
}
}
Mapping Configuration for Resource group
resources:
- kind: Microsoft.Resources/resourceGroups
selector:
query: 'true'
apiVersion: '2022-09-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureResourceGroup"'
properties:
location: .location
provisioningState: .properties.provisioningState + .properties.provisioning_state
tags: .tags
relations:
subscription: >-
.id | split("/") | .[1] |= ascii_downcase |.[2] |= ascii_downcase
| .[:3] |join("/")
Here are the API references we used to create those blueprints and app config:
Mapping Cloud Resourcesโ
In the following example you will ingest your Azure Resources to Port, you may use the following Port blueprint definitions and integration configuration:
The Resources below have a relation to the Resource Group, so the creation of the Resource Group blueprint is required.
Cloud Resource Blueprint
{
"identifier": "azureCloudResource",
"title": "Cloud Resource",
"icon": "Azure",
"schema": {
"properties": {
"type": {
"icon": "Service",
"title": "Type",
"type": "string"
},
"location": {
"icon": "Home",
"title": "Location",
"type": "string"
},
"tags": {
"title": "Tags",
"type": "object",
"icon": "BlankPage"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"resource_group": {
"title": "Resource Group",
"target": "azureResourceGroup",
"required": false,
"many": false
}
}
}
Mapping configuration for cloud resources
The cloudResource
kind is a generic kind that can be used to map most cloud resources.
The mapping requires passing the resource kind and version as a parameter inside the resourceKinds
object.
It is possible that some of the kinds that you want to export are not in this example, head to the bottom of the page to see how to add them.
resources:
- kind: Microsoft.App/containerApps
selector:
query: 'true'
apiVersion: '2022-03-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureCloudResource"'
properties:
location: .location
type: .type
tags: .tags
relations:
resource_group: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase
| .[:5] |join("/")
- kind: Microsoft.Storage/storageAccounts
selector:
query: 'true'
apiVersion: '2023-01-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureCloudResource"'
properties:
location: .location
type: .type
tags: .tags
relations:
resource_group: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase
| .[:5] |join("/")
- kind: Microsoft.Compute/virtualMachines
selector:
query: 'true'
apiVersion: '2023-03-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureCloudResource"'
properties:
location: .location
type: .type
tags: .tags
relations:
resource_group: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase
| .[:5] |join("/")
- kind: Microsoft.ContainerService/managedClusters
selector:
query: 'true'
apiVersion: '2023-05-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureCloudResource"'
properties:
location: .location
type: .type
tags: .tags
relations:
resource_group: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase
| .[:5] |join("/")
- kind: Microsoft.Network/loadBalancers
selector:
query: 'true'
apiVersion: '2023-02-01'
port:
entity:
mappings:
identifier: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase |
join("/")
title: .name
blueprint: '"azureCloudResource"'
properties:
location: .location
type: .type
tags: .tags
relations:
resource_group: >-
.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase
| .[:5] |join("/")
Here are the API references we used to create those blueprints and app config:
Mapping Extra Resourcesโ
The resources in this page are only a few of the resources that the Azure Exporter supports.
If the resources you want to ingest into Port do not appear in these examples, you can head to the Mapping Extra Resources page to learn about all of the kinds of Azure resources that are supported by the Azure integration and how to map them into Port.
Advanced Use Casesโ
In certain scenarios you may want to model your Azure resources in a more detailed way.
For example, you may want to model a Storage Account and its Containers separately.
For these cases, head to the Advanced Resource templates page to learn how to model your Azure resources in a more detailed way.