列出所有使用PowerShell | Azure Cloud Shell的Azure区域欢迎您~

在这篇文章中,我将向您展示如何使用PowerShell列出所有Azure区域。您还可以使用Azure Cloud Shell欢迎您~获取所有Azure区域的列表以及物理位置和地理组的详细信息。

每一个Azure地理包含一个或多个区域,满足特定的数据驻留和遵从性要求。从Azure门户中,很难列出所有的Azure区域,这就是PowerShell有用的地方。

Azure中的大多数配置都可以通过Azure Portal完成。但是,在某些情况下,使用PowerShell命令可以使您的任务更容易。值得庆幸的是,PowerShell自动化是通过Azure门户

PatchMyPC HorizontalAD
修补我的电脑赞助广告

要使用PowerShell管理Azure,首先必须安装Azure PowerShell模块.有不同的方法来安装Azure PowerShell模块。你可以选择下面列出的任何方法:

  1. 来自WebPI的Azure PowerShell.下载Azure PowerShell并开始安装。
  2. 使用PowerShell Gallery
  3. 从GitHub下载MSI安装程序

PowerShell Cmdlet

Get-AzLocation cmdlet获取每个位置的所有位置和受支持的资源提供程序。当你运行Get-AzLocation命令,将得到包含以下信息的输出。

  • 供应商
  • 位置
  • DisplayName
  • 类型
  • 经度
  • 纬度
  • PhysicalLocation
  • RegionType
  • RegionCategory
  • GeographyGroup
  • PairedRegion

Get-AzLocation cmdlet支持以下参数:

  • -ExtendedLocation
  • -DefaultProfile
  • -ApiVersion

使用PowerShell列出所有Azure区域

让我们看看使用PowerShell列出所有Azure区域的步骤。假设您已经安装了用于PowerShell的Azure模块,在计算机上启动PowerShell并运行以下命令。

Login-AzAccount

输入上述命令后,将出现Microsoft Azure登录窗口,要求您输入凭据以登录Azure。

你也可以使用Connect-AzAccount使用经过身份验证的帐户连接到Azure,用于Az PowerShell模块中的cmdlet。

输入连接Azure的电子邮件和密码,并登录Azure帐户。

连接到Azure
连接到Azure

在PowerShell窗口中运行以下to命令获取所有Azure区域。

select displayname,location
使用PowerShell列出所有Azure区域
使用PowerShell列出所有Azure区域

列出所有使用Cloud Shell的Azure区域欢迎您~

通过连接到Azure Cloud Shell,欢迎您~可以运行一个简单的PowerShell命令来列出所有Azure区域。从Azure门户连接到欢迎您~云壳

连接到Azure Cloud Sh欢迎您~ell
连接到Azure Cloud Sh欢迎您~ell

等待连接到云外壳成功。欢迎您~

请求云shell。成功。欢迎您~连接终端……MOTD:自定义您的体验:保存您的配置文件到$HOME/。配置/PowerShell VERBOSE:验证到Azure…详细:构建您的Azure驱动器…
连接到Azure Cloud Sh欢迎您~ell
连接到Azure Cloud Sh欢迎您~ell

在Cloud Shell中运行以下to命令获取所有Azure区域欢迎您~。

select displayname,location
列出所有使用Cloud Shell的Azure区域欢迎您~
列出所有使用Cloud Shell的Azure区域欢迎您~

命令输出现在显示DisplayName而且位置所有的Azure区域。

列出所有使用Cloud Shell的Azure区域欢迎您~
列出所有使用Cloud Shell的Azure区域欢迎您~

获取特定区域中的所有Azure服务

当您希望查看特定区域中的所有服务时,下面的命令非常有用。

