Azure-sdk-for-python: [NetApp] API version mismatch in azure-mgmt-netapp 0.5.0

Created on 16 Jul 2019  路  9Comments  路  Source: Azure/azure-sdk-for-python

There seems to be some kind of baked-in API version mismatch baked into azure-mgmt-netapp 0.5.0. Possibly arriving with this update:

https://github.com/Azure/azure-sdk-for-python/commit/09ecebc77901f887f8622f7e2e383e0351cda02e

Example repro code:

8 ---------------------------------------------------- 8<

#!/usr/bin/env python3

import os

from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.netapp.azure_net_app_files_management_client import AzureNetAppFilesManagementClient

subscriptionID = os.environ.get('RPA_SUBSCRIPTION_ID')
tenantID = os.environ.get('RPA_TENANT_ID')
clientID = os.environ.get('RPA_CLIENT_ID')
clientSecret = os.environ.get('RPA_CLIENT_SECRET')

# Azure objects for using SDK operations
credentials = ServicePrincipalCredentials(
    client_id=clientID,
    secret=clientSecret,
    tenant=tenantID,
)
resource_mgmt_client = ResourceManagementClient(credentials, subscriptionID)
netapp_client = AzureNetAppFilesManagementClient(credentials, subscriptionID)

for rg in resource_mgmt_client.resource_groups.list():
    print("Resource group: " + rg.name)
    for naa in netapp_client.accounts.list(rg.name):
        print("NetAppAccount: " + naa.name)

8 ---------------------------------------------------- 8<

Repro across 0.4.0 (working) and 0.5.0 (broken).. (all the other packages
are up-to-date.)

$ pip3 list | grep azure
azure-common        1.1.23
azure-mgmt-netapp   0.4.0
azure-mgmt-network  3.0.0
azure-mgmt-resource 3.0.0
msrestazure         0.6.1

$ ./version_issue_repro.py
Resource group: aks-east-rg
Resource group: cloud-shell-storage-eastus
Resource group: cloud-shell-storage-westus
Resource group: DefaultResourceGroup-WUS
Resource group: east-us-anf-dev
NetAppAccount: east-us-anf-dev-storage
Resource group: k8s_eastus_8myr
Resource group: k8s_eastus_nbo0
Resource group: MC_aks-east-rg_aks-east_eastus
Resource group: msft.nfs.rg
Resource group: netapp.io
Resource group: NetworkWatcherRG
Resource group: scratch-rg
NetAppAccount: scratch

$ pip3 uninstall azure-mgmt-netapp
Uninstalling azure-mgmt-netapp-0.4.0:
  Would remove:
    /usr/local/lib/python3.7/site-packages/azure/mgmt/netapp/*
    /usr/local/lib/python3.7/site-packages/azure_mgmt_netapp-0.4.0.dist-info/*
Proceed (y/n)? y
  Successfully uninstalled azure-mgmt-netapp-0.4.0

$ pip3 install azure-mgmt-netapp
Collecting azure-mgmt-netapp

[...]

$ pip3 list | grep azure
azure-common        1.1.23
azure-mgmt-netapp   0.5.0
azure-mgmt-network  3.0.0
azure-mgmt-resource 3.0.0
msrestazure         0.6.1

$ ./version_issue_repro.py
Resource group: aks-east-rg
Traceback (most recent call last):
  File "./version_issue_repro.py", line 25, in <module>
    for naa in netapp_client.accounts.list(rg.name):
  File "/usr/local/lib/python3.7/site-packages/msrest/paging.py", line 143, in __next__
    self.advance_page()
  File "/usr/local/lib/python3.7/site-packages/msrest/paging.py", line 129, in advance_page
    self._response = self._get_next(self.next_link)
  File "/usr/local/lib/python3.7/site-packages/azure/mgmt/netapp/operations/accounts_operations.py", line 96, in internal_paging
    raise exp
msrestazure.azure_exceptions.CloudError: Azure Error: InvalidResourceType

Message: The resource type 'netAppAccounts' could not be found in the namespace
 'Microsoft.NetApp' for api version '2019-06-01'. The supported api-versions are 
'2017-08-15,2019-05-01'.

Note that exactly the same problem exists with the current revision of the Azure SDK for Go.

Mgmt Service Attention customer-reported

Most helpful comment

@lmazuel well the problem is related to this. The manifest needs to be updated for the eastus region. I will get this sorted asap.

All 9 comments

@leonardbf what do you think?

@lmazuel this is in eastus?

Hi @bnaylor , looking at your repro it seems this is eastus, could you confirm?
@leonardbf is there anything in particular with eastus?

@lmazuel If it's eastus then it should be good. So I was hoping I misread and this was performed in a region that has not been updated to have the new API 2019-06-01.

@lmazuel well the problem is related to this. The manifest needs to be updated for the eastus region. I will get this sorted asap.

You are correct, it is in eastus. Thanks for jumping on it!

@bnaylor Hopefully eastus is working now. Please try again and let me know.

Yes, I can confirm that it is now working with 0.5.0 - thanks very much!

Will go ahead and close this since the issue has been resolved.

Was this page helpful?
0 / 5 - 0 ratings