Azure / Azure/azure-rest-api-specs

[BUG] [AppGw] Existing agw, can't add a new probe and reference a backend to it in the same deploy

Open
#35,286 0 comments 0 reactions 0 assignees View on GitHub
bug customer-reported Mgmt Network question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/applicationGateway.json

### API Spec version

2022-07-01

### Describe the bug

On an existing application gateway with backends, listeners and probes, following does not work.

#### Rename existing probe

If you rename an existing probe, _and_ the reference to it from existing backend settings (`backendHttpSettingsCollection`), deployment will fail saying the reference probe does not exist.

Workaround:

1. Create a new probe first, deploy.
2. Then change references on existing backend settings to new probe, deploy.
3. Remove old probe. Deploy.

#### Create new probe + change reference to it on existing backend settings

If you create a new probe _and_ change reference on an existing backend settings (`backendHttpSettingsCollection`) to it in the same deployment, it will fail, saying new probe does not exist.

Workaround:

1. Create a new probe first, deploy.
2. Then change references on existing backend settings to new probe, deploy.

#### Output from azapi Terraform

```text
│ RESPONSE 400: 400 Bad Request
│ ERROR CODE: InvalidResourceReference
│ --------------------------------------------------------------------------------
│ {
│ "error": {
│ "code": "InvalidResourceReference",
│ "message": "Resource /subscriptions//resourceGroups//providers/Microsoft.Network/applicationGateways//probes/ referenced by resource /subscriptions//resourceGroups//providers/Microsoft.Network/applicationGateways//backendHttpSettingsCollection/ was not found. Please make sure that the referenced resource exists, and that both resources are in the same region.",
│ "details": []
│ }
│ }
```

### Expected behavior

One should be able to rename and add probes + change reference to probes in existing backend settings in the same deployment.

### Actual behavior

One must do it in a staged manner.

### Reproduction Steps

See description.

### Environment

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/applicationGateway.json and inspect probe and backendHttpSettingsCollection references. Reproduce the rename and same-deployment create-and-reference cases described in the issue, then determine whether the API specification identifies a change to make or only captures the service behavior. Done means the issue's expected same-deployment behavior is addressed or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi, terraform
Domain
api, backend-api-design, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.