Skip to main content

CCM Azure Permissions

When adding the Harness service principal to your Azure tenant, there are many different permissions sets based on the features you are trying to leverage in specific subscriptions. This guide is meant to cover all the different features of CCM and the permissions you need to assign to enable them.

To enable specific features on a connector you need to set a specific string in the featuresEnabled field (list) in the connector YAML. The keys for each feature are listed in the sections below.

Cost Ingestion

featuresEnabled

BILLING

When to enable

The subscription where the storage account lives that holds your cost exports

To ingest cost from Azure, Harness leverages a Cost Export that is generated by Azure. These reports are delivered to a Storage Account in some subscription. When assigning permissions, we will need access to read the blob container where the exports are being delivered.

You will need to assign the built-in role Storage Blob Data Reader to the storage account which holds your exports.

Events/Inventory

featuresEnabled

VISIBILITY

When to enable

Subscriptions where infrastructure is provisioned, usually all

To let Harness collect inventory data (used in dashboards) and Advisor recommendations you need to give read permissions to the subscription. You can do this by assigning the built in Reader role.

Asset Governance

featuresEnabled

GOVERNANCE

When to enable

Subscriptions where infrastructure is provisioned, usually all

When enabling asset governance, it is best practice to start with a read-only policy so you can run rules in dry-run, receive out-of-the-box recommendations, and begin to create your own custom governance recommendations.

We suggest you use the Azure-provided Reader role which will allow Harness to access Azure resources in a read-only manner.

Once you are ready to perform actions using governance, you can create a custom policy to allow only the actions you want to take via governance, or use built-in roles to provide whatever access you are comfortable with.

For example if you are going to begin auto-deleting disks using governance, you might assign Microsoft.Compute/disks/delete.

Autostopping

featuresEnabled

OPTIMIZATION

When to enable

Subscriptions where infrastructure is provisioned, usually all

Autostopping has many ways to optimize resource usage and reduce costs. Across the different compute and routing SKUs there are many possible permissions needed. Based on your compute and application architecture you can use the following information to build a least-privileged policy.

VM with Fixed Schedules

PolicyUsage
Microsoft.Resources/subscriptions/resourcegroups/readList resource groups
Microsoft.Compute/virtualMachines/readList VMs
Microsoft.Compute/virtualMachines/start/actionStart VMs
Microsoft.Compute/virtualMachines/deallocate/actionStop VMs

VM with App Gateway

PolicyUsage
Microsoft.Network/virtualNetworks/readList virtual networks
Microsoft.Network/virtualNetworks/subnets/readList subnets
Microsoft.Network/publicIPAddresses/readList public IP addresses
Microsoft.Network/applicationGateways/readList app gateways
Microsoft.Storage/storageAccounts/write Microsoft.Storage/storageAccounts/read Microsoft.Storage/storageAccounts/listKeys/actionFor traffic detection using access logs
Microsoft.Web/sites/write Microsoft.Web/sites/read Microsoft.Web/sites/config/write Microsoft.Web/sites/functions/write Microsoft.Web/sites/functions/readCreate Azure function for initial warm up
Microsoft.Network/applicationGateways/write Microsoft.Network/virtualNetworks/subnets/join/action Microsoft.Network/publicIPAddresses/join/action microsoft.insights/diagnosticSettings/write Microsoft.Network/networkInterfaces/readPermissions to create application gateway
Microsoft.Network/applicationGateways/backendhealth/actionNeeded during warmup

Provisioning Autostopping Proxy

PolicyUsage
Microsoft.Network/virtualNetworks/readList virtual networks
Microsoft.Network/virtualNetworks/subnets/readList subnets
Microsoft.Network/networkSecurityGroups/readList network security groups
Microsoft.Network/networkSecurityGroups/securityRules/readList security rules
Microsoft.Compute/sshPublicKeys/readList SSH Keys
Microsoft.Network/publicIPAddresses/writecreate static IP
Microsoft.Network/publicIPAddresses/readRead IP address
Microsoft.Network/networkInterfaces/write Microsoft.Network/networkSecurityGroups/join/action Microsoft.Network/virtualNetworks/subnets/join/action Microsoft.Network/networkInterfaces/read Microsoft.Network/networkInterfaces/join/actionBasic permissions to setup VM
Microsoft.Compute/virtualMachines/writeCreate VM
Microsoft.Compute/virtualMachines/deleteDelete proxy VM
Microsoft.Network/publicIPAddresses/deleteDelete public IP allocated for proxy
Microsoft.Network/networkInterfaces/deleteDelete proxy network interface
Microsoft.Compute/disks/deleteDelete OS disk of proxy