azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

The latest version of azure-mgmt-containerregistry uses old API and doesn`t return properties.anonymousPullEnabled field

Open vit-corp opened this issue 1 year ago • 4 comments

  • Package Name: azure-mgmt-containerregistry
  • Package Version: 10.3.0
  • Operating System: Any
  • Python Version: Any

Describe the bug The latest version of azure-mgmt-containerregistry uses old API and doesn`t return properties.anonymousPullEnabled field. When I try to list all container registries, it returns json without properties.anonymousPullEnabled field. It blocks us in our development goals.

Expected behavior { "sku": { "name": "Standard", "tier": "Standard" }, "type": "Microsoft.ContainerRegistry/registries", "id": "/subscriptions/1111111111111111111111111111/resourceGroups/resource-group/providers/Microsoft.ContainerRegistry/registries/acr354green", "name": "name", "location": "eastus", "tags": {}, "systemData": { "createdBy": "[email protected]", "createdByType": "User", "createdAt": "2024-08-27T20:51:40.4164262+00:00", "lastModifiedBy": "[email protected]", "lastModifiedByType": "User", "lastModifiedAt": "2024-08-27T20:51:40.4164262+00:00" }, "properties": { "loginServer": "server.azurecr.io", "creationDate": "2024-08-27T20:51:40.4164262Z", "provisioningState": "Succeeded", "adminUserEnabled": false, "policies": { "quarantinePolicy": { "status": "disabled" }, "trustPolicy": { "type": "Notary", "status": "disabled" }, "retentionPolicy": { "days": 7, "lastUpdatedTime": "2024-08-27T20:51:47.6966832+00:00", "status": "disabled" }, "exportPolicy": { "status": "enabled" }, "azureADAuthenticationAsArmPolicy": { "status": "enabled" }, "softDeletePolicy": { "retentionDays": 7, "lastUpdatedTime": "2024-08-27T20:51:47.6967294+00:00", "status": "disabled" } }, "encryption": { "status": "disabled" }, "dataEndpointEnabled": false, "dataEndpointHostNames": [], "privateEndpointConnections": [], "publicNetworkAccess": "Enabled", "networkRuleBypassOptions": "AzureServices", "zoneRedundancy": "Disabled", "anonymousPullEnabled": false, "metadataSearch": "Disabled" } }

Actual behavior { "id": "/subscriptions/1111111111111111111111111111/resourceGroups/resource-group/providers/Microsoft.ContainerRegistry/registries/acr354green", "name": "name", "type": "Microsoft.ContainerRegistry/registries", "location": "eastus", "tags": {}, "systemData": { "createdBy": "[email protected]", "createdByType": "User", "createdAt": "2024-08-27T20:51:40.416426Z", "lastModifiedBy": "[email protected]", "lastModifiedByType": "User", "lastModifiedAt": "2024-08-27T20:51:40.416426Z" }, "sku": { "name": "Standard", "tier": "Standard" }, "properties": { "loginServer": "server.azurecr.io", "creationDate": "2024-08-27T20:51:40.416426Z", "provisioningState": "Succeeded", "adminUserEnabled": false, "policies": { "quarantinePolicy": { "status": "disabled" }, "trustPolicy": { "type": "Notary", "status": "disabled" }, "retentionPolicy": { "days": 7, "lastUpdatedTime": "2024-08-27T20:51:47.696683Z", "status": "disabled" }, "exportPolicy": { "status": "enabled" } }, "encryption": { "status": "disabled" }, "dataEndpointEnabled": false, "dataEndpointHostNames": [], "privateEndpointConnections": [], "publicNetworkAccess": "Enabled", "networkRuleBypassOptions": "AzureServices", "zoneRedundancy": "Disabled" }, "resourceGroup": "resource-group",

}

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Please add properties.anonymousPullEnabled field.

vit-corp avatar Aug 27 '24 21:08 vit-corp

Thanks for your issue, we'll take a look and get back to you as soon as possible.

kristapratico avatar Aug 27 '24 21:08 kristapratico

@ChenxiJiang333 Please help on this issue.

msyyc avatar Aug 28 '24 01:08 msyyc

got it

ChenxiJiang333 avatar Aug 28 '24 02:08 ChenxiJiang333

Hi @vit-corp, the latest api version was a preview version, please specify to use it by updating the code to:

client = ContainerRegistryManagementClient(
        credential=DefaultAzureCredential(),
        subscription_id={subscription_id},
        api_version="2023-11-01-preview",
    )

ChenxiJiang333 avatar Aug 30 '24 02:08 ChenxiJiang333

Hi @ChenxiJiang333 What latest azure-mgmt-containerregistry sdk uses api version? Is it obligatory to specify "2023-11-01-preview"?

vit-corp avatar Aug 30 '24 10:08 vit-corp

Hi @ChenxiJiang333 What latest azure-mgmt-containerregistry sdk uses api version? Is it obligatory to specify "2023-11-01-preview"?

It uses stable api version 2023-07-01 by default, which is considered old. If you want to use the latest one, to specify 2023-11-01-preview is necessary.

ChenxiJiang333 avatar Sep 02 '24 02:09 ChenxiJiang333

Hi @vit-corp. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] avatar Sep 06 '24 15:09 github-actions[bot]

Hi @vit-corp, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

github-actions[bot] avatar Sep 13 '24 16:09 github-actions[bot]