Skip to main content

Advanced Examples

Mapping Storage Resources​

In the following example you will ingest your Azure Storage Accounts and Containers to Port, you may use the following Port blueprint definitions and integration configuration:

note

The Storage Account has a relation to the Resource Group, so creation of the Resource Group blueprint is required.

Storage Account Blueprint
{
"identifier": "azureStorageAccount",
"description": "This blueprint represents an Azure Storage Account in our software catalog",
"title": "Storage Account",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string",
"enum": ["Creating", "ResolvingDNS", "Succeeded"]
},
"creationTime": {
"title": "Creation Time",
"type": "string",
"format": "date-time"
},
"isHnsEnabled": {
"title": "Is HNS Enabled",
"type": "boolean",
"default": false
},
"fileEncryptionEnabled": {
"title": "File Encryption Enabled",
"type": "boolean"
},
"blobEncryptionEnabled": {
"title": "Blob Encryption Enabled",
"type": "boolean"
},
"primaryLocation": {
"title": "Primary Location",
"type": "string"
},
"secondaryLocation": {
"title": "Secondary Location",
"type": "string"
},
"statusOfPrimary": {
"title": "Status of Primary",
"type": "string",
"enum": ["available", "unavailable"],
"enumColors": {
"unavailable": "red",
"available": "green"
}
},
"statusOfSecondary": {
"title": "Status of Secondary",
"type": "string",
"enum": ["available", "unavailable"],
"enumColors": {
"unavailable": "red",
"available": "green"
}
},
"tags": {
"title": "Tags",
"type": "object"
},
"allowBlobPublicAccess": {
"title": "Allow Blob Public Access",
"type": "boolean"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}
Storage Container Blueprint
{
"identifier": "azureStorageContainer",
"description": "This blueprint represents an Azure Storage Container in our software catalog",
"title": "Storage Container",
"icon": "Azure",
"schema": {
"properties": {
"publicAccess": {
"title": "Public Access",
"type": "string"
},
"hasImmutabilityPolicy": {
"title": "Has Immutability Policy",
"type": "boolean"
},
"hasLegalHold": {
"title": "Has Legal Hold",
"type": "boolean"
},
"deleted": {
"title": "Deleted",
"type": "boolean"
},
"deletedTime": {
"title": "Deleted Time",
"type": "string"
},
"remainingRetentionDays": {
"title": "Remaining Retention Days",
"type": "number"
},
"leaseStatus": {
"title": "Lease Status",
"type": "string"
},
"leaseState": {
"title": "Lease State",
"type": "string"
},
"defaultEncryptionScope": {
"title": "Default Encryption Scope",
"type": "string"
},
"version": {
"title": "Version",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"storageAccount": {
"target": "azureStorageAccount",
"title": "Storage Account",
"required": false,
"many": false
}
}
}

Mapping configuration for Storage Account and Storage Container

resources:
- kind: Microsoft.Storage/storageAccounts
selector:
query: "true"
# azure resource api version to query
apiVersion: "2023-01-01"
port:
entity:
mappings:
# lowercase only the resourceGroups namespace and name to align how azure API returns the resource group reference
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureStorageAccount"'
properties:
location: .location
provisioningState: .properties.provisioningState
creationTime: .properties.creationTime
isHnsEnabled: .properties.isHnsEnabled
fileEncryptionEnabled: .properties.encryption.services.file.enabled
blobEncryptionEnabled: .properties.encryption.services.blob.enabled
primaryLocation: .properties.primaryLocation
secondaryLocation: .properties.secondaryLocation
statusOfPrimary: .properties.statusOfPrimary
statusOfSecondary: .properties.statusOfSecondary
allowBlobPublicAccess: .properties.allowBlobPublicAccess
tags: .tags
relations:
# resolve resource group id from storage account id
resourceGroup: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | .[:5] |join("/")'

- kind: Microsoft.Storage/storageAccounts/blobServices/containers
selector:
query: "true"
# azure resource api version to query
apiVersion: "2023-01-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureStorageContainer"'
properties:
publicAccess: .properties.publicAccess
hasImmutabilityPolicy: .properties.hasImmutabilityPolicy
hasLegalHold: .properties.hasLegalHold
deleted: .properties.deleted
deletedTime: .properties.deletedTime
remainingRetentionDays: .properties.remainingRetentionDays
leaseStatus: .properties.leaseStatus
leaseState: .properties.leaseState
defaultEncryptionScope: .properties.defaultEncryptionScope
version: .properties.version
relations:
# resolve storage account id from container id
storageAccount: '.id | split("/") | .[3] |= ascii_downcase | .[4] |= ascii_downcase | .[:-4] | join("/")'

Here are the API references we used to create those blueprints and app config:

Mapping Compute Resources​

In the following example you will ingest your Azure Resources to Port, you may use the following Port blueprint definitions and integration configuration:

note

The Resources below have a relation to the Resource Group, so creation of the Resource Group blueprint is required.

AKS blueprint
{
"identifier": "azureAks",
"description": "This blueprint represents an Azure Kubernetes Service in our software catalog",
"title": "AKS",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string"
},
"powerState": {
"title": "Power State",
"type": "string"
},
"kubernetesVersion": {
"title": "Kubernetes Version",
"type": "string"
},
"currentKubernetesVersion": {
"title": "Current Kubernetes Version",
"type": "string"
},
"dnsPrefix": {
"title": "DNS Prefix",
"type": "string"
},
"fqdn": {
"title": "FQDN",
"type": "string"
},
"nodeResourceGroup": {
"title": "Node Resource Group",
"type": "string"
},
"enableRBAC": {
"title": "Enable RBAC",
"type": "boolean"
},
"supportPlan": {
"title": "Support Plan",
"type": "string"
},
"networkPlugin": {
"title": "Network Plugin",
"type": "string"
},
"podCIDR": {
"title": "Pod CIDR",
"type": "string"
},
"serviceCIDR": {
"title": "Service CIDR",
"type": "string"
},
"dnsServiceIp": {
"title": "DNS Service IP",
"type": "string"
},
"outboundType": {
"title": "Outbound Type",
"type": "string"
},
"loadBalancerSKU": {
"title": "Load Balancer SKU",
"type": "string"
},
"maxAgentPools": {
"title": "Max Agent Pools",
"type": "number"
},
"skuTier": {
"title": "Tier",
"type": "string",
"enum": ["Free", "Paid", "Standard"]
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}
Container App blueprint
{
"identifier": "azureContainerApp",
"description": "This blueprint represents an Azure Container App in our software catalog",
"title": "Container App",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string",
"enum": ["Canceled", "InProgress", "Succeeded", "Deleting", "Failed"]
},
"outboundIpAddresses": {
"title": "Outbound IP Addresses",
"type": "array"
},
"externalIngress": {
"title": "External Ingress",
"type": "boolean"
},
"hostName": {
"title": "Host Name",
"type": "string"
},
"minReplicas": {
"title": "Min Replicas",
"type": "number"
},
"maxReplicas": {
"title": "Max Replicas",
"type": "number"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}
Load Balancer blueprint
  {
"identifier": "azureLoadBalancer",
"description": "This blueprint represents an Azure Load Balancer in our software catalog",
"title": "Load Balancer",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"tags": {
"title": "Tags",
"type": "object"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string",
"enum": [
"Succeeded",
"Updating",
"Deleting",
"Failed"
]
},
"frontendIpResourceIds": {
"title": "Frontend IP Resource IDs",
"type": "array"
},
"backendAddressPoolsResourceIds": {
"title": "Backend Address Pools Resource IDs",
"type": "array"
},
"loadBalancingRulesResourceIds": {
"title": "Load Balancing Rules Resource IDs",
"type": "array"
},
"probesResourceIds": {
"title": "Probes Resource IDs",
"type": "array"
},
"inboundNatRulesResourceIds": {
"title": "Inbound NAT Rules Resource IDs",
"type": "array"
},
"inboundNatPoolsResourceIds": {
"title": "Inbound NAT Pools Resource IDs",
"type": "array"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
},

Virtual Machine blueprint
{
"identifier": "azureVirtualMachine",
"description": "This blueprint represents an Azure Virtual Machine in our software catalog",
"title": "Virtual Machine",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"provisioningState": {
"title": "Provisioning State",
"type": "string"
},
"vmSize": {
"title": "VM Size",
"type": "string"
},
"osDiskName": {
"title": "OS Disk Name",
"type": "string"
},
"osDiskType": {
"title": "OS Disk Type",
"type": "string"
},
"osDiskCaching": {
"title": "OS Disk Caching",
"type": "string"
},
"osDiskSizeGB": {
"title": "OS Disk Size GB",
"type": "number"
},
"osDiskCreateOption": {
"title": "OS Disk Create Option",
"type": "string"
},
"networkInterfaceIds": {
"title": "Network Interface IDs",
"type": "array"
},
"licenseType": {
"title": "License Type",
"type": "string"
},
"vmOsProfile": {
"title": "VM OS Profile",
"type": "object"
},
"vmHardwareProfile": {
"title": "VM Hardware Profile",
"type": "object"
},
"vmStorageProfile": {
"title": "VM Storage Profile",
"type": "object"
},
"tags": {
"title": "Tags",
"type": "object"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}
Web App blueprint
{
"identifier": "azureWebApp",
"description": "This blueprint represents an Azure Web App in our software catalog",
"title": "Web App",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"state": {
"title": "State",
"type": "string"
},
"enabled": {
"title": "Enabled",
"type": "boolean"
},
"defaultHostName": {
"title": "Default Host Name",
"type": "string"
},
"appServicePlanId": {
"title": "App Service Plan ID",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}

Mapping Configuration for AKS, ContainerApp, LoadBalancer, VirtualMachine and WebApp

resources:
- kind: Microsoft.App/containerApps
selector:
query: "true"
# azure resource api version to query
apiVersion: "2023-05-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureContainerApp"'
properties:
location: .location
provisioningState: .properties.provisioningState
outboundIpAddresses: .properties.outboundIpAddresses
externalIngress: .properties.configuration.ingress.external
hostName: .properties.configuration.ingress.fqdn
minReplicas: .properties.template.scale.minReplicas
maxReplicas: .properties.template.scale.maxReplicas
relations:
resourceGroup: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | .[:5] |join("/")'
- kind: Microsoft.ContainerService/managedClusters
selector:
query: "true"
# azure resource api version to query
apiVersion: "2023-05-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureAks"'
properties:
location: .location
provisioningState: .properties.provisioningState
powerState: .properties.powerState.code
kubernetesVersion: .properties.kubernetesVersion
currentKubernetesVersion: .properties.currentKubernetesVersion
dnsPrefix: .properties.dnsPrefix
fqdn: .properties.fqdn
nodeResourceGroup: .properties.nodeResourceGroup
enableRBAC: .properties.enableRBAC
supportPlan: .properties.supportPlan
networkPlugin: .properties.networkProfile.networkPlugin
podCIDR: .properties.networkProfile.podCidr
serviceCIDR: .properties.networkProfile.serviceCidr
dnsServiceIp: .properties.networkProfile.dnsServiceIP
outboundType: .properties.networkProfile.outboundType
loadBalancerSKU: .properties.networkProfile.loadBalancerSku
maxAgentPools: .properties.maxAgentPools
skuTier: .properties.sku.tier
relations:
resourceGroup: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | .[:5] |join("/")'
- kind: Microsoft.Network/loadBalancers
selector:
query: "true"
# azure resource api version to query
apiVersion: "2023-05-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureLoadBalancer"'
properties:
location: .location
provisioningState: .properties.provisioningState
tags: .tags
frontendIpResourceIds: .properties.frontendIPConfigurations[].id
backendAddressPoolResourceIds: .properties.backendAddressPools[].id
loadBalancingRulesResourceIds: .properties.loadBalancingRules[].id
probesResourceIds: .properties.probes[].id
inboundNatRulesResourceIds: .properties.inboundNatRules[].id
inboundNatPoolsResourceIds: .properties.inboundNatPools[].id
relations:
resourceGroup: '.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: '"azureVirtualMachine"'
properties:
location: .location
provisioningState: .properties.provisioningState
vmSize: .properties.hardwareProfile.vmSize
osDiskName: .properties.storageProfile.osDisk.name
osType: .properties.storageProfile.osDisk.osType
osDiskCaching: .properties.storageProfile.osDisk.caching
osDiskSizeGB: .properties.storageProfile.osDisk.diskSizeGB
osDiskCreateOption: .properties.storageProfile.osDisk.createOption
networkInterfaceIds: .properties.networkProfile.networkInterfaces[].id
licenseType: .properties.licenseType
vmOsProfile: .properties.osProfile
vmHardwareProfile: .properties.hardwareProfile
vmStorageProfile: .properties.storageProfile
tags: .tags
relations:
resourceGroup: '.id | split("/") | .[3] |= ascii_downcase | .[4] |= ascii_downcase | .[:5] |join("/")'
- kind: Microsoft.Web/sites
selector:
query: "true"
apiVersion: "2022-03-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azureWebApp"'
properties:
location: .location
state: .properties.state
enabled: .properties.enabled
defaultHostName: .properties.defaultHostName
appServicePlanId: .properties.serverFarmId
relations:
resourceGroup: '.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 Database Resources​

In the following example you will ingest your Azure Database Resources to Port, you may use the following Port blueprint definitions and integration configuration:

note

The Database Resources below have a relation to the Resource Group, so creation of the Resource Group blueprint is required.

Postgres Flexible Server blueprint
{
"identifier": "azurePostgresFlexibleServer",
"description": "This blueprint represents an Azure Postgres Flexible Server in our software catalog",
"title": "Postgres Flexible Server",
"icon": "Azure",
"schema": {
"properties": {
"location": {
"title": "Location",
"type": "string"
},
"version": {
"title": "Version",
"type": "string"
},
"state": {
"title": "State",
"type": "string"
},
"storageSizeGB": {
"title": "Storage Size (GB)",
"type": "number"
},
"activeDirectoryAuth": {
"title": "Active Directory Authentication",
"type": "string",
"enum": ["Enabled", "Disabled"]
},
"passwordAuth": {
"title": "Password Authentication",
"type": "string",
"enum": ["Enabled", "Disabled"]
},
"publicNetworkAccess": {
"title": "Public Network Access",
"type": "string",
"enum": ["Enabled", "Disabled"]
},
"geoRedundantBackup": {
"title": "Geo-Redundant Backup",
"type": "string",
"enum": ["Enabled", "Disabled"]
},
"earliestRestoreDate": {
"title": "Earliest Restore Date",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"resourceGroup": {
"target": "azureResourceGroup",
"title": "Resource Group",
"required": false,
"many": false
}
}
}
Mapping Configuration for Postgres Flexible Server
resources:
- kind: Microsoft.DBforPostgreSQL/flexibleServers
selector:
query: "true"
apiVersion: "2022-12-01"
port:
entity:
mappings:
identifier: '.id | split("/") | .[3] |= ascii_downcase |.[4] |= ascii_downcase | join("/")'
title: .name
blueprint: '"azurePostgresFlexibleServer"'
properties:
location: .location
version: .properties.version
state: .properties.state
storageSizeGB: .properties.storage.storageSizeGB
activeDirectoryAuth: .properties.authConfig.activeDirectoryAuth
passwordAuth: .properties.authConfig.passwordAuth
publicNetworkAccess: .properties.network.publicNetworkAccess
geoRedundantBackup: .properties.backup.geoRedundantBackup
earliestRestoreDate: .properties.backup.earliestRestoreDate
relations:
resourceGroup: '.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 few of the resources that the Azure Exporter supports. If you don't find the Azure resource you want to map to Port head to the Mapping Extra Resources page to learn about what kind of azure resources are supported by the Azure integration and how to map them into Port.