[Automation] Collect examples from azure-sdk-for-net#Azure.ResourceManager.CognitiveServices_1.4.0
This commit is contained in:
Родитель
a8ee3044cc
Коммит
8d78cc62b7
|
@ -0,0 +1,55 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/AddRaiBlocklistItems.json
|
||||
// this example is just showing the usage of "RaiBlocklistItems_BatchAdd" 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 RaiBlocklistResource created on azure
|
||||
// for more information of creating RaiBlocklistResource, please refer to the document of RaiBlocklistResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "myblocklist";
|
||||
ResourceIdentifier raiBlocklistResourceId = RaiBlocklistResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName);
|
||||
RaiBlocklistResource raiBlocklist = client.GetRaiBlocklistResource(raiBlocklistResourceId);
|
||||
|
||||
// invoke the operation
|
||||
IEnumerable<RaiBlocklistItemBulkContent> content = new RaiBlocklistItemBulkContent[]
|
||||
{
|
||||
new RaiBlocklistItemBulkContent()
|
||||
{
|
||||
Name = "myblocklistitem1",
|
||||
Properties = new RaiBlocklistItemProperties()
|
||||
{
|
||||
Pattern = "^[a-z0-9_-]{2,16}$",
|
||||
IsRegex = true,
|
||||
},
|
||||
},new RaiBlocklistItemBulkContent()
|
||||
{
|
||||
Name = "myblocklistitem2",
|
||||
Properties = new RaiBlocklistItemProperties()
|
||||
{
|
||||
Pattern = "blockwords",
|
||||
IsRegex = false,
|
||||
},
|
||||
}
|
||||
};
|
||||
RaiBlocklistResource result = await raiBlocklist.BatchAddRaiBlocklistItemAsync(content);
|
||||
|
||||
// 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
|
||||
RaiBlocklistData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,58 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CalculateModelCapacity.json
|
||||
// this example is just showing the usage of "CalculateModelCapacity" 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
CalculateModelCapacityContent content = new CalculateModelCapacityContent()
|
||||
{
|
||||
Model = new CognitiveServicesAccountDeploymentModel()
|
||||
{
|
||||
Format = "OpenAI",
|
||||
Name = "gpt-4",
|
||||
Version = "0613",
|
||||
},
|
||||
SkuName = "ProvisionedManaged",
|
||||
Workloads =
|
||||
{
|
||||
new ModelCapacityCalculatorWorkload()
|
||||
{
|
||||
RequestPerMinute = 10L,
|
||||
RequestParameters = new ModelCapacityCalculatorWorkloadRequestParam()
|
||||
{
|
||||
AvgPromptTokens = 30L,
|
||||
AvgGeneratedTokens = 50L,
|
||||
},
|
||||
},new ModelCapacityCalculatorWorkload()
|
||||
{
|
||||
RequestPerMinute = 20L,
|
||||
RequestParameters = new ModelCapacityCalculatorWorkloadRequestParam()
|
||||
{
|
||||
AvgPromptTokens = 60L,
|
||||
AvgGeneratedTokens = 20L,
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
CalculateModelCapacityResult result = await subscriptionResource.CalculateModelCapacityAsync(content);
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,29 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CheckDomainAvailability.json
|
||||
// this example is just showing the usage of "CheckDomainAvailability" 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
CognitiveServicesDomainAvailabilityContent content = new CognitiveServicesDomainAvailabilityContent("contosodemoapp1", new ResourceType("Microsoft.CognitiveServices/accounts"));
|
||||
CognitiveServicesDomainAvailabilityList result = await subscriptionResource.CheckDomainAvailabilityAsync(content);
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,36 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CheckSkuAvailability.json
|
||||
// this example is just showing the usage of "CheckSkuAvailability" 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("westus");
|
||||
CognitiveServicesSkuAvailabilityContent content = new CognitiveServicesSkuAvailabilityContent(new string[]
|
||||
{
|
||||
"S0"
|
||||
}, "Face", new ResourceType("Microsoft.CognitiveServices/accounts"));
|
||||
await foreach (CognitiveServicesSkuAvailabilityList item in subscriptionResource.CheckSkuAvailabilityAsync(location, content))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,65 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateAccount.json
|
||||
// this example is just showing the usage of "Accounts_Create" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesAccountResource
|
||||
CognitiveServicesAccountCollection collection = resourceGroupResource.GetCognitiveServicesAccounts();
|
||||
|
||||
// invoke the operation
|
||||
string accountName = "testCreate1";
|
||||
CognitiveServicesAccountData data = new CognitiveServicesAccountData(new AzureLocation("West US"))
|
||||
{
|
||||
Kind = "Emotion",
|
||||
Sku = new CognitiveServicesSku("S0"),
|
||||
Identity = new ManagedServiceIdentity("SystemAssigned"),
|
||||
Properties = new CognitiveServicesAccountProperties()
|
||||
{
|
||||
Encryption = new ServiceAccountEncryptionProperties()
|
||||
{
|
||||
KeyVaultProperties = new CognitiveServicesKeyVaultProperties()
|
||||
{
|
||||
KeyName = "KeyName",
|
||||
KeyVersion = "891CF236-D241-4738-9462-D506AF493DFA",
|
||||
KeyVaultUri = new Uri("https://pltfrmscrts-use-pc-dev.vault.azure.net/"),
|
||||
},
|
||||
KeySource = ServiceAccountEncryptionKeySource.MicrosoftKeyVault,
|
||||
},
|
||||
UserOwnedStorage =
|
||||
{
|
||||
new ServiceAccountUserOwnedStorage()
|
||||
{
|
||||
ResourceId = new ResourceIdentifier("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
ArmOperation<CognitiveServicesAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
|
||||
CognitiveServicesAccountResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
CognitiveServicesAccountData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,46 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateAccountMin.json
|
||||
// this example is just showing the usage of "Accounts_Create" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesAccountResource
|
||||
CognitiveServicesAccountCollection collection = resourceGroupResource.GetCognitiveServicesAccounts();
|
||||
|
||||
// invoke the operation
|
||||
string accountName = "testCreate1";
|
||||
CognitiveServicesAccountData data = new CognitiveServicesAccountData(new AzureLocation("West US"))
|
||||
{
|
||||
Kind = "CognitiveServices",
|
||||
Sku = new CognitiveServicesSku("S0"),
|
||||
Identity = new ManagedServiceIdentity("SystemAssigned"),
|
||||
Properties = new CognitiveServicesAccountProperties(),
|
||||
};
|
||||
ArmOperation<CognitiveServicesAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data);
|
||||
CognitiveServicesAccountResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
CognitiveServicesAccountData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,54 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateSharedCommitmentPlan.json
|
||||
// this example is just showing the usage of "CommitmentPlans_CreateOrUpdatePlan" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesCommitmentPlanResource
|
||||
CognitiveServicesCommitmentPlanCollection collection = resourceGroupResource.GetCognitiveServicesCommitmentPlans();
|
||||
|
||||
// invoke the operation
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
CommitmentPlanData data = new CommitmentPlanData()
|
||||
{
|
||||
Kind = "SpeechServices",
|
||||
Sku = new CognitiveServicesSku("S0"),
|
||||
Location = new AzureLocation("West US"),
|
||||
Properties = new CommitmentPlanProperties()
|
||||
{
|
||||
HostingModel = ServiceAccountHostingModel.Web,
|
||||
PlanType = "STT",
|
||||
Current = new CommitmentPeriod()
|
||||
{
|
||||
Tier = "T1",
|
||||
},
|
||||
AutoRenew = true,
|
||||
},
|
||||
};
|
||||
ArmOperation<CognitiveServicesCommitmentPlanResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, commitmentPlanName, data);
|
||||
CognitiveServicesCommitmentPlanResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
CommitmentPlanData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,41 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateSharedCommitmentPlanAssociation.json
|
||||
// this example is just showing the usage of "CommitmentPlans_CreateOrUpdateAssociation" 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 CognitiveServicesCommitmentPlanResource created on azure
|
||||
// for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName);
|
||||
CognitiveServicesCommitmentPlanResource cognitiveServicesCommitmentPlan = client.GetCognitiveServicesCommitmentPlanResource(cognitiveServicesCommitmentPlanResourceId);
|
||||
|
||||
// get the collection of this CommitmentPlanAccountAssociationResource
|
||||
CommitmentPlanAccountAssociationCollection collection = cognitiveServicesCommitmentPlan.GetCommitmentPlanAccountAssociations();
|
||||
|
||||
// invoke the operation
|
||||
string commitmentPlanAssociationName = "commitmentPlanAssociationName";
|
||||
CommitmentPlanAccountAssociationData data = new CommitmentPlanAccountAssociationData()
|
||||
{
|
||||
AccountId = "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName",
|
||||
};
|
||||
ArmOperation<CommitmentPlanAccountAssociationResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, commitmentPlanAssociationName, data);
|
||||
CommitmentPlanAccountAssociationResource result = lro.Value;
|
||||
|
||||
// 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
|
||||
CommitmentPlanAccountAssociationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteAccount.json
|
||||
// this example is just showing the usage of "Accounts_Delete" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
string accountName = "PropTest01";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await cognitiveServicesAccount.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteCommitmentPlan.json
|
||||
// this example is just showing the usage of "CommitmentPlans_Delete" 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 CommitmentPlanResource created on azure
|
||||
// for more information of creating CommitmentPlanResource, please refer to the document of CommitmentPlanResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
ResourceIdentifier commitmentPlanResourceId = CommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, commitmentPlanName);
|
||||
CommitmentPlanResource commitmentPlan = client.GetCommitmentPlanResource(commitmentPlanResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await commitmentPlan.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteDeployment.json
|
||||
// this example is just showing the usage of "Deployments_Delete" 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 CognitiveServicesAccountDeploymentResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountDeploymentResource, please refer to the document of CognitiveServicesAccountDeploymentResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string deploymentName = "deploymentName";
|
||||
ResourceIdentifier cognitiveServicesAccountDeploymentResourceId = CognitiveServicesAccountDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, deploymentName);
|
||||
CognitiveServicesAccountDeploymentResource cognitiveServicesAccountDeployment = client.GetCognitiveServicesAccountDeploymentResource(cognitiveServicesAccountDeploymentResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await cognitiveServicesAccountDeployment.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteEncryptionScope.json
|
||||
// this example is just showing the usage of "EncryptionScopes_Delete" 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 CognitiveServicesEncryptionScopeResource created on azure
|
||||
// for more information of creating CognitiveServicesEncryptionScopeResource, please refer to the document of CognitiveServicesEncryptionScopeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string encryptionScopeName = "encryptionScopeName";
|
||||
ResourceIdentifier cognitiveServicesEncryptionScopeResourceId = CognitiveServicesEncryptionScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, encryptionScopeName);
|
||||
CognitiveServicesEncryptionScopeResource cognitiveServicesEncryptionScope = client.GetCognitiveServicesEncryptionScopeResource(cognitiveServicesEncryptionScopeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await cognitiveServicesEncryptionScope.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,29 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeletePrivateEndpointConnection.json
|
||||
// this example is just showing the usage of "PrivateEndpointConnections_Delete" 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 CognitiveServicesPrivateEndpointConnectionResource created on azure
|
||||
// for more information of creating CognitiveServicesPrivateEndpointConnectionResource, please refer to the document of CognitiveServicesPrivateEndpointConnectionResource
|
||||
string subscriptionId = "{subscription-id}";
|
||||
string resourceGroupName = "res6977";
|
||||
string accountName = "sto2527";
|
||||
string privateEndpointConnectionName = "{privateEndpointConnectionName}";
|
||||
ResourceIdentifier cognitiveServicesPrivateEndpointConnectionResourceId = CognitiveServicesPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, privateEndpointConnectionName);
|
||||
CognitiveServicesPrivateEndpointConnectionResource cognitiveServicesPrivateEndpointConnection = client.GetCognitiveServicesPrivateEndpointConnectionResource(cognitiveServicesPrivateEndpointConnectionResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await cognitiveServicesPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,31 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklist.json
|
||||
// this example is just showing the usage of "RaiBlocklists_Delete" 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 RaiBlocklistResource created on azure
|
||||
// for more information of creating RaiBlocklistResource, please refer to the document of RaiBlocklistResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
ResourceIdentifier raiBlocklistResourceId = RaiBlocklistResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName);
|
||||
RaiBlocklistResource raiBlocklist = client.GetRaiBlocklistResource(raiBlocklistResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await raiBlocklist.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,31 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklistItem.json
|
||||
// this example is just showing the usage of "RaiBlocklistItems_Delete" 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 RaiBlocklistItemResource created on azure
|
||||
// for more information of creating RaiBlocklistItemResource, please refer to the document of RaiBlocklistItemResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
string raiBlocklistItemName = "raiBlocklistItemName";
|
||||
ResourceIdentifier raiBlocklistItemResourceId = RaiBlocklistItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName);
|
||||
RaiBlocklistItemResource raiBlocklistItem = client.GetRaiBlocklistItemResource(raiBlocklistItemResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await raiBlocklistItem.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,32 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklistItems.json
|
||||
// this example is just showing the usage of "RaiBlocklistItems_BatchDelete" 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 RaiBlocklistResource created on azure
|
||||
// for more information of creating RaiBlocklistResource, please refer to the document of RaiBlocklistResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
ResourceIdentifier raiBlocklistResourceId = RaiBlocklistResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName);
|
||||
RaiBlocklistResource raiBlocklist = client.GetRaiBlocklistResource(raiBlocklistResourceId);
|
||||
|
||||
// invoke the operation
|
||||
BinaryData raiBlocklistItemsNames = BinaryData.FromObjectAsJson(new object[] { "myblocklistitem1", "myblocklistitem2" });
|
||||
await raiBlocklist.BatchDeleteRaiBlocklistItemAsync(raiBlocklistItemsNames);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiPolicy.json
|
||||
// this example is just showing the usage of "RaiPolicies_Delete" 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 RaiPolicyResource created on azure
|
||||
// for more information of creating RaiPolicyResource, please refer to the document of RaiPolicyResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiPolicyName = "raiPolicyName";
|
||||
ResourceIdentifier raiPolicyResourceId = RaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiPolicyName);
|
||||
RaiPolicyResource raiPolicy = client.GetRaiPolicyResource(raiPolicyResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await raiPolicy.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteSharedCommitmentPlan.json
|
||||
// this example is just showing the usage of "CommitmentPlans_DeletePlan" 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 CognitiveServicesCommitmentPlanResource created on azure
|
||||
// for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName);
|
||||
CognitiveServicesCommitmentPlanResource cognitiveServicesCommitmentPlan = client.GetCognitiveServicesCommitmentPlanResource(cognitiveServicesCommitmentPlanResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await cognitiveServicesCommitmentPlan.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,29 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteSharedCommitmentPlanAssociation.json
|
||||
// this example is just showing the usage of "CommitmentPlans_DeleteAssociation" 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 CommitmentPlanAccountAssociationResource created on azure
|
||||
// for more information of creating CommitmentPlanAccountAssociationResource, please refer to the document of CommitmentPlanAccountAssociationResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
string commitmentPlanAssociationName = "commitmentPlanAssociationName";
|
||||
ResourceIdentifier commitmentPlanAccountAssociationResourceId = CommitmentPlanAccountAssociationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName, commitmentPlanAssociationName);
|
||||
CommitmentPlanAccountAssociationResource commitmentPlanAccountAssociation = client.GetCommitmentPlanAccountAssociationResource(commitmentPlanAccountAssociationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
await commitmentPlanAccountAssociation.DeleteAsync(WaitUntil.Completed);
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,46 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetAccount.json
|
||||
// this example is just showing the usage of "Accounts_Get" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesAccountResource
|
||||
CognitiveServicesAccountCollection collection = resourceGroupResource.GetCognitiveServicesAccounts();
|
||||
|
||||
// invoke the operation
|
||||
string accountName = "myAccount";
|
||||
NullableResponse<CognitiveServicesAccountResource> response = await collection.GetIfExistsAsync(accountName);
|
||||
CognitiveServicesAccountResource 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
|
||||
CognitiveServicesAccountData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,45 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetCommitmentPlan.json
|
||||
// this example is just showing the usage of "CommitmentPlans_Get" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this CommitmentPlanResource
|
||||
CommitmentPlanCollection collection = cognitiveServicesAccount.GetCommitmentPlans();
|
||||
|
||||
// invoke the operation
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
NullableResponse<CommitmentPlanResource> response = await collection.GetIfExistsAsync(commitmentPlanName);
|
||||
CommitmentPlanResource 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
|
||||
CommitmentPlanData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,45 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDefenderForAISetting.json
|
||||
// this example is just showing the usage of "DefenderForAISettings_Get" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this DefenderForAISettingResource
|
||||
DefenderForAISettingCollection collection = cognitiveServicesAccount.GetDefenderForAISettings();
|
||||
|
||||
// invoke the operation
|
||||
string defenderForAISettingName = "Default";
|
||||
NullableResponse<DefenderForAISettingResource> response = await collection.GetIfExistsAsync(defenderForAISettingName);
|
||||
DefenderForAISettingResource 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
|
||||
DefenderForAISettingData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeletedAccount.json
|
||||
// this example is just showing the usage of "DeletedAccounts_Get" 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 CognitiveServicesDeletedAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesDeletedAccountResource, please refer to the document of CognitiveServicesDeletedAccountResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
AzureLocation location = new AzureLocation("westus");
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
string accountName = "myAccount";
|
||||
ResourceIdentifier cognitiveServicesDeletedAccountResourceId = CognitiveServicesDeletedAccountResource.CreateResourceIdentifier(subscriptionId, location, resourceGroupName, accountName);
|
||||
CognitiveServicesDeletedAccountResource cognitiveServicesDeletedAccount = client.GetCognitiveServicesDeletedAccountResource(cognitiveServicesDeletedAccountResourceId);
|
||||
|
||||
// invoke the operation
|
||||
CognitiveServicesDeletedAccountResource result = await cognitiveServicesDeletedAccount.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
|
||||
CognitiveServicesAccountData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeployment.json
|
||||
// this example is just showing the usage of "Deployments_Get" 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 CognitiveServicesAccountDeploymentResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountDeploymentResource, please refer to the document of CognitiveServicesAccountDeploymentResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string deploymentName = "deploymentName";
|
||||
ResourceIdentifier cognitiveServicesAccountDeploymentResourceId = CognitiveServicesAccountDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, deploymentName);
|
||||
CognitiveServicesAccountDeploymentResource cognitiveServicesAccountDeployment = client.GetCognitiveServicesAccountDeploymentResource(cognitiveServicesAccountDeploymentResourceId);
|
||||
|
||||
// invoke the operation
|
||||
CognitiveServicesAccountDeploymentResource result = await cognitiveServicesAccountDeployment.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
|
||||
CognitiveServicesAccountDeploymentData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetEncryptionScope.json
|
||||
// this example is just showing the usage of "EncryptionScopes_Get" 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 CognitiveServicesEncryptionScopeResource created on azure
|
||||
// for more information of creating CognitiveServicesEncryptionScopeResource, please refer to the document of CognitiveServicesEncryptionScopeResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string encryptionScopeName = "encryptionScopeName";
|
||||
ResourceIdentifier cognitiveServicesEncryptionScopeResourceId = CognitiveServicesEncryptionScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, encryptionScopeName);
|
||||
CognitiveServicesEncryptionScopeResource cognitiveServicesEncryptionScope = client.GetCognitiveServicesEncryptionScopeResource(cognitiveServicesEncryptionScopeResourceId);
|
||||
|
||||
// invoke the operation
|
||||
CognitiveServicesEncryptionScopeResource result = await cognitiveServicesEncryptionScope.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
|
||||
CognitiveServicesEncryptionScopeData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetNetworkSecurityPerimeterConfigurations.json
|
||||
// this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" 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 NetworkSecurityPerimeterConfigurationResource created on azure
|
||||
// for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string nspConfigurationName = "NSPConfigurationName";
|
||||
ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, nspConfigurationName);
|
||||
NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId);
|
||||
|
||||
// invoke the operation
|
||||
NetworkSecurityPerimeterConfigurationResource result = await networkSecurityPerimeterConfiguration.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
|
||||
NetworkSecurityPerimeterConfigurationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,44 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetPrivateEndpointConnection.json
|
||||
// this example is just showing the usage of "PrivateEndpointConnections_Get" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "{subscription-id}";
|
||||
string resourceGroupName = "res6977";
|
||||
string accountName = "sto2527";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesPrivateEndpointConnectionResource
|
||||
CognitiveServicesPrivateEndpointConnectionCollection collection = cognitiveServicesAccount.GetCognitiveServicesPrivateEndpointConnections();
|
||||
|
||||
// invoke the operation
|
||||
string privateEndpointConnectionName = "{privateEndpointConnectionName}";
|
||||
NullableResponse<CognitiveServicesPrivateEndpointConnectionResource> response = await collection.GetIfExistsAsync(privateEndpointConnectionName);
|
||||
CognitiveServicesPrivateEndpointConnectionResource 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
|
||||
CognitiveServicesPrivateEndpointConnectionData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,35 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklist.json
|
||||
// this example is just showing the usage of "RaiBlocklists_Get" 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 RaiBlocklistResource created on azure
|
||||
// for more information of creating RaiBlocklistResource, please refer to the document of RaiBlocklistResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
ResourceIdentifier raiBlocklistResourceId = RaiBlocklistResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName);
|
||||
RaiBlocklistResource raiBlocklist = client.GetRaiBlocklistResource(raiBlocklistResourceId);
|
||||
|
||||
// invoke the operation
|
||||
RaiBlocklistResource result = await raiBlocklist.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
|
||||
RaiBlocklistData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,35 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklistItem.json
|
||||
// this example is just showing the usage of "RaiBlocklistItems_Get" 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 RaiBlocklistItemResource created on azure
|
||||
// for more information of creating RaiBlocklistItemResource, please refer to the document of RaiBlocklistItemResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
string raiBlocklistItemName = "raiBlocklistItemName";
|
||||
ResourceIdentifier raiBlocklistItemResourceId = RaiBlocklistItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName);
|
||||
RaiBlocklistItemResource raiBlocklistItem = client.GetRaiBlocklistItemResource(raiBlocklistItemResourceId);
|
||||
|
||||
// invoke the operation
|
||||
RaiBlocklistItemResource result = await raiBlocklistItem.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
|
||||
RaiBlocklistItemData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,44 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiContentFilter.json
|
||||
// this example is just showing the usage of "RaiContentFilters_Get" 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 RaiContentFilterResource
|
||||
AzureLocation location = new AzureLocation("WestUS");
|
||||
RaiContentFilterCollection collection = subscriptionResource.GetRaiContentFilters(location);
|
||||
|
||||
// invoke the operation
|
||||
string filterName = "IndirectAttack";
|
||||
NullableResponse<RaiContentFilterResource> response = await collection.GetIfExistsAsync(filterName);
|
||||
RaiContentFilterResource 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
|
||||
RaiContentFilterData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,45 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiPolicy.json
|
||||
// this example is just showing the usage of "RaiPolicies_Get" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this RaiPolicyResource
|
||||
RaiPolicyCollection collection = cognitiveServicesAccount.GetRaiPolicies();
|
||||
|
||||
// invoke the operation
|
||||
string raiPolicyName = "raiPolicyName";
|
||||
NullableResponse<RaiPolicyResource> response = await collection.GetIfExistsAsync(raiPolicyName);
|
||||
RaiPolicyResource 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
|
||||
RaiPolicyData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,45 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlan.json
|
||||
// this example is just showing the usage of "CommitmentPlans_GetPlan" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesCommitmentPlanResource
|
||||
CognitiveServicesCommitmentPlanCollection collection = resourceGroupResource.GetCognitiveServicesCommitmentPlans();
|
||||
|
||||
// invoke the operation
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
NullableResponse<CognitiveServicesCommitmentPlanResource> response = await collection.GetIfExistsAsync(commitmentPlanName);
|
||||
CognitiveServicesCommitmentPlanResource 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
|
||||
CommitmentPlanData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,44 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlanAssociation.json
|
||||
// this example is just showing the usage of "CommitmentPlans_GetAssociation" 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 CognitiveServicesCommitmentPlanResource created on azure
|
||||
// for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string commitmentPlanName = "commitmentPlanName";
|
||||
ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName);
|
||||
CognitiveServicesCommitmentPlanResource cognitiveServicesCommitmentPlan = client.GetCognitiveServicesCommitmentPlanResource(cognitiveServicesCommitmentPlanResourceId);
|
||||
|
||||
// get the collection of this CommitmentPlanAccountAssociationResource
|
||||
CommitmentPlanAccountAssociationCollection collection = cognitiveServicesCommitmentPlan.GetCommitmentPlanAccountAssociations();
|
||||
|
||||
// invoke the operation
|
||||
string commitmentPlanAssociationName = "commitmentPlanAssociationName";
|
||||
NullableResponse<CommitmentPlanAccountAssociationResource> response = await collection.GetIfExistsAsync(commitmentPlanAssociationName);
|
||||
CommitmentPlanAccountAssociationResource 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
|
||||
CommitmentPlanAccountAssociationData resourceData = result.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,31 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSkus.json
|
||||
// this example is just showing the usage of "ResourceSkus_List" 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 = "f1c637e4-72ec-4f89-8d2b-0f933c036002";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (AvailableCognitiveServicesSku item in subscriptionResource.GetResourceSkusAsync())
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetUsages.json
|
||||
// this example is just showing the usage of "Accounts_ListUsages" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "5a4f5c2e-6983-4ccb-bd34-2196d5b5bbd3";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
string accountName = "TestUsage02";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (ServiceAccountUsage item in cognitiveServicesAccount.GetUsagesAsync())
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountModels.json
|
||||
// this example is just showing the usage of "Accounts_ListModels" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesAccountModel item in cognitiveServicesAccount.GetModelsAsync())
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,40 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountsByResourceGroup.json
|
||||
// this example is just showing the usage of "Accounts_ListByResourceGroup" 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 ResourceGroupResource created on azure
|
||||
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
|
||||
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesAccountResource
|
||||
CognitiveServicesAccountCollection collection = resourceGroupResource.GetCognitiveServicesAccounts();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesAccountResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CognitiveServicesAccountData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,35 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountsBySubscription.json
|
||||
// this example is just showing the usage of "Accounts_List" 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesAccountResource item in subscriptionResource.GetCognitiveServicesAccountsAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CognitiveServicesAccountData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,40 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListBlocklistItems.json
|
||||
// this example is just showing the usage of "RaiBlocklistItems_List" 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 RaiBlocklistResource created on azure
|
||||
// for more information of creating RaiBlocklistResource, please refer to the document of RaiBlocklistResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string raiBlocklistName = "raiBlocklistName";
|
||||
ResourceIdentifier raiBlocklistResourceId = RaiBlocklistResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, raiBlocklistName);
|
||||
RaiBlocklistResource raiBlocklist = client.GetRaiBlocklistResource(raiBlocklistResourceId);
|
||||
|
||||
// get the collection of this RaiBlocklistItemResource
|
||||
RaiBlocklistItemCollection collection = raiBlocklist.GetRaiBlocklistItems();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (RaiBlocklistItemResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
RaiBlocklistItemData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,38 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListBlocklists.json
|
||||
// this example is just showing the usage of "RaiBlocklists_List" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this RaiBlocklistResource
|
||||
RaiBlocklistCollection collection = cognitiveServicesAccount.GetRaiBlocklists();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (RaiBlocklistResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
RaiBlocklistData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListCommitmentPlans.json
|
||||
// this example is just showing the usage of "CommitmentPlans_List" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this CommitmentPlanResource
|
||||
CommitmentPlanCollection collection = cognitiveServicesAccount.GetCommitmentPlans();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CommitmentPlanResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CommitmentPlanData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,32 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListCommitmentTiers.json
|
||||
// this example is just showing the usage of "CommitmentTiers_List" 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 = "subscriptionId";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("location");
|
||||
await foreach (CommitmentTier item in subscriptionResource.GetCommitmentTiersAsync(location))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDefenderForAISetting.json
|
||||
// this example is just showing the usage of "DefenderForAISettings_List" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this DefenderForAISettingResource
|
||||
DefenderForAISettingCollection collection = cognitiveServicesAccount.GetDefenderForAISettings();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (DefenderForAISettingResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
DefenderForAISettingData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,34 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeletedAccountsBySubscription.json
|
||||
// this example is just showing the usage of "DeletedAccounts_List" 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
|
||||
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesDeletedAccountResource item in subscriptionResource.GetDeletedAccountsAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CognitiveServicesAccountData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,33 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeploymentSkus.json
|
||||
// this example is just showing the usage of "Deployments_ListSkus" 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 CognitiveServicesAccountDeploymentResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountDeploymentResource, please refer to the document of CognitiveServicesAccountDeploymentResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
string deploymentName = "deploymentName";
|
||||
ResourceIdentifier cognitiveServicesAccountDeploymentResourceId = CognitiveServicesAccountDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, deploymentName);
|
||||
CognitiveServicesAccountDeploymentResource cognitiveServicesAccountDeployment = client.GetCognitiveServicesAccountDeploymentResource(cognitiveServicesAccountDeploymentResourceId);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesResourceSku item in cognitiveServicesAccountDeployment.GetSkusAsync())
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeployments.json
|
||||
// this example is just showing the usage of "Deployments_List" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "subscriptionId";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesAccountDeploymentResource
|
||||
CognitiveServicesAccountDeploymentCollection collection = cognitiveServicesAccount.GetCognitiveServicesAccountDeployments();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesAccountDeploymentResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CognitiveServicesAccountDeploymentData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,39 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListEncryptionScopes.json
|
||||
// this example is just showing the usage of "EncryptionScopes_List" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
string resourceGroupName = "resourceGroupName";
|
||||
string accountName = "accountName";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// get the collection of this CognitiveServicesEncryptionScopeResource
|
||||
CognitiveServicesEncryptionScopeCollection collection = cognitiveServicesAccount.GetCognitiveServicesEncryptionScopes();
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
await foreach (CognitiveServicesEncryptionScopeResource item in collection.GetAllAsync())
|
||||
{
|
||||
// the variable item 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
|
||||
CognitiveServicesEncryptionScopeData resourceData = item.Data;
|
||||
// for demo we just print out the id
|
||||
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,30 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListKeys.json
|
||||
// this example is just showing the usage of "Accounts_ListKeys" 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 CognitiveServicesAccountResource created on azure
|
||||
// for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource
|
||||
string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
||||
string resourceGroupName = "myResourceGroup";
|
||||
string accountName = "myAccount";
|
||||
ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
|
||||
CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId);
|
||||
|
||||
// invoke the operation
|
||||
ServiceAccountApiKeys result = await cognitiveServicesAccount.GetKeysAsync();
|
||||
|
||||
Console.WriteLine($"Succeeded: {result}");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,35 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListLocationBasedModelCapacities.json
|
||||
// this example is just showing the usage of "LocationBasedModelCapacities_List" 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);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("WestUS");
|
||||
string modelFormat = "OpenAI";
|
||||
string modelName = "ada";
|
||||
string modelVersion = "1";
|
||||
await foreach (ModelCapacityListResultValueItem item in subscriptionResource.GetLocationBasedModelCapacitiesAsync(location, modelFormat, modelName, modelVersion))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
|
@ -0,0 +1,32 @@
|
|||
using Azure;
|
||||
using Azure.ResourceManager;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Azure.Core;
|
||||
using Azure.Identity;
|
||||
using Azure.ResourceManager.CognitiveServices.Models;
|
||||
using Azure.ResourceManager.Resources;
|
||||
using Azure.ResourceManager.CognitiveServices;
|
||||
|
||||
// Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListLocationModels.json
|
||||
// this example is just showing the usage of "Models_List" 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);
|
||||
|
||||
// invoke the operation and iterate over the result
|
||||
AzureLocation location = new AzureLocation("WestUS");
|
||||
await foreach (CognitiveServicesModel item in subscriptionResource.GetModelsAsync(location))
|
||||
{
|
||||
Console.WriteLine($"Succeeded: {item}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Succeeded");
|
|
@ -0,0 +1 @@
|
|||
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-net/blob/Azure.ResourceManager.CognitiveServices_1.4.0/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/README.md"}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче