See the main docs for changes in versioning and flags, this section focuses on how the generated code differs.
- The credential system has been completely revamped:
- Previously we had used
azure.common.credentialsormsrestazure.azure_active_directoryinstances, which are no longer supported. We now use credentials fromazure_identityand theAzureKeyCredentialfromazure-core. - The
credentialsparameter to the service client has been renamed tocredential
- Previously we had used
- The
configattribute is no longer exposed on the client, and custom configurations should be passed as a kwarg. For example, we now haveClient(credential, subscription_id, enable_logging=True). For a complete set of supported inputs to your client, see our list of acceptable initialization parameters in azure-core. - You can't import a
versionmodule anymore, use__version__instead. Additionally, we only generate a version file if you specify a package version on the command line (--package-version), or you tell AutoRest during generation time to keep the current version file in the directory (--keep-version-file). See our flag index for more information on these 2 flags. - Long running operations that used to return a
msrest.polling.LROPollernow return aazure.core.polling.LROPollerby default. These operations are also now prefixed withbegin_. - The exception tree has been simplified, and now most exceptions are an
azure.core.exceptions.HttpResponseError.CloudErrorhas been removed. - Most of the operation kwargs have changed. The most noticeable are:
rawhas been removed. We now usecls, which is a callback that gives access to the internal HTTP response for advanced users.- For a complete set of supported options, see the acceptable parameters to operations in azure-core.
- Type annotations using the standard
typinglibrary. SDKs aremypyready! - This client has stable and official support for async. Look in the
aionamespace of your generated package to find the async client. - The client now natively supports tracing with
OpenTelemetry. Use the flag--traceto generate code for this, and you can see our tracing docs for more information.
Note:
OpenCensushas been deprecated and is no longer supported. Please useOpenTelemetryinstead.
