Azure / Azure/azure-rest-api-specs

Container Registry Replication API should throw error while creating replication and container registry with the same location

Open
#10,233 2 comments 0 reactions 1 assignee Claimed by @yugangw-msft View on GitHub
Container Registry Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

After tested, I found Container Registry Replication API doesn't throw error while creating replication and container registry with the same location. I think it should throw error message. If you want to repro this issue, please ensure to follow below steps.

After do more investigation, I found creating replication with same location A immediately would throw error after container registry is created with location A successfully but it wouldn't throw error after container registry is created with location A and replication is created with location B successfully. I assume it should also throw error.

1. Http request to create container registry in canadacentral:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-aks-test02/providers/Microsoft.ContainerRegistry/registries/testacccrtest06

{
"location": "canadacentral",
"properties": {
"adminUserEnabled": false,
"networkRuleSet": {
"defaultAction": "Deny",
"virtualNetworkRules": [
{
"action": "Allow",
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-aks-test02/providers/Microsoft.Network/virtualNetworks/virtualNetworktest02/subnets/subnettest02"
}
],
"ipRules": []
}
},
"sku": {
"name": "Premium",
"tier": "Premium"
},
"tags": {}
}
```

2. Container registry is created successfully. It's expected.

3. Http request to create replication for canadaeast:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-aks-test02/providers/Microsoft.ContainerRegistry/registries/testacccrtest06/replications/canadaeast

{"location":"canadaeast"}
```

4. Replication with canadaeast is created successfully. It's expceted.

5. Http request to create replication for canadacentral:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-aks-test02/providers/Microsoft.ContainerRegistry/registries/testacccrtest06/replications/canadacentral

{"location":"canadacentral"}
```

6. Replication should throw error but it doesn't throw error.

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.