> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-azure-23.md).

# Azure Spring Cloud service is not configured with virtual network misconfiguration detected in code

## Azure Spring Cloud service is not configured with virtual network misconfiguration detected in code

### Rule Details

|                        |                                       |
| ---------------------- | ------------------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_AZURE\_23                    |
| Category - Subcategory | Public Exposure - VPC VCN VNet        |
| Provider               | AZURE                                 |
| Severity               | MEDIUM                                |
| Framework              | ARM, Bicep, Terraform, Terraform Plan |
| Mapped CSPM/KSPM Rule  | 05128e74-61e1-4e3c-a4e9-83d840efddb1  |

### Impact

This rule detects whether Azure Spring Cloud is configured with a Virtual Network. By leveraging a Virtual Network, you can isolate and secure Azure Spring Cloud within your own virtual network environment. This helps protect your resources and enables you to have more control over network traffic.

### How to Fix

*Resource:* azurerm\_spring\_cloud\_service

* *Arguments:* sku\_name, network.service\_runtime\_subnet\_id

### This configuration includes a virtual network and a subnet. Then it creates an Azure Spring Cloud service that references the subnet ID under the network block with service\_runtime\_subnet\_id, ensuring the Spring Cloud service is configured with a Virtual Network. The sku\_name is set to S0, which is different from B0. As a result, this satisfies both conditions of the Cortex Cloud AppSec rule: it ensures the SKU is not B0 and the Spring Cloud service is associated with a subnet in a Virtual Network. \[source,go]

provider "azurerm" { features {} }

resource "azurerm\_virtual\_network" "example" { name = "example-vnet" address\_space = \["10.0.0.0/16"] location = "East US" resource\_group\_name = "example-resources" }

resource "azurerm\_subnet" "example" { name = "example-subnet" resource\_group\_name = "example-resources" virtual\_network\_name = azurerm\_virtual\_network.example.name address\_prefixes = \["10.0.1.0/24"] }

resource "azurerm\_spring\_cloud\_service" "example" { name = "example-spring-cloud-service" resource\_group\_name = "example-resources" location = "East US" sku\_name = "S0" # SKU is not B0

network { service\_runtime\_subnet\_id = azurerm\_subnet.example.id

## app\_subnet\_id can also be included if needed

}

## Include other necessary configurations

### }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-azure-23.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
