Get-AzAppServicePlanRdpCredential
Gets secure RDP credentials for a Managed Instance App Service plan.
Syntax
S1 (Default)
Get-AzAppServicePlanRdpCredential
[-ResourceGroupName] <String>
[-Name] <String>
[-DefaultProfile <IAzureContextContainer>]
[-AcquirePolicyToken]
[-ChangeReference <String>]
[<CommonParameters>]
S2
Get-AzAppServicePlanRdpCredential
[-AppServicePlan] <PSAppServicePlan>
[-DefaultProfile <IAzureContextContainer>]
[-AcquirePolicyToken]
[-ChangeReference <String>]
[<CommonParameters>]
Description
The Get-AzAppServicePlanRdpCredential cmdlet retrieves Remote Desktop Protocol (RDP) credentials for a Managed Instance plan with RDP enabled. It returns a PSCredential object with the Administrator user name and the password stored as a SecureString. The password is not written to the console or clipboard. An error is returned if the service does not provide a password.
Use Get-AzAppServicePlanManagedInstance to retrieve the worker IP address, and use the credential with your configured Azure Bastion or RDP client. This cmdlet does not create a Bastion tunnel or launch a desktop client.
Examples
Example 1: Retrieve secure RDP credentials
$credential = Get-AzAppServicePlanRdpCredential -ResourceGroupName "ContosoRG" -Name "ContosoManagedPlan"
This command stores the plan's RDP credentials without displaying the password.
Enable RDP first with Set-AzAppServicePlan -ResourceGroupName "ContosoRG" -Name "ContosoManagedPlan" -RdpEnabled $true.
Example 2: Retrieve credentials from a plan in the pipeline
$credential = Get-AzAppServicePlan -ResourceGroupName "ContosoRG" -Name "ContosoManagedPlan" |
Get-AzAppServicePlanRdpCredential
$instance = Get-AzAppServicePlanManagedInstance -ResourceGroupName "ContosoRG" -Name "ContosoManagedPlan" -InstanceName "WORKER1"
Use the instance's IPAddress property and the credential with your configured connection client. Treat the credential as sensitive information and retrieve a new credential if the service-issued password expires.
Parameters
-AcquirePolicyToken
Acquire an Azure Policy token automatically for this resource operation.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AppServicePlan
The Managed Instance App Service plan object whose RDP credentials are retrieved. Use Get-AzAppServicePlan to retrieve the object.
Parameter properties
| Type: | PSAppServicePlan |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
S2
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ChangeReference
The change reference resource ID for this resource operation.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Name
The name of the Managed Instance App Service plan with RDP enabled.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
S1
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ResourceGroupName
The resource group containing the Managed Instance App Service plan.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
S1
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.