你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Set-AzEnvironment

设置 Azure 环境的属性。

语法

Name (默认值)

Set-AzEnvironment
    [-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>]
    [[-AdTenant] <String>]
    [[-GraphAudience] <String>]
    [[-DataLakeAudience] <String>]
    [[-BatchEndpointResourceId] <String>]
    [[-AzureOperationalInsightsEndpointResourceId] <String>]
    [[-AzureOperationalInsightsEndpoint] <String>]
    [-EnableAdfsAuthentication]
    [-AzureAnalysisServicesEndpointSuffix <String>]
    [-AzureAnalysisServicesEndpointResourceId <String>]
    [-AzureAttestationServiceEndpointSuffix <String>]
    [-AzureAttestationServiceEndpointResourceId <String>]
    [-AzureSynapseAnalyticsEndpointSuffix <String>]
    [-ContainerRegistryEndpointSuffix <String>]
    [-AzureSynapseAnalyticsEndpointResourceId <String>]
    [-MicrosoftGraphEndpointResourceId <String>]
    [-MicrosoftGraphUrl <String>]
    [-SshAuthScope <String>]
    [-Scope <ContextModificationScope>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ARMEndpoint

Set-AzEnvironment
    [-Name] <String>
    [[-StorageEndpoint] <String>]
    [-ARMEndpoint] <String>
    [[-AzureKeyVaultDnsSuffix] <String>]
    [[-AzureKeyVaultServiceEndpointResourceId] <String>]
    [[-DataLakeAudience] <String>]
    [[-BatchEndpointResourceId] <String>]
    [[-AzureOperationalInsightsEndpointResourceId] <String>]
    [[-AzureOperationalInsightsEndpoint] <String>]
    [-AzureAnalysisServicesEndpointSuffix <String>]
    [-AzureAnalysisServicesEndpointResourceId <String>]
    [-AzureAttestationServiceEndpointSuffix <String>]
    [-AzureAttestationServiceEndpointResourceId <String>]
    [-AzureSynapseAnalyticsEndpointSuffix <String>]
    [-ContainerRegistryEndpointSuffix <String>]
    [-AzureSynapseAnalyticsEndpointResourceId <String>]
    [-Scope <ContextModificationScope>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

说明

Set-AzEnvironment cmdlet 设置用于连接到 Azure 实例的终结点和元数据。

示例

示例 1:创建和修改新环境

Add-AzEnvironment -Name TestEnvironment `
        -ActiveDirectoryEndpoint TestADEndpoint `
        -ActiveDirectoryServiceEndpointResourceId TestADApplicationId `
        -ResourceManagerEndpoint TestRMEndpoint `
        -GalleryEndpoint TestGalleryEndpoint `
        -GraphEndpoint TestGraphEndpoint

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

Set-AzEnvironment -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        :
AzureAttestationServiceEndpointSuffix             :
AzureAttestationServiceEndpointResourceId         :
AzureSynapseAnalyticsEndpointSuffix               :
AzureSynapseAnalyticsEndpointResourceId           :

在此示例中,我们将使用 Add-AzEnvironment 创建包含示例终结点的新 Azure 环境,然后使用 cmdlet Set-AzEnvironment 更改创建的环境的 ActiveDirectoryEndpoint 和 GraphEndpoint 属性的值。

参数

-ActiveDirectoryEndpoint

指定 Azure Active Directory 身份验证的基本颁发机构。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:AdEndpointUrl, 活动目录, ActiveDirectoryAuthority

参数集

Name
Position:5
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ActiveDirectoryServiceEndpointResourceId

指定对对 Azure 资源管理器或服务管理(RDFE)终结点的请求进行身份验证的令牌的访问群体。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:8
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AdTenant

指定默认 Active Directory 租户。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:17
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ARMEndpoint

Azure 资源管理器终结点。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:ArmUrl

参数集

ARMEndpoint
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureAnalysisServicesEndpointResourceId

Azure Analysis Services 资源的资源标识符。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AzureAnalysisServicesEndpointSuffix

与 Azure Log Analytics API 通信时要使用的终结点。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AzureAttestationServiceEndpointResourceId

Azure 证明服务的资源标识符,即所请求令牌的接收者。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureAttestationServiceEndpointSuffix

Azure 证明服务的 Dns 后缀。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix

Azure Data Lake Analytics 作业和目录服务的 Dns 后缀

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:15
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureDataLakeStoreFileSystemEndpointSuffix

Azure Data Lake Store FileSystem 的 Dns 后缀。 示例:azuredatalake.net

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:14
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureKeyVaultDnsSuffix

Azure Key Vault 服务的 Dns 后缀。 示例为 vault-int.azure-int.net

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:10
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureKeyVaultServiceEndpointResourceId

Azure Key Vault 数据服务的资源标识符,该服务是所请求令牌的接收者。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:11
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureOperationalInsightsEndpoint

与 Azure Log Analytics API 通信时要使用的终结点。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:22
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureOperationalInsightsEndpointResourceId

使用 Azure Log Analytics API 进行身份验证的令牌受众。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:21
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureSynapseAnalyticsEndpointResourceId

Azure Synapse Analytics 的资源标识符,该标识符是所请求令牌的接收者。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-AzureSynapseAnalyticsEndpointSuffix

Azure Synapse Analytics 的 Dns 后缀。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-BatchEndpointResourceId

Azure Batch 服务的资源标识符,即所请求令牌的接收者

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:BatchResourceId, BatchAudience

参数集

(All)
Position:20
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Confirm

在运行 cmdlet 之前,提示你进行确认。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ContainerRegistryEndpointSuffix

Azure 容器注册表的后缀。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DataLakeAudience

使用 AD Data Lake 服务终结点进行身份验证的令牌受众。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:DataLakeEndpointResourceId, DataLakeResourceId

参数集

(All)
Position:19
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

参数属性

类型:IAzureContextContainer
默认值:None
支持通配符:False
不显示:False
别名:AzContext, AzureRmContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-EnableAdfsAuthentication

指示允许 Active Directory 联合身份验证服务(ADFS)本地身份验证。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:OnPremise

参数集

Name
Position:16
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-GalleryEndpoint

指定部署模板的 Azure 资源管理器库的终结点。 参数是将值设置为 GalleryUrl .PSAzureEnvironmentGalleryUrl ArmMetadata 中删除后,Azure PowerShell 将不再提供该值,因此不建议再设置 GalleryEndpoint 该值。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:Gallery, GalleryUrl

参数集

Name
Position:7
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-GraphAudience

使用 AD Graph 终结点进行身份验证的令牌受众。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:GraphEndpointResourceId, GraphResourceId

参数集

Name
Position:18
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-GraphEndpoint

指定 Graph(Active Directory 元数据)请求的 URL。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:Graph, GraphUrl

参数集

Name
Position:9
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ManagementPortalUrl

指定管理门户的 URL。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:3
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-MicrosoftGraphEndpointResourceId

Microsoft Graph 的资源标识符

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-MicrosoftGraphUrl

Microsoft图形 URL

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Name

指定要修改的环境的名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-PublishSettingsFileUrl

指定可从中下载 .publishsettings 文件的 URL。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:1
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ResourceManagerEndpoint

指定 Azure 资源管理器请求的 URL。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:ResourceManager, ResourceManagerUrl

参数集

Name
Position:6
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Scope

确定上下文更改的范围,例如,更改仅适用于当前进程,还是应用于此用户启动的所有会话。

参数属性

类型:ContextModificationScope
默认值:None
接受的值:Process, CurrentUser
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ServiceEndpoint

指定服务管理 (RDFE) 请求的终结点。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:ServiceManagement, ServiceManagementUrl

参数集

Name
Position:2
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-SqlDatabaseDnsSuffix

指定 Azure SQL 数据库服务器的域名后缀。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:13
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-SshAuthScope

通过 SSH 连接到 Azure VM 时进行身份验证的范围。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-StorageEndpoint

指定存储(blob、表、队列和文件)访问的终结点。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False
别名:StorageEndpointSuffix

参数集

(All)
Position:4
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-TrafficManagerDnsSuffix

指定 Azure 流量管理器服务的域名后缀。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

Name
Position:12
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

String

SwitchParameter

输出

PSAzureEnvironment