github Azure/azure-sdk-for-python v2.0.0rc4

latest releases: azure-cosmos_4.8.0, azure-ai-inference_1.0.0b6, azure-eventhub_5.13.0...
pre-release8 years ago

Disclaimer:

  • There is a breaking change in all Client init methods. Configuration classes have disappeared.
    Update this:
    resource_client = ResourceManagementClient(
        ResourceManagementClientConfiguration(
            credentials,
            subscription_id
        )
    )

to this:

    resource_client = ResourceManagementClient(
        credentials,
        subscription_id
    )

If you were using the Configuration class, it is still available using the config attribute after Client creation:

resource_client.config.long_running_operation_timeout = 5

New:

  • you can now simplify your call by passing a dict directly and not an instance. This removes the needs to import each model:
    from azure.mgmt.resource.resources.models import ResourceGroup

    resource_client.resource_groups.create_or_update(
        group_name,
        ResourceGroup(
            location='westus',
        )
    )

can now be written directly:

    resource_client.resource_groups.create_or_update(
        group_name,
        {
            'location':'westus',
        }
    )
  • All Resources clients have now alias in the azure.mgmt.resource namespace:
    azure.mgmt.resource.FeatureClient
    azure.mgmt.resource.ManagementLockClient
    azure.mgmt.resource.PolicyClient
    azure.mgmt.resource.ResourceManagementClient
    azure.mgmt.resource.SubscriptionClient
  • Enum refactoring. There are now two kinds of enum: "strict" and "soft".
    • A "soft" enum can be substituted by any random string without risking a client-side exception. This is useful for services which might add new enum types frequently (e.g. VirtualMachine size). The server might decide to refuse your string and you might receive a CloudError exception.
    • A "strict" enum must follow one of the authorized enum values. Strings are still accepted, but if your value is not valid you will receive a SerializationError without a call to the REST API. Before, the call was made to the REST API and you received a CloudError if the server refused the request.
  • Latest Swagger update for Redis (API-version 2016-04-01)
  • Latest Swagger update for GraphRbac (API-version 1.6)
  • Latest Swagger update for CDN (API-version 2016-04-02)
  • New Resource Policy client
  • New Compute Container client
  • New azure-mgmt-commerce preview package for Billing API

Dependencies:

Don't miss a new azure-sdk-for-python release

NewReleases is sending notifications on new releases.