-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate from 1.0.x 0.20.0 to 2.0.0 0.30.0
The 1.0.0 version contains a preview version of the ARM library. Since the 2.0.0 is based on a new code generator, there are a few modifications to consider.
This article is for management only, if you used the following packages in their 0.20.0 versions:
- azure-mgmt-resource
- azure-mgmt-compute
- azure-mgmt-network
- azure-mgmt-storage
azure.mgmt.common.SubscriptionCloudCredentials is replaced by two classes:
azure.common.credentials.UserPassCredentialsazure.common.credentials.ServicePrincipalCredentials
For instance, for the compute service, replace this:
service = ComputeManagementClient(credentials)by
service = ComputeManagementClient(
credentials,
subscription_id
) Many async operations now return a msrestazure.azure_operation.AzureOperationPoller. This class has a wait function which tests for you the state of the operation and returns until it's finished. There is also a result function which waits and returns the instance object.
As a direct consequence, status and provisioning_state are no longer available.
azure.common.AzureHttpError -> azure.common.exceptions.CloudError
client.credentials.subscription_id -> client.config.subscription_id
client.long_running_operation_initial_timeout -> client.config.long_running_operation_timeout
- Models are now in subpackage
models. - All the Ip part in a class name (e.g. IpAddress) are now uppercase (e.g. IPAddress)
-
OSDisk.virtual_hard_disk->OSDisk.vhd -
GenericResourceExtended.name->GenericResourceExtended.resource_type - When you create a deployment fron a template, the template has to be given as a dict object instead of a string
If you need the log of the lower level libraries (HTTP requests, etc.), you can configure the 'msrest' logger.