-
Notifications
You must be signed in to change notification settings - Fork 176
remove the setting for sample output folder #5351
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
Merged
ArcturusZhang
merged 7 commits into
Azure:main
from
ArcturusZhang:fix-sample-generation-directory
Jun 25, 2025
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7bd2553
remove the setting for sample output folder and make it to always be …
ArcturusZhang 07f74da
regen
ArcturusZhang 06248ca
update the sample directory logic
ArcturusZhang 0f88e07
Merge branch 'main' into fix-sample-generation-directory
ArcturusZhang ed1e67d
Merge branch 'main' into fix-sample-generation-directory
ArcturusZhang 03f6508
remove the unexpected generated files
ArcturusZhang 9d13743
Merge branch 'main' into fix-sample-generation-directory
ArcturusZhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
...rojects/MgmtMockAndSample/samples/Generated/Samples/Sample_DeletedManagedHsmCollection.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.Threading.Tasks; | ||
| using Azure; | ||
| using Azure.Core; | ||
| using Azure.Identity; | ||
| using Azure.ResourceManager; | ||
| using Azure.ResourceManager.Resources; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace MgmtMockAndSample.Samples | ||
| { | ||
| public partial class Sample_DeletedManagedHsmCollection | ||
| { | ||
| [Test] | ||
| [Ignore("Only validating compilation of examples")] | ||
| public async Task Get_RetrieveADeletedManagedHSM() | ||
| { | ||
| // Generated from example definition: | ||
| // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. | ||
|
|
||
| // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line | ||
| TokenCredential cred = new DefaultAzureCredential(); | ||
| // authenticate your client | ||
| ArmClient client = new ArmClient(cred); | ||
|
|
||
| // this example assumes you already have this SubscriptionResource created on azure | ||
| // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource | ||
| string subscriptionId = "00000000-0000-0000-0000-000000000000"; | ||
| ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); | ||
| SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); | ||
|
|
||
| // get the collection of this DeletedManagedHsmResource | ||
| DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); | ||
|
|
||
| // invoke the operation | ||
| AzureLocation location = new AzureLocation("westus"); | ||
| string name = "hsm1"; | ||
| DeletedManagedHsmResource result = await collection.GetAsync(location, name); | ||
|
|
||
| // the variable result is a resource, you could call other operations on this instance as well | ||
| // but just for demo, we get its data from this resource instance | ||
| DeletedManagedHsmData resourceData = result.Data; | ||
| // for demo we just print out the id | ||
| Console.WriteLine($"Succeeded on id: {resourceData.Id}"); | ||
| } | ||
|
|
||
| [Test] | ||
| [Ignore("Only validating compilation of examples")] | ||
| public async Task Exists_RetrieveADeletedManagedHSM() | ||
| { | ||
| // Generated from example definition: | ||
| // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. | ||
|
|
||
| // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line | ||
| TokenCredential cred = new DefaultAzureCredential(); | ||
| // authenticate your client | ||
| ArmClient client = new ArmClient(cred); | ||
|
|
||
| // this example assumes you already have this SubscriptionResource created on azure | ||
| // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource | ||
| string subscriptionId = "00000000-0000-0000-0000-000000000000"; | ||
| ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); | ||
| SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); | ||
|
|
||
| // get the collection of this DeletedManagedHsmResource | ||
| DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); | ||
|
|
||
| // invoke the operation | ||
| AzureLocation location = new AzureLocation("westus"); | ||
| string name = "hsm1"; | ||
| bool result = await collection.ExistsAsync(location, name); | ||
|
|
||
| Console.WriteLine($"Succeeded: {result}"); | ||
| } | ||
|
|
||
| [Test] | ||
| [Ignore("Only validating compilation of examples")] | ||
| public async Task GetIfExists_RetrieveADeletedManagedHSM() | ||
| { | ||
| // Generated from example definition: | ||
| // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. | ||
|
|
||
| // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line | ||
| TokenCredential cred = new DefaultAzureCredential(); | ||
| // authenticate your client | ||
| ArmClient client = new ArmClient(cred); | ||
|
|
||
| // this example assumes you already have this SubscriptionResource created on azure | ||
| // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource | ||
| string subscriptionId = "00000000-0000-0000-0000-000000000000"; | ||
| ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); | ||
| SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); | ||
|
|
||
| // get the collection of this DeletedManagedHsmResource | ||
| DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); | ||
|
|
||
| // invoke the operation | ||
| AzureLocation location = new AzureLocation("westus"); | ||
| string name = "hsm1"; | ||
| NullableResponse<DeletedManagedHsmResource> response = await collection.GetIfExistsAsync(location, name); | ||
| DeletedManagedHsmResource result = response.HasValue ? response.Value : null; | ||
|
|
||
| if (result == null) | ||
| { | ||
| Console.WriteLine("Succeeded with null as result"); | ||
| } | ||
| else | ||
| { | ||
| // the variable result is a resource, you could call other operations on this instance as well | ||
| // but just for demo, we get its data from this resource instance | ||
| DeletedManagedHsmData resourceData = result.Data; | ||
| // for demo we just print out the id | ||
| Console.WriteLine($"Succeeded on id: {resourceData.Id}"); | ||
| } | ||
| } | ||
| } | ||
| } | ||
76 changes: 76 additions & 0 deletions
76
...tProjects/MgmtMockAndSample/samples/Generated/Samples/Sample_DeletedManagedHsmResource.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.Threading.Tasks; | ||
| using Azure; | ||
| using Azure.Core; | ||
| using Azure.Identity; | ||
| using Azure.ResourceManager; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace MgmtMockAndSample.Samples | ||
| { | ||
| public partial class Sample_DeletedManagedHsmResource | ||
| { | ||
| [Test] | ||
| [Ignore("Only validating compilation of examples")] | ||
| public async Task Get_RetrieveADeletedManagedHSM() | ||
| { | ||
| // Generated from example definition: | ||
| // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. | ||
|
|
||
| // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line | ||
| TokenCredential cred = new DefaultAzureCredential(); | ||
| // authenticate your client | ||
| ArmClient client = new ArmClient(cred); | ||
|
|
||
| // this example assumes you already have this DeletedManagedHsmResource created on azure | ||
| // for more information of creating DeletedManagedHsmResource, please refer to the document of DeletedManagedHsmResource | ||
| string subscriptionId = "00000000-0000-0000-0000-000000000000"; | ||
| AzureLocation location = new AzureLocation("westus"); | ||
| string name = "hsm1"; | ||
| ResourceIdentifier deletedManagedHsmResourceId = DeletedManagedHsmResource.CreateResourceIdentifier(subscriptionId, location, name); | ||
| DeletedManagedHsmResource deletedManagedHsm = client.GetDeletedManagedHsmResource(deletedManagedHsmResourceId); | ||
|
|
||
| // invoke the operation | ||
| DeletedManagedHsmResource result = await deletedManagedHsm.GetAsync(); | ||
|
|
||
| // the variable result is a resource, you could call other operations on this instance as well | ||
| // but just for demo, we get its data from this resource instance | ||
| DeletedManagedHsmData resourceData = result.Data; | ||
| // for demo we just print out the id | ||
| Console.WriteLine($"Succeeded on id: {resourceData.Id}"); | ||
| } | ||
|
|
||
| [Test] | ||
| [Ignore("Only validating compilation of examples")] | ||
| public async Task PurgeDeleted_PurgeAManagedHSMPool() | ||
| { | ||
| // Generated from example definition: | ||
| // this example is just showing the usage of "ManagedHsms_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. | ||
|
|
||
| // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line | ||
| TokenCredential cred = new DefaultAzureCredential(); | ||
| // authenticate your client | ||
| ArmClient client = new ArmClient(cred); | ||
|
|
||
| // this example assumes you already have this DeletedManagedHsmResource created on azure | ||
| // for more information of creating DeletedManagedHsmResource, please refer to the document of DeletedManagedHsmResource | ||
| string subscriptionId = "00000000-0000-0000-0000-000000000000"; | ||
| AzureLocation location = new AzureLocation("westus"); | ||
| string name = "hsm1"; | ||
| ResourceIdentifier deletedManagedHsmResourceId = DeletedManagedHsmResource.CreateResourceIdentifier(subscriptionId, location, name); | ||
| DeletedManagedHsmResource deletedManagedHsm = client.GetDeletedManagedHsmResource(deletedManagedHsmResourceId); | ||
|
|
||
| // invoke the operation | ||
| await deletedManagedHsm.PurgeDeletedAsync(WaitUntil.Completed); | ||
|
|
||
| Console.WriteLine("Succeeded"); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.