Bearbeiten

Freigeben über


Get-AzUserAssignedIdentityAssociatedResource

Lists the associated resources for this identity.

Syntax

Get-AzUserAssignedIdentityAssociatedResource
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-Filter <String>]
   [-Orderby <String>]
   [-Skip <Int32>]
   [-Skiptoken <String>]
   [-Top <Int32>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Lists the associated resources for this identity.

Examples

Example 1: List all azure resources associated with given identity.

Get-AzUserAssignedIdentityAssociatedResource -ResourceGroupName azure-rg-test -Name uai-pwsh01

Name             ResourceGroup     SubscriptionDisplayName               SubscriptionId                       ResourceType
----             -------------     -----------------------               --------------                       ------------
appServicej6ocml identity-xcsbyfid Visual Studio Enterprise Subscription 0336439f-0e9d-44ec-975e-62accb9b3901 microsoft.web/sites
default          test-resources    Visual Studio Enterprise Subscription 0336439f-0e9d-44ec-975e-62accb9b3901 microsoft.compute/virtualmachines

This command lists all azure resources associated with given identity.

Example 2: List azure resources associated with given identity with OData expression that allows to filter by: name, type, resourceGroup, subscriptionId, subscriptionDisplayName

Get-AzUserAssignedIdentityAssociatedResource -ResourceGroupName azure-rg-test -Name uai-pwsh01 `
    -Filter "type eq 'microsoft.compute/virtualmachines' and contains(name, 'default')"

Name    ResourceGroup  SubscriptionDisplayName               SubscriptionId                       ResourceType
----    -------------  -----------------------               --------------                       ------------
default test-resources Visual Studio Enterprise Subscription 0336439f-0e9d-44ec-975e-62accb9b3901 microsoft.compute/virtualmachines

This command lists azure resources associated with given identity with OData expression that allows to filter by: name, type, resourceGroup, subscriptionId, subscriptionDisplayName

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

OData filter expression to apply to the query.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the identity resource.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Orderby

OData orderBy expression to apply to the query.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the Resource Group to which the identity belongs.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Skip

Number of records to skip.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Skiptoken

A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The Id of the Subscription to which the identity belongs.

Type:String[]
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Top

Number of records to return.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IAzureResource