PowerShell ile Azure Stack hub 'ına bağlanmaConnect to Azure Stack Hub with PowerShell
Teklif, plan, kota ve uyarı oluşturma gibi kaynakları yönetmek için PowerShell 'i kullanmak üzere Azure Stack hub 'ı yapılandırabilirsiniz.You can configure Azure Stack Hub to use PowerShell to manage resources like creating offers, plans, quotas, and alerts. Bu konu, işleç ortamını yapılandırmanıza yardımcı olur.This topic helps you configure the operator environment.
ÖnkoşullarPrerequisites
VPN aracılığıyla asdk 'ye bağlıysanız, Azure Stack geliştirme seti (asdk) veya Windows tabanlı bir dış istemciden aşağıdaki önkoşulları çalıştırın.Run the following prerequisites either from the Azure Stack Development Kit (ASDK) or from a Windows-based external client if you're connected to the ASDK through VPN.
- Azure Stack hub ile uyumlu Azure PowerShell modülleri'ni yükler.Install Azure Stack Hub-compatible Azure PowerShell modules.
- Azure Stack hub ile çalışmak için gereken araçlarıindirin.Download the tools required to work with Azure Stack Hub.
Azure AD 'ye bağlanmaConnect with Azure AD
PowerShell ile Azure Stack hub işleç ortamını yapılandırmak için aşağıdaki komut dosyalarından birini çalıştırın.To configure the Azure Stack Hub operator environment with PowerShell, run one of the scripts below. Azure Active Directory (Azure AD) tenantName ve Azure Resource Manager Endpoint değerlerini kendi ortam yapılandırmanızla değiştirin.Replace the Azure Active Directory (Azure AD) tenantName and Azure Resource Manager endpoint values with your own environment configuration.
Not
Oturumunuzun süresi dolarsa parolanız değiştirilmiştir veya yalnızca hesapları değiştirmek istiyorsanız Connect-AzAccount komutunu kullanarak oturum açmadan önce aşağıdaki cmdlet 'i çalıştırın: Remove-AzAccount -Scope Process
If your session expires, your password has changed, or you simply wish to switch accounts, run the following cmdlet before you sign in using Connect-AzAccount: Remove-AzAccount -Scope Process
# Register an Azure Resource Manager environment that targets your Azure Stack Hub instance. Get your Azure Resource Manager endpoint value from your service provider.
Add-AzEnvironment -Name "AzureStackAdmin" -ArmEndpoint "https://adminmanagement.local.azurestack.external" `
-AzureKeyVaultDnsSuffix adminvault.local.azurestack.external `
-AzureKeyVaultServiceEndpointResourceId https://adminvault.local.azurestack.external
# Set your tenant name.
$AuthEndpoint = (Get-AzEnvironment -Name "AzureStackAdmin").ActiveDirectoryAuthority.TrimEnd('/')
$AADTenantName = "<myDirectoryTenantName>.onmicrosoft.com"
$TenantId = (invoke-restmethod "$($AuthEndpoint)/$($AADTenantName)/.well-known/openid-configuration").issuer.TrimEnd('/').Split('/')[-1]
# After signing in to your environment, Azure Stack Hub cmdlets
# can be easily targeted at your Azure Stack Hub instance.
Connect-AzAccount -EnvironmentName "AzureStackAdmin" -TenantId $TenantId
AD FS bağlanmaConnect with AD FS
Azure Active Directory Federasyon Hizmetleri (Azure AD FS) ile PowerShell ile Azure Stack hub işleci ortamına bağlanın.Connect to the Azure Stack Hub operator environment with PowerShell with Azure Active Directory Federated Services (Azure AD FS). ASDK için, bu Azure Resource Manager uç noktası olarak ayarlanır https://adminmanagement.local.azurestack.external
.For the ASDK, this Azure Resource Manager endpoint is set to https://adminmanagement.local.azurestack.external
. Azure Stack hub ile tümleşik sistemler için Azure Resource Manager uç noktası almak üzere hizmet sağlayıcınıza başvurun.To get the Azure Resource Manager endpoint for Azure Stack Hub integrated systems, contact your service provider.
# Register an Azure Resource Manager environment that targets your Azure Stack Hub instance. Get your Azure Resource Manager endpoint value from your service provider.
Add-AzEnvironment -Name "AzureStackAdmin" -ArmEndpoint "https://adminmanagement.local.azurestack.external" `
-AzureKeyVaultDnsSuffix adminvault.local.azurestack.external `
-AzureKeyVaultServiceEndpointResourceId https://adminvault.local.azurestack.external
# Sign in to your environment.
Connect-AzAccount -EnvironmentName "AzureStackAdmin"
Not
AD FS yalnızca Kullanıcı kimlikleriyle etkileşimli kimlik doğrulamasını destekler.AD FS only supports interactive authentication with user identities. Bir kimlik bilgisi nesnesi gerekliyse, bir hizmet sorumlusu (SPN) kullanmanız gerekir.If a credential object is required, you must use a service principal (SPN). Azure Stack hub ve AD FS kimlik yönetimi hizmetiniz olarak bir hizmet sorumlusu ayarlama hakkında daha fazla bilgi için bkz. AD FS uygulama kimliğini yönetme.For more information on setting up a service principal with Azure Stack Hub and AD FS as your identity management service, see Manage an AD FS app identity.
Bağlantıyı test etmeTest the connectivity
Her şeyin hazır olduğuna göre, Azure Stack hub içinde kaynak oluşturmak için PowerShell 'i kullanın.Now that you've got everything set-up, use PowerShell to create resources within Azure Stack Hub. Örneğin, bir uygulama için bir kaynak grubu oluşturabilir ve sanal makine ekleyebilirsiniz.For example, you can create a resource group for an app and add a virtual machine. Myresourcegroup adlı bir kaynak grubu oluşturmak için aşağıdaki komutu kullanın.Use the following command to create a resource group named MyResourceGroup.
New-AzResourceGroup -Name "MyResourceGroup" -Location "Local"
Sonraki adımlarNext steps
- Azure Stack hub 'da abonelikleri, planları ve teklifleri yönetmek için PowerShell 'i kullanmaUse PowerShell to manage subscriptions, plans, and offers in Azure Stack Hub
- Azure Stack Hub için şablonlar geliştirin.Develop templates for Azure Stack Hub.
- Şablonları PowerShell Ile dağıtın.Deploy templates with PowerShell.
- Azure Stack hub modülü başvurusu.Azure Stack Hub Module Reference.