Azure Compute Disk Access

This page shows how to write Terraform and Azure Resource Manager for Compute Disk Access and write them securely.

azurerm_disk_access (Terraform)

The Disk Access in Compute can be configured in Terraform with the resource name azurerm_disk_access. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_disk_access" "example" {
  name                = var.name
  resource_group_name = var.resource
  location            = var.location

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Disk Access.

Tips: Best Practices for The Other Azure Compute Resources

In addition to the azurerm_linux_virtual_machine, Azure Compute has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_linux_virtual_machine

Ensure to use SSH authentication for virtual machines

It is better to use SSH authentication for virtual machines instead of password authentication to enforce more secure ways.

risk-label

azurerm_managed_disk

Ensure to enable the encryption on managed disks

It is better to enable the encryption on managed disks.

risk-label

azurerm_virtual_machine

Ensure to use SSH authentication for virtual machines

It is better to use SSH authentication for virtual machines instead of password authentication to enforce more secure ways.

Review your Azure Compute settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.Compute/diskAccesses (Azure Resource Manager)

The diskAccesses in Microsoft.Compute can be configured in Azure Resource Manager with the resource name Microsoft.Compute/diskAccesses. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

ListDiskAccessesInASubscription.json#L15
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInAResourceGroup.json#L16
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInASubscription.json#L15
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInASubscription.json#L15
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInAResourceGroup.json#L16
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInAResourceGroup.json#L16
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
CreateADiskAccess.json#L16
        "type": "Microsoft.Compute/diskAccesses"
      }
    },
    "200": {
      "body": {
        "name": "myDiskAccess",
UpdateADiskAccess.json#L19
        "type": "Microsoft.Compute/diskAccesses",
        "location": "West US",
        "tags": {
          "department": "Development",
          "project": "PrivateEndpoints"
        }
ListDiskAccessesInASubscription.json#L15
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },
ListDiskAccessesInASubscription.json#L15
            "type": "Microsoft.Compute/diskAccesses",
            "location": "westus",
            "tags": {
              "department": "Development",
              "project": "PrivateEndpoints"
            },

Frequently asked questions

What is Azure Compute Disk Access?

Azure Compute Disk Access is a resource for Compute of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Compute Disk Access?

For Terraform, the VentsislavDinev/en_sample source code example is useful. See the Terraform Example section for further details.

For Azure Resource Manager, the Azure/autorest.az, Azure/autorest.az and changlong-liu/autorest.tests source code examples are useful. See the Azure Resource Manager Example section for further details.