Azure / Azure/azure-rest-api-specs
[BUG] Fail to create MS SQL Virtual Machine Availability Group Listener
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/1aa912658531534e4e57ea613591075f7b97897c/specification/sqlvirtualmachine/resource-manager/Microsoft.SqlVirtualMachine/stable/2022-02-01/sqlvm.json#L80
### API Spec version
2022-02-01
### Describe the bug
Hi team,
Recently we found creating MS SQL Virtual Machine Availability Group Listener would fail with below error. This issue happens since 2024-06-20. Could you take a look this regression issue? Thanks.
Request payload:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/acctestgr-fc1ng/availabilityGroupListeners/acctestli-fc1ng
{
"properties": {
"availabilityGroupConfiguration": {
"replicas": [
{
"commit": "Asynchronous_Commit",
"failover": "Manual",
"readableSecondary": "No",
"role": "Secondary",
"sqlVirtualMachineInstanceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-0-fc1ng"
},
{
"commit": "Synchronous_Commit",
"failover": "Automatic",
"readableSecondary": "All",
"role": "Primary",
"sqlVirtualMachineInstanceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-1-fc1ng"
}
]
},
"availabilityGroupName": "availabilitygroup1",
"createDefaultAvailabilityGroupIfNotExist": true,
"loadBalancerConfigurations": [
{
"loadBalancerResourceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.Network/loadBalancers/acctestlb-240715155531671155",
"privateIpAddress": {
"ipAddress": "10.0.2.11",
"subnetResourceId": "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.Network/virtualNetworks/acctestnw-240715155531671155/subnets/domain-clients-0"
},
"probePort": 51572,
"sqlVirtualMachineInstances": [
"/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-1-fc1ng",
"/subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/acctest-0-fc1ng"
]
}
],
"port": 1433
}
}
```
Error Message:
```
polling after CreateOrUpdate: polling failed: the Azure API returned the following error:
Status: "AccessDenied"
Code: ""
Message: "Access denied for resource '/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.Network/loadBalancers/acctestlb-240715155531671155'."
Activity Id: ""
---
API Response:
----[start]----
{"name":"02cada0c-2d51-4ac4-904b-b095323f5a895","status":"Failed","startTime":"2024-07-15T06:34:27.347Z","error":{"code":"AccessDenied","message":"Access denied for resource '/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-240715155531671155/providers/Microsoft.Network/loadBalancers/acctestlb-240715155531671155'."}}
-----[end]-----
```
### Expected behavior
The MS SQL Virtual Machine Availability Group Listener should be created successfully.
### Actual behavior
creating MS SQL Virtual Machine Availability Group Listener would fail
### Reproduction Steps
1. Create Resource Group
2. Create Virtual Network
3. Create Subnet
4. Create Network Interface
5. Create Windows Virtual Machine
6. Add Virtual Machine Extension to create active directory forest
7. Wait 12 minutes
8. Remove above Virtual Machine Extension and add a new Virtual Machine Extension to set ad user
9. Create subnet
10. Create 2 Network Interfaces
11. Create Availability Set
12. Create 2 windows Virtual Machine
13. Add virtual Machine Extension to join domain
14. Create MS SQL Virtual Machine
15. Create Storage Account
16. Create MS SQL Virtual Machine Group
17. Create Load Balancer
18. Create MS SQL Virtual Machine Availability Group Listener
### Environment
PROD
Contributor guide
Research direction
Start with the linked sqlvm.json API specification for version 2022-02-01 and compare the availability group listener request with the reported AccessDenied response for the load balancer resource. Follow the listed reproduction steps to confirm the regression; done means the listener is created successfully without the AccessDenied failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100