Azure.ResourceManager.Dns
1.0.0-beta.2
Prefix Reserved
See the version list below for details.
dotnet add package Azure.ResourceManager.Dns --version 1.0.0-beta.2
NuGet\Install-Package Azure.ResourceManager.Dns -Version 1.0.0-beta.2
<PackageReference Include="Azure.ResourceManager.Dns" Version="1.0.0-beta.2" />
paket add Azure.ResourceManager.Dns --version 1.0.0-beta.2
#r "nuget: Azure.ResourceManager.Dns, 1.0.0-beta.2"
// Install Azure.ResourceManager.Dns as a Cake Addin #addin nuget:?package=Azure.ResourceManager.Dns&version=1.0.0-beta.2&prerelease // Install Azure.ResourceManager.Dns as a Cake Tool #tool nuget:?package=Azure.ResourceManager.Dns&version=1.0.0-beta.2&prerelease
Azure DNS Management client library for .NET
This package follows the new Azure SDK guidelines which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more.
Getting started
Install the package
Install the Azure DNS management library for .NET with NuGet:
dotnet add package Azure.ResourceManager.Dns --prerelease
Prerequisites
Set up a way to authenticate to Azure with Azure Identity.
Some options are:
- Through the Azure CLI Login.
- Via Visual Studio.
- Setting Environment Variables.
More information and different authentication approaches using Azure Identity can be found in this document.
Authenticate the Client
The default option to create an authenticated client is to use DefaultAzureCredential
. Since all management APIs go through the same endpoint, in order to interact with resources, only one top-level ArmClient
has to be created.
To authenticate to Azure and create an ArmClient
, do the following:
Additional documentation for the Azure.Identity.DefaultAzureCredential
class can be found in this document.
Key concepts
Key concepts of the Azure .NET SDK can be found here
Examples
Create a Dns zone
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
// first we need to get the resource group
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await subscription.GetResourceGroups().GetAsync(rgName);
// Now we get the DnsZone collection from the resource group
DnsZoneCollection dnsZoneCollection = resourceGroup.GetDnsZones();
// Use the same location as the resource group
string dnsZoneName = "sample.com";
DnsZoneData data = new DnsZoneData("Global")
{
};
ArmOperation<DnsZoneResource> lro = await dnsZoneCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsZoneName, data);
DnsZoneResource dnsZone = lro.Value;
Get all Dns zones in a resource group
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
// first we need to get the resource group
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await subscription.GetResourceGroups().GetAsync(rgName);
// Now we get the DnsZone collection from the resource group
DnsZoneCollection dnsZoneCollection = resourceGroup.GetDnsZones();
// With ListAsync(), we can get a list of the DnsZones
AsyncPageable<DnsZoneResource> response = dnsZoneCollection.GetAllAsync();
await foreach (DnsZoneResource dnsZone in response)
{
Console.WriteLine(dnsZone.Data.Name);
}
Delete a Dns zone
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
// first we need to get the resource group
string rgName = "myRgName";
ResourceGroupResource resourceGroup = await subscription.GetResourceGroups().GetAsync(rgName);
// Now we get the DnsZone collection from the resource group
DnsZoneCollection dnsZoneCollection = resourceGroup.GetDnsZones();
string dnsZoneName = "sample.com";
DnsZoneResource dnsZone =await dnsZoneCollection.GetAsync(dnsZoneName);
await dnsZone.DeleteAsync(WaitUntil.Completed);
Troubleshooting
- If you find a bug or have a suggestion, file an issue via GitHub issues and make sure you add the "Preview" label to the issue.
- If you need help, check previous questions or ask new ones on StackOverflow using azure and .NET tags.
- If having trouble with authentication, go to DefaultAzureCredential documentation
Next steps
More sample code
Additional Documentation
For more information on Azure SDK, please refer to this website.
Contributing
For details on contributing to this repository, see the contributing guide.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.Core (>= 1.25.0)
- Azure.ResourceManager (>= 1.3.0)
- System.Text.Json (>= 4.7.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (6)
Showing the top 5 popular GitHub repositories that depend on Azure.ResourceManager.Dns:
Repository | Stars |
---|---|
win-acme/win-acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
|
|
webprofusion/certify
Professional ACME Client for Windows. Certificate Management UI, powered by Let's Encrypt and compatible with all ACME v2 CAs. Download from certifytheweb.com
|
|
shibayan/keyvault-acmebot
Automated ACME SSL/TLS certificates issuer for Azure Key Vault (App Service / Container Apps / App Gateway / Front Door / CDN / others)
|
|
shibayan/appservice-acmebot
Automated ACME SSL/TLS certificates issuer for Azure App Service (Web Apps / Functions / Containers)
|
|
Stratus-Security/Subdominator
The Internets #1 Subdomain Takeover Tool
|
Version | Downloads | Last updated |
---|---|---|
1.2.0-beta.1 | 654 | 5/31/2024 |
1.1.1 | 78,991 | 4/29/2024 |
1.1.0 | 73,926 | 11/24/2023 |
1.1.0-beta.1 | 4,567 | 5/31/2023 |
1.0.1 | 136,440 | 2/28/2023 |
1.0.0 | 39,126 | 12/5/2022 |
1.0.0-beta.2 | 6,070 | 8/29/2022 |
1.0.0-beta.1 | 2,001 | 7/13/2022 |