The `azure-mgmt-dns` library provides a client for managing Azure DNS zones and record sets, including creating, updating, and deleting DNS resources within your Azure subscriptions. It is part of the Azure SDK for Python and is currently at version 9.0.0, with updates typically released as new API versions become available or significant features are added to the service.
pip install azure-mgmt-dns azure-identityVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential`, create an instance of `DnsManagementClient`, and perform basic operations like creating and listing DNS zones. Remember to set your `AZURE_SUBSCRIPTION_ID` environment variable and ensure your credentials are configured (e.g., via Azure CLI login).
Review the official release notes for `azure-mgmt-dns` version 9.0.0. Update your code to use the new model types and remove calls to the deprecated `dns_resource_reference` operation. Ensure your `import` statements for models are updated if you were relying on internal `_models`.
When calling `begin_` methods, explicitly pass `api_version` as a keyword argument: `dns_client.zones.begin_create_or_update(..., api_version='2018-05-01')`. Consult the API reference or samples for the correct `api_version` for your desired functionality.
Always append `.result()` to the call of a `begin_` method if you need the result immediately: `zone = dns_client.zones.begin_create_or_update(...).result()`. For async, use `zone = await dns_client.zones.begin_create_or_update(...)` if the client is async.
Ensure that when creating or updating a `RecordSet`, you only populate the properties relevant to the `record_type` you intend to manage. For example, for an 'A' record, only fill `a_records`.