Azure / Azure/azure-cli

Timeout on az sql server vnet-rule create when --enable-public-network false

Open
#15,247 4 comments 1 reaction 0 assignees View on GitHub
act-codegen-extensibility-squad Service Attention SQL
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Describe the bug
Operation time out while creating a vnet-rule in SQL server with `--enable-public-network false`.
During the execution, rule does show up in the UI as state: InProgress.

![image](https://user-images.githubusercontent.com/1564825/93912476-d16a7200-fcd1-11ea-9ac4-17cc25e8c2ca.png)

Rule disappears after timeout.

**Command Name**
`az sql server vnet-rule create`

**Errors:**
```
Deployment failed. Correlation ID: fa4103db-f22c-4912-ba73-e80267a94176. The operation timed out and automatically rolled back. Please retry the operation.
```

## To Reproduce:

```bash
> az sql server create ^
--admin-password {} ^
--admin-user {} ^
--name {} ^
--resource-group {} ^
--enable-public-network false # <- This makes it timeout.
```

```bash
# Subnet must have disabled private endpoint network policies.
# Subnet must have service endpoint for Microsoft.Sql.
> az network vnet subnet update ^
--resource-group {} ^
--vnet-name {} ^
--name {} ^
--disable-private-endpoint-network-policies true ^
--service-endpoints Microsoft.Sql
```
```bash
# Subnet must have a private endpoint for our SQL server.
> az network private-endpoint create ^
--group-id sqlServer ^
--connection-name Resources-To-Sql-Private-Link ^
--name Resources-To-Sql-Enpdoint ^
--private-connection-resource-id {} ^
--resource-group {} ^
--subnet {} ^
--vnet-name {}
```
```bash
# Finally, we create the firewall rule on SQL server to allow traffic from our subnet.
> az sql server vnet-rule create --server {} --name {} --resource-group {} --vnet-name {} --subnet {}
Deployment failed. Correlation ID: fa4103db-f22c-4912-ba73-e80267a94176. The operation timed out and automatically rolled back. Please retry the operation.
```
## Expected Behavior
Virtual network rule created on the SQL server firewall for our subnet to access. No time-out and disapearance.

## Environment Summary
```
Windows-10-10.0.18362-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.11.1 *

```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.