Initiates the deletion of the shared private link resource from the search service.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}?api-version=2024-03-01-preview
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
|
searchServiceName
|
path |
True
|
string
|
The name of the Azure AI Search service associated with the specified resource group.
Regex pattern: ^(?=.{2,60}$)[a-z0-9][a-z0-9]+(-[a-z0-9]+)*$
|
sharedPrivateLinkResourceName
|
path |
True
|
string
|
The name of the shared private link resource managed by the Azure AI Search service within the specified resource group.
|
subscriptionId
|
path |
True
|
string
|
The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
|
api-version
|
query |
True
|
string
|
The API version to use for each request.
|
Name |
Required |
Type |
Description |
x-ms-client-request-id
|
|
string
uuid
|
A client-generated GUID value that identifies this request. If specified, this will be included in response information as a way to track the request.
|
Responses
Name |
Type |
Description |
202 Accepted
|
|
The shared private link resource deletion operation was accepted and will complete asynchronously.
|
204 No Content
|
|
The backing private endpoint for the shared private link resource could not be found.
|
404 Not Found
|
|
The subscription, resource group, search service or shared private link resource could not be found.
|
Other Status Codes
|
CloudError
|
An unexpected error occurred during the operation.
|
Security
azure_auth
Specifies an implicit grant flow, as supported on the Microsoft Identity platform.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
SharedPrivateLinkResourceDelete
Sample request
DELETE https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource?api-version=2024-03-01-preview
from azure.identity import DefaultAzureCredential
from azure.mgmt.search import SearchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-search
# USAGE
python delete_shared_private_link_resource.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SearchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
client.shared_private_link_resources.begin_delete(
resource_group_name="rg1",
search_service_name="mysearchservice",
shared_private_link_resource_name="testResource",
).result()
# x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsearch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json
func ExampleSharedPrivateLinkResourcesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "rg1", "mysearchservice", "testResource", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Initiates the deletion of the shared private link resource from the search service.
*
* @summary Initiates the deletion of the shared private link resource from the search service.
* x-ms-original-file: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json
*/
async function sharedPrivateLinkResourceDelete() {
const subscriptionId = process.env["SEARCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["SEARCH_RESOURCE_GROUP"] || "rg1";
const searchServiceName = "mysearchservice";
const sharedPrivateLinkResourceName = "testResource";
const credential = new DefaultAzureCredential();
const client = new SearchManagementClient(credential, subscriptionId);
const result = await client.sharedPrivateLinkResources.beginDeleteAndWait(
resourceGroupName,
searchServiceName,
sharedPrivateLinkResourceName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Search.Models;
using Azure.ResourceManager.Search;
// Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json
// this example is just showing the usage of "SharedPrivateLinkResources_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 SharedSearchServicePrivateLinkResource created on azure
// for more information of creating SharedSearchServicePrivateLinkResource, please refer to the document of SharedSearchServicePrivateLinkResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string searchServiceName = "mysearchservice";
string sharedPrivateLinkResourceName = "testResource";
ResourceIdentifier sharedSearchServicePrivateLinkResourceId = SharedSearchServicePrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName, sharedPrivateLinkResourceName);
SharedSearchServicePrivateLinkResource sharedSearchServicePrivateLinkResource = client.GetSharedSearchServicePrivateLinkResource(sharedSearchServicePrivateLinkResourceId);
// invoke the operation
await sharedSearchServicePrivateLinkResource.DeleteAsync(WaitUntil.Completed);
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource/operationStatuses/159c5e07-c829-4896-8aba-a1d4fcc7c89c?api-version=2024-03-01-preview
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource/operationStatuses/159c5e07-c829-4896-8aba-a1d4fcc7c89c?api-version=2024-03-01-preview
Definitions
Name |
Description |
CloudError
|
Contains information about an API error.
|
CloudErrorBody
|
Describes a particular API error with an error code and a message.
|
CloudError
Contains information about an API error.
Name |
Type |
Description |
error
|
CloudErrorBody
|
Describes a particular API error with an error code and a message.
|
message
|
string
|
A brief description of the error that hints at what went wrong (for details/debugging information refer to the 'error.message' property).
|
CloudErrorBody
Describes a particular API error with an error code and a message.
Name |
Type |
Description |
code
|
string
|
An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases.
|
details
|
CloudErrorBody[]
|
Contains nested errors that are related to this error.
|
message
|
string
|
A message that describes the error in detail and provides debugging information.
|
target
|
string
|
The target of the particular error (for example, the name of the property in error).
|