Invalid api-version exception when submitting job to Data Lake Analytics using Azure Python SDK

Paresh Nayyar 0 Reputation points Microsoft Employee
2024-11-09T21:22:40.7233333+00:00

I got below exception when I tried to submit a job to Azure Data Lake Analytics using Azure Python SDK.

CloudError: Azure Error: InvalidArgument Message: Job type 'USql' is not supported by api-version '2017-09-01-preview'.

First I have installed the package using :

pip install azure-mgmt-datalake-analytics==0.6.0

Here is the code which I am trying :


managed_identity_client_id = "<>"  # Client ID of your user-assigned managed identity
managed_identity_credential = ManagedIdentityCredential(client_id=managed_identity_client_id)

access_token = managed_identity_credential.get_token("https://management.azure.com/.default").token

# Create a BasicTokenAuthentication object using the access token
credentials = BasicTokenAuthentication(token={"access_token": access_token})

adla_job_dns_suffix = 'azuredatalakeanalytics.net'
adlaJobClient  = DataLakeAnalyticsJobManagementClient(credentials=credentials, adla_job_dns_suffix=adla_job_dns_suffix)

adla_account_name = '<>'

jobResult = adlaJobClient.job.create(
    adla_account_name,
    job_id,
    JobInformation(
        name='Sample Job',
        type='USql',
        properties=USqlJobProperties(script=usql_script)
    )
)

Azure Data Lake Analytics
{count} votes

1 answer

Sort by: Most helpful
  1. Smaran Thoomu 18,710 Reputation points Microsoft Vendor
    2024-11-11T12:11:49.8166667+00:00

    Hi @Paresh Nayyar
    Welcome to Microsoft Q&A platform and thanks for posting your query here.

    The error message you're seeing – "Job type 'USql' is not supported by api-version '2017-09-01-preview'" – indicates that the API version you are using may not support the USql job type. This can happen due to changes in supported API versions or incompatibilities with newer SDK versions.

    To resolve this issue try the below suggestions:

    1. The package version you're using (azure-mgmt-datalake-analytics==0.6.0) might not be the latest. Consider updating to a more recent version of the Azure Python SDK for Data Lake Analytics, as newer versions may include better compatibility and updated API versions.
    2. You can update it by running:
         pip install --upgrade azure-mgmt-datalake-analytics
      
      https://learn.microsoft.com/en-us/python/api/overview/azure/data-lake-analytics?view=azure-python
    3. If your code requires a specific API version for compatibility, try specifying a different version that supports USql jobs. Check the Azure SDK documentation to find the list of available API versions and supported job types.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.