DELETE https://management.azure.com/subscriptions/c267c0e7-0a73-4789-9e17-d26aeb0904e5/resourceGroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/ficResourceName?api-version=2023-01-31
/**
* Samples for FederatedIdentityCredentials Delete.
*/
public final class Main {
/*
* x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/
* FederatedIdentityCredentialDelete.json
*/
/**
* Sample code: FederatedIdentityCredentialDelete.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void federatedIdentityCredentialDelete(com.azure.resourcemanager.AzureResourceManager azure) {
azure.identities().manager().serviceClient().getFederatedIdentityCredentials().deleteWithResponse("rgName",
"resourceName", "ficResourceName", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.msi import ManagedServiceIdentityClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-msi
# USAGE
python federated_identity_credential_delete.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 = ManagedServiceIdentityClient(
credential=DefaultAzureCredential(),
subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5",
)
response = client.federated_identity_credentials.delete(
resource_group_name="rgName",
resource_name="resourceName",
federated_identity_credential_resource_name="ficResourceName",
)
print(response)
# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialDelete.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 armmsi_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3d7a3848106b831a4a7f46976fe38aa605c4f44d/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialDelete.json
func ExampleFederatedIdentityCredentialsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmsi.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewFederatedIdentityCredentialsClient().Delete(ctx, "rgName", "resourceName", "ficResourceName", nil)
if err != nil {
log.Fatalf("failed to finish the request: %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 { ManagedServiceIdentityClient } = require("@azure/arm-msi");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes the federated identity credential.
*
* @summary Deletes the federated identity credential.
* x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialDelete.json
*/
async function federatedIdentityCredentialDelete() {
const subscriptionId =
process.env["MSI_SUBSCRIPTION_ID"] || "c267c0e7-0a73-4789-9e17-d26aeb0904e5";
const resourceGroupName = process.env["MSI_RESOURCE_GROUP"] || "rgName";
const resourceName = "resourceName";
const federatedIdentityCredentialResourceName = "ficResourceName";
const credential = new DefaultAzureCredential();
const client = new ManagedServiceIdentityClient(credential, subscriptionId);
const result = await client.federatedIdentityCredentials.delete(
resourceGroupName,
resourceName,
federatedIdentityCredentialResourceName
);
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.ManagedServiceIdentities;
// Generated from example definition: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialDelete.json
// this example is just showing the usage of "FederatedIdentityCredentials_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://video2.skills-academy.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 FederatedIdentityCredentialResource created on azure
// for more information of creating FederatedIdentityCredentialResource, please refer to the document of FederatedIdentityCredentialResource
string subscriptionId = "c267c0e7-0a73-4789-9e17-d26aeb0904e5";
string resourceGroupName = "rgName";
string resourceName = "resourceName";
string federatedIdentityCredentialResourceName = "ficResourceName";
ResourceIdentifier federatedIdentityCredentialResourceId = FederatedIdentityCredentialResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, federatedIdentityCredentialResourceName);
FederatedIdentityCredentialResource federatedIdentityCredential = client.GetFederatedIdentityCredentialResource(federatedIdentityCredentialResourceId);
// invoke the operation
await federatedIdentityCredential.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