Set-AzContext
Beállítja a parancsmagok bérlői, előfizetési és környezeti beállításait az aktuális munkamenetben való használatra.
Syntax
Set-AzContext
[-Context] <PSAzureContext>
[-ExtendedProperty <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-Name <String>]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzContext
[-TenantObject] <PSAzureTenant>
[-ExtendedProperty <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-Name <String>]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzContext
[-SubscriptionObject] <PSAzureSubscription>
[-ExtendedProperty <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-Name <String>]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzContext
[-Tenant <String>]
[-Subscription] <String>
[-ExtendedProperty <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-Name <String>]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzContext
-Tenant <String>
[-ExtendedProperty <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-Name <String>]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
A Set-AzContext parancsmag beállítja az aktuális munkamenetben futtatott parancsmagok hitelesítési adatait. A környezet tartalmazza a bérlői, előfizetési és környezeti információkat.
Példák
1. példa: Az előfizetési környezet beállítása
Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"
Name Account SubscriptionName Environment TenantId
---- ------- ---------------- ----------- --------
Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
Ez a parancs beállítja a környezetet a megadott előfizetés használatára.
Paraméterek
-Confirm
Jóváhagyást kér a parancsmag futtatása előtt.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Context
Az aktuális munkamenet környezetét adja meg.
Type: | PSAzureContext |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Az Azure-ral való kommunikációhoz használt hitelesítő adatok, bérlő és előfizetés.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExtendedProperty
További környezeti tulajdonságok
Type: | IDictionary<TKey,TValue>[System.String,System.String] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Írja felül a meglévő környezetet ugyanazzal a névvel, ha van ilyen.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
A környezet neve
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Scope
Meghatározza a környezeti változások hatókörét, például azt, hogy a módosítások csak az aktuális folyamatra vagy a felhasználó által indított összes munkamenetre vonatkoznak-e.
Type: | ContextModificationScope |
Accepted values: | Process, CurrentUser |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Subscription
Annak az előfizetésnek a neve vagy azonosítója, amelyet a környezetnek be kell állítania. Ez a paraméter -SubscriptionName és -SubscriptionId aliasokkal rendelkezik, ezért az egyértelműség kedvéért ezek közül bármelyik használható a -Subscription helyett a név és az azonosító megadásakor.
Type: | String |
Aliases: | SubscriptionId, SubscriptionName |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SubscriptionObject
Előfizetési objektum
Type: | PSAzureSubscription |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tenant
Bérlő tartományneve vagy azonosítója
Type: | String |
Aliases: | Domain, TenantId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TenantObject
Bérlőobjektum
Type: | PSAzureTenant |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Bemutatja, mi történne a parancsmag futtatásakor. A parancsmag nem fut.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |