共用方式為


Set-AzureRmEnvironment

設定 Azure 環境的屬性。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

Set-AzureRmEnvironment
   [-Name] <String>
   [[-PublishSettingsFileUrl] <String>]
   [[-ServiceEndpoint] <String>]
   [[-ManagementPortalUrl] <String>]
   [[-StorageEndpoint] <String>]
   [[-ActiveDirectoryEndpoint] <String>]
   [[-ResourceManagerEndpoint] <String>]
   [[-GalleryEndpoint] <String>]
   [[-ActiveDirectoryServiceEndpointResourceId] <String>]
   [[-GraphEndpoint] <String>]
   [[-AzureKeyVaultDnsSuffix] <String>]
   [[-AzureKeyVaultServiceEndpointResourceId] <String>]
   [[-TrafficManagerDnsSuffix] <String>]
   [[-SqlDatabaseDnsSuffix] <String>]
   [[-AzureDataLakeStoreFileSystemEndpointSuffix] <String>]
   [[-AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix] <String>]
   [-EnableAdfsAuthentication]
   [[-AdTenant] <String>]
   [[-GraphAudience] <String>]
   [[-DataLakeAudience] <String>]
   [[-BatchEndpointResourceId] <String>]
   [[-AzureOperationalInsightsEndpointResourceId] <String>]
   [[-AzureOperationalInsightsEndpoint] <String>]
   [[-AzureAnalysisServicesEndpointSuffix] <String>]
   [-Scope <ContextModificationScope>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzureRmEnvironment
   [-Name] <String>
   [[-StorageEndpoint] <String>]
   [-ARMEndpoint] <String>
   [[-AzureKeyVaultDnsSuffix] <String>]
   [[-AzureKeyVaultServiceEndpointResourceId] <String>]
   [[-DataLakeAudience] <String>]
   [[-BatchEndpointResourceId] <String>]
   [[-AzureOperationalInsightsEndpointResourceId] <String>]
   [[-AzureOperationalInsightsEndpoint] <String>]
   [-Scope <ContextModificationScope>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Set-AzureRMEnvironment Cmdlet 會設定用來連線到 Azure 實例的端點和元數據。

範例

範例 1:建立和修改新環境

PS C:\> Add-AzureRmEnvironment -Name TestEnvironment `
        -ActiveDirectoryEndpoint TestADEndpoint `
        -ActiveDirectoryServiceEndpointResourceId TestADApplicationId `
        -ResourceManagerEndpoint TestRMEndpoint `
        -GalleryEndpoint TestGalleryEndpoint `
        -GraphEndpoint TestGraphEndpoint

Name            Resource Manager Url ActiveDirectory Authority
----            -------------------- -------------------------
TestEnvironment TestRMEndpoint       TestADEndpoint/

PS C:\> Set-AzureRmEnvironment -Name TestEnvironment
        -ActiveDirectoryEndpoint NewTestADEndpoint
        -GraphEndpoint NewTestGraphEndpoint | Format-List

Name                                              : TestEnvironment
EnableAdfsAuthentication                          : False
ActiveDirectoryServiceEndpointResourceId          : TestADApplicationId
AdTenant                                          :
GalleryUrl                                        : TestGalleryEndpoint
ManagementPortalUrl                               :
ServiceManagementUrl                              : 
PublishSettingsFileUrl                            :
ResourceManagerUrl                                : TestRMEndpoint
SqlDatabaseDnsSuffix                              :
StorageEndpointSuffix                             :
ActiveDirectoryAuthority                          : NewTestADEndpoint
GraphUrl                                          : NewTestGraphEndpoint
GraphEndpointResourceId                           :
TrafficManagerDnsSuffix                           :
AzureKeyVaultDnsSuffix                            :
AzureDataLakeStoreFileSystemEndpointSuffix        :
AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix :
AzureKeyVaultServiceEndpointResourceId            :
BatchEndpointResourceId                           :
AzureOperationalInsightsEndpoint                  :
AzureOperationalInsightsEndpointResourceId        :

在此範例中,我們會使用 Add-AzureRmEnvironment 建立具有範例端點的新 Azure 環境,然後使用 Cmdlet Set-AzureRmEnvironment 變更所建立環境的 ActiveDirectoryEndpoint 和 GraphEndpoint 屬性值。

參數

-ActiveDirectoryEndpoint

指定 Microsoft Entra 驗證的基底授權單位。

類型:String
別名:AdEndpointUrl, ActiveDirectory, ActiveDirectoryAuthority
Position:5
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ActiveDirectoryServiceEndpointResourceId

指定令牌的對象,這些令牌會驗證對 Azure Resource Manager 或服務管理 (RDFE) 端點的要求。

類型:String
Position:8
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AdTenant

指定預設的 Active Directory 租使用者。

類型:String
Position:17
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ARMEndpoint

Azure Resource Manager 端點。

類型:String
別名:ArmUrl
Position:1
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-AzureAnalysisServicesEndpointSuffix

Azure Analysis Services 服務端點的 Dns 後綴

類型:String
Position:15
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix

Azure Data Lake Analytics 作業和目錄服務的 Dns 後綴

類型:String
Position:15
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureDataLakeStoreFileSystemEndpointSuffix

Azure Data Lake Store FileSystem 的 Dns 後綴。 範例:azuredatalake.net

類型:String
Position:14
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureKeyVaultDnsSuffix

指定 金鑰保存庫 服務的功能變數名稱後綴。

類型:String
Position:10
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureKeyVaultServiceEndpointResourceId

指定存取權杖的物件,這些權杖會授權 Key Vault 服務的要求。

類型:String
Position:11
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureOperationalInsightsEndpoint

指定 Operational Insights 查詢存取的端點。

類型:String
Position:22
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-AzureOperationalInsightsEndpointResourceId

指定存取令牌的對象,這些令牌會授權 Operational Insights 服務的要求。

類型:String
Position:21
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-BatchEndpointResourceId

Azure Batch 服務的資源標識符,此服務是所要求令牌的收件者

類型:String
別名:BatchResourceId, BatchAudience
Position:20
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-DataLakeAudience

使用 AD Data Lake 服務端點進行驗證的權杖物件。

類型:String
別名:DataLakeEndpointResourceId, DataLakeResourceId
Position:19
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-EnableAdfsAuthentication

表示允許 Active Directory 同盟服務 (ADFS) 內部部署驗證。

類型:SwitchParameter
別名:OnPremise
Position:16
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-GalleryEndpoint

指定部署範本的 Azure Resource Manager 資源庫端點。

類型:String
別名:Gallery, GalleryUrl
Position:7
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-GraphAudience

使用 AD Graph 端點進行驗證的令牌物件。

類型:String
別名:GraphEndpointResourceId, GraphResourceId
Position:18
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-GraphEndpoint

指定 Graph (Active Directory 元數據) 要求的 URL。

類型:String
別名:Graph, GraphUrl
Position:9
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ManagementPortalUrl

指定管理入口網站的 URL。

類型:String
Position:3
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Name

指定要修改的環境名稱。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-PublishSettingsFileUrl

指定可從中下載 .publishsettings 檔案的 URL。

類型:String
Position:1
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ResourceManagerEndpoint

指定 Azure Resource Manager 要求的 URL。

類型:String
別名:ResourceManager, ResourceManagerUrl
Position:6
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Scope

判斷內容變更的範圍,例如,變更僅適用於目前進程,或套用至此用戶啟動的所有會話。

類型:ContextModificationScope
接受的值:Process, CurrentUser
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ServiceEndpoint

指定服務管理 (RDFE) 要求的端點。

類型:String
別名:ServiceManagement, ServiceManagementUrl
Position:2
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-SqlDatabaseDnsSuffix

指定 Azure SQL 資料庫 伺服器的網域名稱後綴。

類型:String
Position:13
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageEndpoint

指定記憶體的端點(Blob、數據表、佇列和檔案)存取。

類型:String
別名:StorageEndpointSuffix
Position:4
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-TrafficManagerDnsSuffix

指定 Azure 流量管理員 服務的功能變數名稱後綴。

類型:String
Position:12
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

String

SwitchParameter

輸出

PSAzureEnvironment