Skip to content

Add API version 2025-05-01 for dnsresolver #49921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
978e7ad
Add API version 2025-05-01
jamesvoongms May 8, 2025
d13c936
Remove recording mode
jamesvoongms May 12, 2025
8836066
Add changes for readme.md
jamesvoongms May 12, 2025
9af1072
Changes after removing blockresponsecode
jamesvoongms May 12, 2025
e58eb3a
Fix forwarding ruleset tests
jamesvoongms May 12, 2025
dcedb69
Run build failure commands
jamesvoongms May 13, 2025
e82004e
Regenerate after rebase
jamesvoongms May 13, 2025
ec814f0
Make test changes
jamesvoongms May 13, 2025
cf3eabd
Remove poorly generated file
jamesvoongms May 13, 2025
05d03e1
Add generated logic
jamesvoongms May 13, 2025
0ce36e1
Remove partial vnet usage due to bad generation of code
jamesvoongms May 13, 2025
8b02314
Re-generate
jamesvoongms May 13, 2025
4e4264b
Revert back partial-resources
jamesvoongms May 13, 2025
daf0053
Add comment and remove previous gen sample
jamesvoongms May 13, 2025
94fd9ab
Update sdk version
jamesvoongms May 13, 2025
efc9559
Fix issues with readme
jamesvoongms May 13, 2025
fee58d7
Add version change
jamesvoongms May 13, 2025
6b00637
Re-do readme
jamesvoongms May 13, 2025
df1628e
Move vnetresource to customized
jamesvoongms May 14, 2025
c5f39e4
Add code owners back for dnsresolver
jamesvoongms May 14, 2025
8a89880
Update .github/CODEOWNERS
jamesvoongms May 14, 2025
c0617f1
Move codeowner changes down to proper ordering
jamesvoongms May 14, 2025
d957a53
Revert to version 1.2 and remove sample generation due to bug
jamesvoongms May 16, 2025
44a7cf1
Remove rename-mappings for actions
jamesvoongms May 21, 2025
662afb0
Add requested files into customization
jamesvoongms May 21, 2025
765c2f4
update to fix the issue
ArcturusZhang May 21, 2025
28f2d03
Add new generation after Arthurs fixes
jamesvoongms May 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,12 @@
# PRLabel: %Network - CDN
/sdk/cdn/Azure.ResourceManager.*/ @ArcturusZhang @ArthurMa1978

# PRLabel: %Network - DNS Private Resolver
/sdk/dnsresolver/Azure.ResourceManager.*/ @jamesvoongms @jotrivet

# ServiceLabel: %Network - DNS Private Resolver %Mgmt
# ServiceOwners: @jamesvoongms @jotrivet

# PRLabel: %Network - Front Door
/sdk/frontdoor/Azure.ResourceManager.*/ @ArcturusZhang @ArthurMa1978

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Release History

## 1.2.0-beta.2 (Unreleased)
## 1.2.0 (2025-06-06)

### Features Added
- Upgraded api-version tag from 'package-preview-2023-07' to 'package-2025-05'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/b26a190235f162b15d77dad889d104d06871fb4f/specification/dnsresolver/resource-manager/readme.md.
- Adds new POST bulk API for large domain list usage.

### Breaking Changes

### Bugs Fixed

### Other Changes
- BlockResponseCode has been removed from the DnsSecurityRule Action type and can no longer be specified.

## 1.2.0-beta.1 (2024-10-24)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ public static partial class ArmDnsResolverModelFactory
public static Azure.ResourceManager.DnsResolver.DnsSecurityRuleData DnsSecurityRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary<string, string> tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), int priority = 0, Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction action = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Resources.Models.WritableSubResource> dnsResolverDomainLists = null, Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleState? dnsSecurityRuleState = default(Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleState?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; }
public static Azure.ResourceManager.DnsResolver.Models.VirtualNetworkDnsForwardingRuleset VirtualNetworkDnsForwardingRuleset(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier virtualNetworkLinkId = null) { throw null; }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct BlockResponseCode : System.IEquatable<Azure.ResourceManager.DnsResolver.Models.BlockResponseCode>
{
Expand Down Expand Up @@ -865,6 +866,7 @@ public partial class DnsSecurityRuleAction : System.ClientModel.Primitives.IJson
{
public DnsSecurityRuleAction() { }
public Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleActionType? ActionType { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public Azure.ResourceManager.DnsResolver.Models.BlockResponseCode? BlockResponseCode { get { throw null; } set { } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change.
In order to find a way to mitigate it, I need to know what happened to this property. Could you share some information about how this property changed in your spec?
We removed it in the latest api-version, I know this for sure.
Would the older existing api-versions still support this property? Or this property is a mistake from its first day.
The answer to these questions could change the way how we mitigate this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the older existing api-versions will support this property.

For more details, this property essentially is ignored on the control plane side, whatever the customer provides in this field is ignored and defaulted to a different value, and so the intention is to remove it.

Even on the old API versions, the value is being ignored on the old api versions but we are allowing customers to provide the parameter on old API versions.

Ideally we would like to remove it on all API versions as it being ignored in all API versions in the control plane standpoint.

Copy link
Member

@ArcturusZhang ArcturusZhang May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the case, we need to introduce this property back to mitigate the breaking change:
Please create a partial class in src/Customization or src/Custom directory for this class:

namespace Azure.ResourceManager.DnsResolver.Models
{
	[CodeGenSerialization(nameof(BlockResponseCode), "blockResponseCode")]
	public partial class DnsSecurityRuleAction
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public BlockResponseCode? BlockResponseCode { get; set; }
	}
}

The EditorBrowsable attribute hides this property from the intellisence so that new users would not see it, and the CodeGenSerialization attribute lets the generator know about how to serialize/deserialize this property into/from the payload to make sure the generated SDK could work with previous API versions.

During this process, the type of this property BlockResponseCode may also be deleted in this update, please find the removed file from git history and move it to the src/Customization or src/Custom directory.
After you have introduced the above code, please run the dotnet build /t:GenerateCode command to regenerate everything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the deleted blockresponsecode.cs back into customization and the dnsSecurityRuleACtion but these seems to cause issues in the generator

PS C:\Git\jamesvoong-azure-sdk-for-net\sdk\dnsresolver\Azure.ResourceManager.DnsResolver> dotnet build /t:GenerateCode
Restore complete (1.1s)
Azure.ResourceManager.DnsResolver failed with 2 error(s) (11.3s)
EXEC : error | error : Plugin csharpgen reported failure.
Q:.tools.nuget\packages\microsoft.azure.autorest.csharp\3.0.0-beta.20250512.2\buildMultiTargeting\Microsoft.Azure.AutoRest.CSharp.targets(59,5): error MSB3073: The command "npx autorest@ --max-memory-size=8192 --skip-csproj --skip-upgrade-check --version=3.9.7 C:\Git\jamesvoong-azure-sdk-for-net\sdk\dnsresolver\Azure.ResourceManager.DnsResolver\src/autorest.md --use=Q:.tools.nuget\packages\microsoft.azure.autorest.csharp\3.0.0-beta.20250512.2\buildMultiTargeting../tools/net9.0/any/ --clear-output-folder=true --shared-source-folders="C:\Git\jamesvoong-azure-sdk-for-net\eng/../sdk/core/Azure.Core/src/Shared/;Q:.tools.nuget\packages\microsoft.azure.autorest.csharp\3.0.0-beta.20250512.2\buildMultiTargeting../content/Generator.Shared/" --output-folder=C:\Git\jamesvoong-azure-sdk-for-net\sdk\dnsresolver\Azure.ResourceManager.DnsResolver\src/Generated --namespace=Azure.ResourceManager.DnsResolver" exited with code 1.

Build failed with 2 error(s) in 12.7s

Workload updates are available. Run dotnet workload list for more information.

protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ public static partial class ArmDnsResolverModelFactory
public static Azure.ResourceManager.DnsResolver.DnsSecurityRuleData DnsSecurityRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary<string, string> tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), int priority = 0, Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction action = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Resources.Models.WritableSubResource> dnsResolverDomainLists = null, Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleState? dnsSecurityRuleState = default(Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleState?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; }
public static Azure.ResourceManager.DnsResolver.Models.VirtualNetworkDnsForwardingRuleset VirtualNetworkDnsForwardingRuleset(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier virtualNetworkLinkId = null) { throw null; }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct BlockResponseCode : System.IEquatable<Azure.ResourceManager.DnsResolver.Models.BlockResponseCode>
{
Expand Down Expand Up @@ -865,6 +866,7 @@ public partial class DnsSecurityRuleAction : System.ClientModel.Primitives.IJson
{
public DnsSecurityRuleAction() { }
public Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleActionType? ActionType { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public Azure.ResourceManager.DnsResolver.Models.BlockResponseCode? BlockResponseCode { get { throw null; } set { } }
protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.DnsResolver.Models.DnsSecurityRuleAction>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/dnsresolver/Azure.ResourceManager.DnsResolver",
"Tag": "net/dnsresolver/Azure.ResourceManager.DnsResolver_24b7185c51"
"Tag": "net/dnsresolver/Azure.ResourceManager.DnsResolver_79910daa3c"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.2.0-beta.2</Version>
<Version>1.2.0</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.1.0</ApiCompatVersion>
<PackageId>Azure.ResourceManager.DnsResolver</PackageId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.ComponentModel;

namespace Azure.ResourceManager.DnsResolver.Models
{
[EditorBrowsable(EditorBrowsableState.Never)]
public readonly partial struct BlockResponseCode
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.ComponentModel;
using Azure.Core;

namespace Azure.ResourceManager.DnsResolver.Models
{
public partial class DnsSecurityRuleAction
{
/// <summary>
/// The response code for block actions.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public BlockResponseCode? BlockResponseCode { get; set; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Run `dotnet build /t:GenerateCode` to generate code.

``` yaml
azure-arm: true
require: https://github.com/Azure/azure-rest-api-specs/blob/b26a190235f162b15d77dad889d104d06871fb4f/specification/dnsresolver/resource-manager/readme.md
#tag: package-preview-2023-07
require: https://github.com/jamesvoongms/jamesvoong-azure-rest-api-specs/blob/7f70fea824775502f92a3a51f342c77ddc0325c4/specification/dnsresolver/resource-manager/readme.md
#tag: package-2025-01
library-name: dnsresolver
namespace: Azure.ResourceManager.DnsResolver
output-folder: $(this-folder)/Generated
clear-output-folder: true
sample-gen:
sample: false #true
sample: false # Current issue with virtual network dns resolver resouce autogen that is being addressed in autorest repo https://github.com/Azure/autorest.csharp/issues/5134
output-folder: $(this-folder)/../samples/Generated
clear-output-folder: true
skip-csproj: true
Expand Down Expand Up @@ -59,6 +59,9 @@ acronym-mapping:
Etag: ETag|etag
DnsForwardingRulesetName: rulesetName

# mgmt-debug:
# show-serialized-names: true

rename-mapping:
ProvisioningState: DnsResolverProvisioningState
ForwardingRule: DnsForwardingRule
Expand All @@ -71,10 +74,22 @@ rename-mapping:
OutboundEndpoint: DnsResolverOutboundEndpoint
VirtualNetworkLink: DnsForwardingRulesetVirtualNetworkLink
ActionType: DnsSecurityRuleActionType
Action: DnsResolverDomainListBulkAction
VirtualNetworkDnsForwardingRuleset.id: -|arm-id

directive:
- from: dnsresolver.json
where: $.definitions
where: $.definitions.DnsSecurityRuleAction
transform: >
$.VirtualNetworkDnsForwardingRuleset.properties.id['x-ms-format'] = 'arm-id';
$.properties["blockResponseCode"] = {
"type": "string",
"description": "The response code for block actions.",
"enum": [
"SERVFAIL"
],
"x-ms-enum": {
"name": "BlockResponseCode",
"modelAsString": true
}
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DnsResolverTestBase : ManagementRecordedTestBase<DnsResolverManagem
protected string SubnetName => "snet-endpoint";
public ResourceIdentifier DefaultVnetID;
public ResourceIdentifier DefaultSubnetID;
protected AzureLocation DefaultLocation => AzureLocation.AustraliaEast;
protected AzureLocation DefaultLocation => AzureLocation.WestUS2;
protected int DefaultDnsSecurityRulePriority => 100;
protected ArmClient Client { get; private set; }
protected SubscriptionResource DefaultSubscription { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DnsForwardingRulesetTests : DnsResolverTestBase
//private string _vnetId ;
//private string _subnetId;

public DnsForwardingRulesetTests(bool async) : base(async)//, RecordedTestMode.Record)
public DnsForwardingRulesetTests(bool async) : base(async) // RecordedTestMode.Record)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Azure.ResourceManager.Resources.Models;
using Azure.Core;
using Azure.ResourceManager.DnsResolver.Models;
using System;

namespace Azure.ResourceManager.DnsResolver.Tests
{
Expand All @@ -34,7 +35,9 @@
// ARRANGE
var dnsResolverDomainListName = Recording.GenerateAssetName("dnsResolverDomainList-");
await CreateDnsResolverDomainListCollectionAsync();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation, new List<string>() { "example.com.", "contoso.com." });
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 38 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L38

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(38,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments
dnsResolverDomainListData.Domains.Add("example.com.");
dnsResolverDomainListData.Domains.Add("contoso.com.");

// ACT
var dnsResolverDomainList = await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);
Expand All @@ -43,14 +46,60 @@
Assert.AreEqual(dnsResolverDomainList.Value.Data.ProvisioningState, DnsResolverProvisioningState.Succeeded);
}

[Test]
[RecordedTest]
public async Task CreateDnsResolverDomainListNoDomainsAsync()
{
// ARRANGE
var dnsResolverDomainListName = Recording.GenerateAssetName("dnsResolverDomainList-");
await CreateDnsResolverDomainListCollectionAsync();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Analyze PRBatch)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 56 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L56

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(56,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

// ACT
var dnsResolverDomainList = await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);

// ASSERT
Assert.AreEqual(dnsResolverDomainList.Value.Data.ProvisioningState, DnsResolverProvisioningState.Succeeded);
Assert.AreEqual(dnsResolverDomainList.Value.Data.Domains.Count, 0);
}

[Test]
[RecordedTest]
[Ignore("Requires SAS URL which cannot be added to code")]
public async Task PostDnsResolverDomainListBulkRequestSucceedsAsync()
{
// ARRANGE
var dnsResolverDomainListName = Recording.GenerateAssetName("dnsResolverDomainList-");
var subscription = await Client.GetSubscriptions().GetAsync(TestEnvironment.SubscriptionId);
var resourceGroup = await CreateResourceGroupAsync();
_dnsResolverDomainListCollection = resourceGroup.GetDnsResolverDomainLists();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);

Check failure on line 76 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L76

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(76,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 76 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L76

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(76,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 76 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L76

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(76,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 76 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L76

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(76,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

Check failure on line 76 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L76

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(76,49): Error CS1729: 'DnsResolverDomainListData' does not contain a constructor that takes 1 arguments

await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);
ResourceIdentifier dnsResolverDomainListResourceId = DnsResolverDomainListResource.CreateResourceIdentifier(TestEnvironment.SubscriptionId, resourceGroup.Data.Id, dnsResolverDomainListName);
DnsResolverDomainListResource dnsResolverDomainList = Client.GetDnsResolverDomainListResource(dnsResolverDomainListResourceId);

// invoke the operation
var dnsResolverDomainListBulk = new DnsResolverDomainListBulk(new Uri("ADD_STORAGE_URL_HERE"), DnsResolverDomainListBulkAction.Download);

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,49): Error CS0246: The type or namespace name 'DnsResolverDomainListBulk' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,108): Error CS0103: The name 'DnsResolverDomainListBulkAction' does not exist in the current context

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test Ubuntu2004_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,49): Error CS0246: The type or namespace name 'DnsResolverDomainListBulk' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,49): Error CS0246: The type or namespace name 'DnsResolverDomainListBulk' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET80_PackageRef_Debug)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,108): Error CS0103: The name 'DnsResolverDomainListBulkAction' does not exist in the current context

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,49): Error CS0246: The type or namespace name 'DnsResolverDomainListBulk' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest (Build Test MacOS_NET90_ProjectRef_Release)

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,108): Error CS0103: The name 'DnsResolverDomainListBulkAction' does not exist in the current context

Check failure on line 83 in sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs

View check run for this annotation

Azure Pipelines / net - pullrequest

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs#L83

sdk/dnsresolver/Azure.ResourceManager.DnsResolver/tests/Tests/DnsResolverDomainListTests.cs(83,49): Error CS0246: The type or namespace name 'DnsResolverDomainListBulk' could not be found (are you missing a using directive or an assembly reference?)

// ACT
var lro = await dnsResolverDomainList.BulkAsync(WaitUntil.Completed, dnsResolverDomainListBulk);

// ASSERT
DnsResolverDomainListResource result = lro.Value;
Assert.AreNotEqual(result.Data.DomainsUri, null);
}

[Test]
[RecordedTest]
public async Task GetDnsResolverDomainListAsync()
{
// ARRANGE
var dnsResolverDomainListName = Recording.GenerateAssetName("dnsResolverDomainList-");
await CreateDnsResolverDomainListCollectionAsync();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation, new List<string>() { "example.com.", "contoso.com." });
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);
dnsResolverDomainListData.Domains.Add("example.com.");
dnsResolverDomainListData.Domains.Add("contoso.com.");

await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);

Expand All @@ -70,7 +119,9 @@
var newTagKey = Recording.GenerateAlphaNumericId("tagKey");
var newTagValue = Recording.GenerateAlphaNumericId("tagValue");
await CreateDnsResolverDomainListCollectionAsync();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation, new List<string>() { "example.com.", "contoso.com." });
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);
dnsResolverDomainListData.Domains.Add("example.com.");
dnsResolverDomainListData.Domains.Add("contoso.com.");

var createdDnsResolverDomainList = await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);

Expand All @@ -88,7 +139,9 @@
// ARRANGE
var dnsResolverDomainListName = Recording.GenerateAssetName("dnsResolverDomainList-");
await CreateDnsResolverDomainListCollectionAsync();
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation, new List<string>() { "example.com." , "contoso.com."});
var dnsResolverDomainListData = new DnsResolverDomainListData(this.DefaultLocation);
dnsResolverDomainListData.Domains.Add("example.com.");
dnsResolverDomainListData.Domains.Add("contoso.com.");

var dnsResolverDomainList = await _dnsResolverDomainListCollection.CreateOrUpdateAsync(WaitUntil.Completed, dnsResolverDomainListName, dnsResolverDomainListData);

Expand Down
Loading
Loading