$providers = Get-AzLocation | Where-Object{$_。位置-eq "eastus2"} | select Providers $providers.Providers
获取特定区域中的所有Azure服务
获取特定区域中的所有Azure服务
微软。DevTestLab微软。微软广告。OperationalInsights微软。微软安全。微软网络。计算微软。微软存储。ClassicCompute微软。OperationsManagement微软。ManagedIdentity微软。aadiam微软。AnalysisServices微软。ApiManagement微软。微软的应用程序。AppConfiguration微软。AppPlatform微软。微软认证。Automanage微软。自动化微软。AVS微软。AzureArcData Microsoft.AzureCIS Microsoft.AzureData Microsoft.AzureSphere Microsoft.AzureSphereGen2 Microsoft.AzureStackHCI Microsoft.BackupSolutions Microsoft.BareMetalInfrastructure Microsoft.Batch Microsoft.Cache Microsoft.Cdn Microsoft.Chaos Microsoft.ClassicInfrastructureMigrate Microsoft.ClassicNetwork Microsoft.ClassicStorage Microsoft.CloudTest Microsoft.CognitiveServices Microsoft.Confluent Microsoft.ContainerInstance Microsoft.ContainerRegistry Microsoft.ContainerService Microsoft.D365CustomerInsights Microsoft.Dashboard Microsoft.Databricks Microsoft.DataCollaboration Microsoft.DataFactory Microsoft.DataLakeAnalytics Microsoft.DataLakeStore Microsoft.DataMigration Microsoft.DataProtection Microsoft.DataShare Microsoft.DBforMariaDB Microsoft.DBforMySQL Microsoft.DBforPostgreSQL Microsoft.DelegatedNetwork Microsoft.DeploymentManager Microsoft.DesktopVirtualization Microsoft.Devices Microsoft.DeviceUpdate Microsoft.DevOps Microsoft.DigitalTwins Microsoft.DocumentDB Microsoft.Elastic Microsoft.EventGrid Microsoft.EventHub Microsoft.ExtendedLocation Microsoft.Fidalgo Microsoft.HanaOnAzure Microsoft.HardwareSecurityModules Microsoft.HDInsight Microsoft.HealthBot Microsoft.HealthcareApis Microsoft.HybridCompute Microsoft.HybridConnectivity Microsoft.ImportExport microsoft.insights Microsoft.IoTCentral Microsoft.IoTSecurity Microsoft.KeyVault Microsoft.Kubernetes Microsoft.KubernetesConfiguration Microsoft.Kusto Microsoft.LabServices Microsoft.LoadTestService Microsoft.Logic Microsoft.MachineLearning Microsoft.MachineLearningServices Microsoft.Maintenance Microsoft.Maps Microsoft.Media Microsoft.Migrate Microsoft.MixedReality Microsoft.Monitor Microsoft.NetApp Microsoft.NetworkFunction Microsoft.NotificationHubs Microsoft.OpenLogisticsPlatform Microsoft.Peering Microsoft.PlayFab Microsoft.Portal Microsoft.PowerBI Microsoft.PowerBIDedicated Microsoft.Purview Microsoft.RecoveryServices Microsoft.RedHatOpenShift Microsoft.Relay Microsoft.Resources Microsoft.Search Microsoft.SecurityDetonation Microsoft.SerialConsole Microsoft.ServiceBus Microsoft.ServiceFabric Microsoft.ServiceFabricMesh Microsoft.ServiceLinker Microsoft.ServicesHub Microsoft.SignalRService Microsoft.Singularity Microsoft.Solutions Microsoft.Sql Microsoft.SqlVirtualMachine Microsoft.StorageCache Microsoft.StoragePool Microsoft.StorageSync Microsoft.StreamAnalytics microsoft.support Microsoft.Synapse Microsoft.TimeSeriesInsights Microsoft.VideoIndexer Microsoft.VirtualMachineImages microsoft.visualstudio Microsoft.Web Microsoft.Workloads NGINX.NGINXPLUS Wandisco.Fusion

留下回复

你的电邮地址将不会公布。必填字段已标记