Ez a szakasz végigvezeti a parancssori felület beállításán, ha az Azure AD-t használja Identity Management szolgáltatásként, és a CLI-t használja a Windows rendszerű gépen.This section walks you through setting up CLI if you're using Azure AD as your identity management service, and are using CLI on a Windows machine.
Kapcsolódás Azure Stack hubhozConnect to Azure Stack Hub
Ha a ASDK használja, akkor bízza a Azure Stack hub HITELESÍTÉSSZOLGÁLTATÓI főtanúsítványát.If you are using the ASDK, trust the Azure Stack Hub CA root certificate. Útmutatásért lásd: a tanúsítvány megbízhatósága.For instruction, see Trust the certificate.
Regisztrálja Azure Stack hub-környezetét a az cloud register
parancs futtatásával.Register your Azure Stack Hub environment by running the az cloud register
command.
Regisztrálja a környezetét.Register your environment. A következő paraméterek használata a futtatásakor az cloud register
:Use the following parameters when running az cloud register
:
ÉrtékValue |
PéldaExample |
LeírásDescription |
Környezet neveEnvironment name |
AzureStackUserAzureStackUser |
AzureStackUser A felhasználói környezethez használható.Use AzureStackUser for the user environment. Ha az operátor van megadva, akkor a ( AzureStackAdmin ) lehetőséget.If you're operator, specify AzureStackAdmin . |
Resource Manager-végpontResource Manager endpoint |
https://management.contoso.onmicrosoft.com |
A ASDK található ResourceManagerUrl : https://management.local.azurestack.external/ az integrált rendszerek ResourceManagerUrl : https://management.<region>.<fqdn>/ Ha kérdése van az integrált rendszervégponttal kapcsolatban, forduljon a felhő üzemeltetőjéhez.The ResourceManagerUrl in the ASDK is: https://management.local.azurestack.external/ The ResourceManagerUrl in integrated systems is: https://management.<region>.<fqdn>/ If you have a question about the integrated system endpoint, contact your cloud operator. |
Tárolási végpontStorage endpoint |
local.contoso.onmicrosoft.comlocal.contoso.onmicrosoft.com |
local.azurestack.external a ASDK.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
Kulcstartó utótagjaKeyvault suffix |
. vault.contoso.onmicrosoft.com.vault.contoso.onmicrosoft.com |
.vault.local.azurestack.external a ASDK..vault.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
Végpont Active Directory Graph erőforrás-azonosítójaEndpoint active directory graph resource ID |
https://graph.windows.net/ |
Az Active Directory erőforrás-azonosító.The Active Directory resource ID. |
az cloud register `
-n <environmentname> `
--endpoint-resource-manager "https://management.<region>.<fqdn>" `
--suffix-storage-endpoint "<fqdn>" `
--suffix-keyvault-dns ".vault.<fqdn>" `
--endpoint-active-directory-graph-resource-id "https://graph.windows.net/"
Az Azure CLI dokumentációjában talál egy hivatkozást a Register parancshoz .You can find a reference for the register command in the Azure CLI reference documentation.
Állítsa be az aktív környezetet az alábbi parancsok használatával.Set the active environment by using the following commands.
az cloud set -n <environmentname>
Frissítse környezeti konfigurációját az Azure Stack Hub-specifikus API-verzió profiljának használatára.Update your environment configuration to use the Azure Stack Hub specific API version profile. A konfiguráció frissítéséhez futtassa a következő parancsot:To update the configuration, run the following command:
az cloud update --profile 2019-03-01-hybrid
Jelentkezzen be az Azure Stack hub-környezetbe a az login
paranccsal.Sign in to your Azure Stack Hub environment by using the az login
command.
A felhasználó hitelesítő adataival vagy a felhőalapú szolgáltató által megadott egyszerű szolgáltatásnév (SPN) használatával bejelentkezhet az Azure stack hub környezetbe.You can sign in to the Azure Stack Hub environment using your user credentials, or with a service principal (SPN) provided to you by your cloud operator.
Bejelentkezés felhasználóként:Sign in as a user:
Megadhatja a felhasználónevet és a jelszót közvetlenül a az login
parancson belül, vagy egy böngészőben végezheti el a hitelesítést.You can either specify the username and password directly within the az login
command, or authenticate by using a browser. Ha a fiókjában engedélyezve van a többtényezős hitelesítés, az utóbbit el kell végeznie:You must do the latter if your account has multi-factor authentication enabled:
az login -u "user@contoso.onmicrosoft.com" -p 'Password123!' --tenant contoso.onmicrosoft.com
Megjegyzés
Ha a felhasználói fiókja engedélyezte a többtényezős hitelesítést, a az login
paraméter megadása nélkül használja a parancsot -u
.If your user account has multi-factor authentication enabled, use the az login
command without providing the -u
parameter. A parancs futtatásával egy URL-címet és egy kódot kell használnia a hitelesítéshez.Running this command gives you a URL and a code that you must use to authenticate.
Bejelentkezés egyszerű szolgáltatásként:Sign in as a service principal:
A bejelentkezés előtt hozzon létre egy egyszerű szolgáltatásnevet a Azure Portal vagy a parancssori felület használatával, és rendeljen hozzá egy szerepkört.Before you sign in, create a service principal through the Azure portal or CLI and assign it a role. Most jelentkezzen be a következő parancs használatával:Now, sign in by using the following command:
az login `
--tenant <Azure Active Directory Tenant name. `
For example: myazurestack.onmicrosoft.com> `
--service-principal `
-u <Application Id of the Service Principal> `
-p <Key generated for the Service Principal>
Ellenőrizze, hogy a környezet helyesen van-e beállítva, és hogy a környezet az aktív felhő.Verify that your environment is set correctly and that your environment is the active cloud.
az cloud list --output table
Látnia kell, hogy a környezete fel van sorolva, és a IsActive true
.You should see that your environment is listed and IsActive is true
. Például:For example:
IsActive Name Profile
---------- ----------------- -----------------
False AzureCloud 2019-03-01-hybrid
False AzureChinaCloud latest
False AzureUSGovernment latest
False AzureGermanCloud latest
True AzureStackUser 2019-03-01-hybrid
Kapcsolat teszteléseTest the connectivity
Minden beállításnál a CLI használatával hozhat létre erőforrásokat Azure Stack hub-on belül.With everything set up, use CLI to create resources within Azure Stack Hub. Létrehozhat például egy erőforráscsoportot egy alkalmazáshoz, és hozzáadhat egy virtuális gépet.For example, you can create a resource group for an app and add a VM. A következő parancs használatával hozzon létre egy "MyResourceGroup" nevű erőforráscsoportot:Use the following command to create a resource group named "MyResourceGroup":
az group create -n MyResourceGroup -l local
Ha az erőforráscsoport sikeresen létrejött, az előző parancs kimenete az újonnan létrehozott erőforrás következő tulajdonságait eredményezi:If the resource group is created successfully, the previous command outputs the following properties of the newly created resource:

Ez a szakasz végigvezeti a parancssori felület beállításán, ha Active Directory összevont szolgáltatásokat (AD FS) használja az Identitáskezelő szolgáltatásként, és a parancssori felületet használja a Windows rendszerű gépen.This section walks you through setting up CLI if you're using Active Directory Federated Services (AD FS) as your identity management service, and are using CLI on a Windows machine.
Kapcsolódás Azure Stack hubhozConnect to Azure Stack Hub
Ha a ASDK használja, akkor bízza a Azure Stack hub HITELESÍTÉSSZOLGÁLTATÓI főtanúsítványát.If you are using the ASDK, trust the Azure Stack Hub CA root certificate. Útmutatásért lásd: a tanúsítvány megbízhatósága.For instruction, see Trust the certificate.
Regisztrálja Azure Stack hub-környezetét a az cloud register
parancs futtatásával.Register your Azure Stack Hub environment by running the az cloud register
command.
Regisztrálja a környezetét.Register your environment. A következő paraméterek használata a futtatásakor az cloud register
:Use the following parameters when running az cloud register
:
ÉrtékValue |
PéldaExample |
LeírásDescription |
Környezet neveEnvironment name |
AzureStackUserAzureStackUser |
AzureStackUser A felhasználói környezethez használható.Use AzureStackUser for the user environment. Ha az operátor van megadva, akkor a ( AzureStackAdmin ) lehetőséget.If you're operator, specify AzureStackAdmin . |
Resource Manager-végpontResource Manager endpoint |
https://management.local.azurestack.external |
A ASDK található ResourceManagerUrl : https://management.local.azurestack.external/ az integrált rendszerek ResourceManagerUrl : https://management.<region>.<fqdn>/ Ha kérdése van az integrált rendszervégponttal kapcsolatban, forduljon a felhő üzemeltetőjéhez.The ResourceManagerUrl in the ASDK is: https://management.local.azurestack.external/ The ResourceManagerUrl in integrated systems is: https://management.<region>.<fqdn>/ If you have a question about the integrated system endpoint, contact your cloud operator. |
Tárolási végpontStorage endpoint |
helyi. azurestack. externallocal.azurestack.external |
local.azurestack.external a ASDK.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
Kulcstartó utótagjaKeyvault suffix |
. Vault. local. azurestack. external.vault.local.azurestack.external |
.vault.local.azurestack.external a ASDK..vault.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
VM-rendszerkép aliasa doc-végpont –VM image alias doc endpoint- |
https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json |
A virtuális gép rendszerképének aliasait tartalmazó dokumentum URI azonosítója.URI of the document, which contains VM image aliases. További információ: a virtuálisgép-alias végpontjának beállítása.For more info, see Set up the virtual machine alias endpoint. |
az cloud register -n <environmentname> --endpoint-resource-manager "https://management.local.azurestack.external" --suffix-storage-endpoint "local.azurestack.external" --suffix-keyvault-dns ".vault.local.azurestack.external" --endpoint-vm-image-alias-doc <URI of the document which contains VM image aliases>
Állítsa be az aktív környezetet az alábbi parancsok használatával.Set the active environment by using the following commands.
az cloud set -n <environmentname>
Frissítse környezeti konfigurációját az Azure Stack Hub-specifikus API-verzió profiljának használatára.Update your environment configuration to use the Azure Stack Hub specific API version profile. A konfiguráció frissítéséhez futtassa a következő parancsot:To update the configuration, run the following command:
az cloud update --profile 2019-03-01-hybrid
Megjegyzés
Ha a 1808-es verzió előtt futtatja Azure Stack hub verzióját, akkor az API-verzió Profile 2019-03-01-Hybrid helyett a 2017-03-09-profil API- profilt kell használnia.If you're running a version of Azure Stack Hub before the 1808 build, you must use the API version profile 2017-03-09-profile rather than the API version profile 2019-03-01-hybrid. Az Azure CLI legújabb verzióját is használni kell.You also need to use a recent version of the Azure CLI.
Jelentkezzen be az Azure Stack hub-környezetbe a az login
paranccsal.Sign in to your Azure Stack Hub environment by using the az login
command. Bejelentkezhet a Azure Stack hub-környezetbe felhasználóként vagy egyszerű szolgáltatásnévként.You can sign in to the Azure Stack Hub environment either as a user or as a service principal.
Bejelentkezés felhasználóként:Sign in as a user:
Megadhatja a felhasználónevet és a jelszót közvetlenül a az login
parancson belül, vagy egy böngészőben végezheti el a hitelesítést.You can either specify the username and password directly within the az login
command, or authenticate by using a browser. Ha a fiókjában engedélyezve van a többtényezős hitelesítés, az utóbbit el kell végeznie:You must do the latter if your account has multi-factor authentication enabled:
az cloud register -n <environmentname> --endpoint-resource-manager "https://management.local.azurestack.external" --suffix-storage-endpoint "local.azurestack.external" --suffix-keyvault-dns ".vault.local.azurestack.external" --endpoint-vm-image-alias-doc <URI of the document which contains VM image aliases> --profile "2019-03-01-hybrid"
Megjegyzés
Ha a felhasználói fiókja engedélyezte a többtényezős hitelesítést, a az login
paraméter megadása nélkül használja a parancsot -u
.If your user account has multi-factor authentication enabled, use the az login
command without providing the -u
parameter. A parancs futtatásával egy URL-címet és egy kódot kell használnia a hitelesítéshez.Running this command gives you a URL and a code that you must use to authenticate.
Bejelentkezés egyszerű szolgáltatásként:Sign in as a service principal:
Készítse elő a. PEM-fájlt, amelyet a szolgáltatás egyszerű bejelentkezéséhez kíván használni.Prepare the .pem file to be used for service principal login.
A rendszerbiztonsági tag létrehozására szolgáló ügyfélszámítógépen exportálja az egyszerű szolgáltatás tanúsítványát pfx-ként a következő helyen található titkos kulccsal cert:\CurrentUser\My
.On the client machine where the principal was created, export the service principal certificate as a pfx with the private key located at cert:\CurrentUser\My
. A tanúsítvány neve megegyezik a rendszerbiztonsági tag nevével.The cert name has the same name as the principal.
Alakítsa át a pfx-t PEM-ra (használja az OpenSSL segédprogramot).Convert the pfx to pem (use the OpenSSL utility).
Jelentkezzen be a CLI-be:Sign in to the CLI:
az login --service-principal \
-u <Client ID from the Service Principal details> \
-p <Certificate's fully qualified name, such as, C:\certs\spn.pem>
--tenant <Tenant ID> \
--debug
Kapcsolat teszteléseTest the connectivity
Minden beállításnál a CLI használatával hozhat létre erőforrásokat Azure Stack hub-on belül.With everything set up, use CLI to create resources within Azure Stack Hub. Létrehozhat például egy erőforráscsoportot egy alkalmazáshoz, és hozzáadhat egy virtuális gépet.For example, you can create a resource group for an app and add a VM. A következő parancs használatával hozzon létre egy "MyResourceGroup" nevű erőforráscsoportot:Use the following command to create a resource group named "MyResourceGroup":
az group create -n MyResourceGroup -l local
Ha az erőforráscsoport sikeresen létrejött, az előző parancs kimenete az újonnan létrehozott erőforrás következő tulajdonságait eredményezi:If the resource group is created successfully, the previous command outputs the following properties of the newly created resource:

Ez a szakasz végigvezeti a parancssori felület beállításán, ha az Azure AD-t használja Identity Management szolgáltatásként, és egy Linux rendszerű számítógépen használja a CLI-t.This section walks you through setting up CLI if you're using Azure AD as your identity management service, and are using CLI on a Linux machine.
Kapcsolódás Azure Stack hubhozConnect to Azure Stack Hub
A következő lépésekkel csatlakozhat Azure Stack hubhoz:Use the following steps to connect to Azure Stack Hub:
Ha a ASDK használja, akkor bízza a Azure Stack hub HITELESÍTÉSSZOLGÁLTATÓI főtanúsítványát.If you are using the ASDK, trust the Azure Stack Hub CA root certificate. Útmutatásért lásd: a tanúsítvány megbízhatósága.For instruction, see Trust the certificate.
Regisztrálja Azure Stack hub-környezetét a az cloud register
parancs futtatásával.Register your Azure Stack Hub environment by running the az cloud register
command.
Regisztrálja a környezetét.Register your environment. A következő paraméterek használata a futtatásakor az cloud register
:Use the following parameters when running az cloud register
:
ÉrtékValue |
PéldaExample |
LeírásDescription |
Környezet neveEnvironment name |
AzureStackUserAzureStackUser |
AzureStackUser A felhasználói környezethez használható.Use AzureStackUser for the user environment. Ha az operátor van megadva, akkor a ( AzureStackAdmin ) lehetőséget.If you're operator, specify AzureStackAdmin . |
Resource Manager-végpontResource Manager endpoint |
https://management.local.azurestack.external |
A ASDK található ResourceManagerUrl : https://management.local.azurestack.external/ az integrált rendszerek ResourceManagerUrl : https://management.<region>.<fqdn>/ Ha kérdése van az integrált rendszervégponttal kapcsolatban, forduljon a felhő üzemeltetőjéhez.The ResourceManagerUrl in the ASDK is: https://management.local.azurestack.external/ The ResourceManagerUrl in integrated systems is: https://management.<region>.<fqdn>/ If you have a question about the integrated system endpoint, contact your cloud operator. |
Tárolási végpontStorage endpoint |
helyi. azurestack. externallocal.azurestack.external |
local.azurestack.external a ASDK.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
Kulcstartó utótagjaKeyvault suffix |
. Vault. local. azurestack. external.vault.local.azurestack.external |
.vault.local.azurestack.external a ASDK..vault.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
VM-rendszerkép aliasa doc-végpont –VM image alias doc endpoint- |
https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json |
A virtuális gép rendszerképének aliasait tartalmazó dokumentum URI azonosítója.URI of the document, which contains VM image aliases. További információ: a virtuálisgép-alias végpontjának beállítása.For more info, see Set up the virtual machine alias endpoint. |
az cloud register -n <environmentname> --endpoint-resource-manager "https://management.local.azurestack.external" --suffix-storage-endpoint "local.azurestack.external" --suffix-keyvault-dns ".vault.local.azurestack.external" --endpoint-vm-image-alias-doc <URI of the document which contains VM image aliases>
Állítsa be az aktív környezetet.Set the active environment.
az cloud set -n <environmentname>
Frissítse környezeti konfigurációját az Azure Stack Hub-specifikus API-verzió profiljának használatára.Update your environment configuration to use the Azure Stack Hub specific API version profile. A konfiguráció frissítéséhez futtassa a következő parancsot:To update the configuration, run the following command:
az cloud update --profile 2019-03-01-hybrid
Megjegyzés
Ha a 1808-es verzió előtt futtatja Azure Stack hub verzióját, akkor az API-verzió Profile 2019-03-01-Hybrid helyett a 2017-03-09-profil API- profilt kell használnia.If you're running a version of Azure Stack Hub before the 1808 build, you must use the API version profile 2017-03-09-profile rather than the API version profile 2019-03-01-hybrid. Az Azure CLI legújabb verzióját is használni kell.You also need to use a recent version of the Azure CLI.
Jelentkezzen be az Azure Stack hub-környezetbe a az login
paranccsal.Sign in to your Azure Stack Hub environment by using the az login
command. Bejelentkezhet a Azure Stack hub-környezetbe felhasználóként vagy egyszerű szolgáltatásnévként.You can sign in to the Azure Stack Hub environment either as a user or as a service principal.
Bejelentkezés felhasználóként:Sign in as a user:
Megadhatja a felhasználónevet és a jelszót közvetlenül a az login
parancson belül, vagy egy böngészőben végezheti el a hitelesítést.You can either specify the username and password directly within the az login
command, or authenticate by using a browser. Ha a fiókjában engedélyezve van a többtényezős hitelesítés, az utóbbit el kell végeznie:You must do the latter if your account has multi-factor authentication enabled:
az login \
-u <Active directory global administrator or user account. For example: username@<aadtenant>.onmicrosoft.com> \
--tenant <Azure Active Directory Tenant name. For example: myazurestack.onmicrosoft.com>
Megjegyzés
Ha a felhasználói fiókjában engedélyezve van a többtényezős hitelesítés, a az login
parancsot a paraméter megadása nélkül is használhatja -u
.If your user account has multi-factor authentication enabled, you can use the az login
command without providing the -u
parameter. A parancs futtatásával egy URL-címet és egy kódot kell használnia a hitelesítéshez.Running this command gives you a URL and a code that you must use to authenticate.
Bejelentkezés egyszerű szolgáltatáskéntSign in as a service principal
A bejelentkezés előtt hozzon létre egy egyszerű szolgáltatásnevet a Azure Portal vagy a parancssori felület használatával, és rendeljen hozzá egy szerepkört.Before you sign in, create a service principal through the Azure portal or CLI and assign it a role. Most jelentkezzen be a következő parancs használatával:Now, sign in by using the following command:
az login \
--tenant <Azure Active Directory Tenant name. For example: myazurestack.onmicrosoft.com> \
--service-principal \
-u <Application Id of the Service Principal> \
-p <Key generated for the Service Principal>
Kapcsolat teszteléseTest the connectivity
Minden beállításnál a CLI használatával hozhat létre erőforrásokat Azure Stack hub-on belül.With everything set up, use CLI to create resources within Azure Stack Hub. Létrehozhat például egy erőforráscsoportot egy alkalmazáshoz, és hozzáadhat egy virtuális gépet.For example, you can create a resource group for an app and add a VM. A következő parancs használatával hozzon létre egy "MyResourceGroup" nevű erőforráscsoportot:Use the following command to create a resource group named "MyResourceGroup":
az group create -n MyResourceGroup -l local
Ha az erőforráscsoport sikeresen létrejött, az előző parancs kimenete az újonnan létrehozott erőforrás következő tulajdonságait eredményezi:If the resource group is created successfully, the previous command outputs the following properties of the newly created resource:

Ez a szakasz végigvezeti a parancssori felület beállításán, ha Active Directory összevont szolgáltatásokat (AD FS) használja felügyeleti szolgáltatásként, és a CLI-t használja egy Linux rendszerű gépen.This section walks you through setting up CLI if you're using Active Directory Federated Services (AD FS) as your management service, and are using CLI on a Linux machine.
Kapcsolódás Azure Stack hubhozConnect to Azure Stack Hub
A következő lépésekkel csatlakozhat Azure Stack hubhoz:Use the following steps to connect to Azure Stack Hub:
Ha a ASDK használja, akkor bízza a Azure Stack hub HITELESÍTÉSSZOLGÁLTATÓI főtanúsítványát.If you are using the ASDK, trust the Azure Stack Hub CA root certificate. Útmutatásért lásd: a tanúsítvány megbízhatósága.For instruction, see Trust the certificate.
Regisztrálja Azure Stack hub-környezetét a az cloud register
parancs futtatásával.Register your Azure Stack Hub environment by running the az cloud register
command.
Regisztrálja a környezetét.Register your environment. A futtatásakor használja a következő paramétereket az cloud register
.Use the following parameters when running az cloud register
.
ÉrtékValue |
PéldaExample |
LeírásDescription |
Környezet neveEnvironment name |
AzureStackUserAzureStackUser |
AzureStackUser A felhasználói környezethez használható.Use AzureStackUser for the user environment. Ha az operátor van megadva, akkor a ( AzureStackAdmin ) lehetőséget.If you're operator, specify AzureStackAdmin . |
Resource Manager-végpontResource Manager endpoint |
https://management.local.azurestack.external |
A ASDK található ResourceManagerUrl : https://management.local.azurestack.external/ az integrált rendszerek ResourceManagerUrl : https://management.<region>.<fqdn>/ Ha kérdése van az integrált rendszervégponttal kapcsolatban, forduljon a felhő üzemeltetőjéhez.The ResourceManagerUrl in the ASDK is: https://management.local.azurestack.external/ The ResourceManagerUrl in integrated systems is: https://management.<region>.<fqdn>/ If you have a question about the integrated system endpoint, contact your cloud operator. |
Tárolási végpontStorage endpoint |
helyi. azurestack. externallocal.azurestack.external |
local.azurestack.external a ASDK.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
Kulcstartó utótagjaKeyvault suffix |
. Vault. local. azurestack. external.vault.local.azurestack.external |
.vault.local.azurestack.external a ASDK..vault.local.azurestack.external is for the ASDK. Integrált rendszer esetén használjon végpontot a rendszer számára.For an integrated system, use an endpoint for your system. |
VM-rendszerkép aliasa doc-végpont –VM image alias doc endpoint- |
https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json |
A virtuális gép rendszerképének aliasait tartalmazó dokumentum URI azonosítója.URI of the document, which contains VM image aliases. További információ: a virtuálisgép-alias végpontjának beállítása.For more info, see Set up the virtual machine alias endpoint. |
az cloud register -n <environmentname> --endpoint-resource-manager "https://management.local.azurestack.external" --suffix-storage-endpoint "local.azurestack.external" --suffix-keyvault-dns ".vault.local.azurestack.external" --endpoint-vm-image-alias-doc <URI of the document which contains VM image aliases>
Állítsa be az aktív környezetet.Set the active environment.
az cloud set -n <environmentname>
Frissítse környezeti konfigurációját az Azure Stack Hub-specifikus API-verzió profiljának használatára.Update your environment configuration to use the Azure Stack Hub specific API version profile. A konfiguráció frissítéséhez futtassa a következő parancsot:To update the configuration, run the following command:
az cloud update --profile 2019-03-01-hybrid
Megjegyzés
Ha a 1808-es verzió előtt futtatja Azure Stack hub verzióját, akkor az API-verzió Profile 2019-03-01-Hybrid helyett a 2017-03-09-profil API- profilt kell használnia.If you're running a version of Azure Stack Hub before the 1808 build, you must use the API version profile 2017-03-09-profile rather than the API version profile 2019-03-01-hybrid. Az Azure CLI legújabb verzióját is használni kell.You also need to use a recent version of the Azure CLI.
Jelentkezzen be az Azure Stack hub-környezetbe a az login
paranccsal.Sign in to your Azure Stack Hub environment by using the az login
command. Bejelentkezhet a Azure Stack hub-környezetbe felhasználóként vagy egyszerű szolgáltatásnévként.You can sign in to the Azure Stack Hub environment either as a user or as a service principal.
bejelentkezés:Sign in:
- Felhasználóként egy, az eszköz kódját használó webböngésző használatával:As a user using a web browser with a device code:
az login --use-device-code
Megjegyzés
A parancs futtatásával egy URL-címet és egy kódot kell használnia a hitelesítéshez.Running the command gives you a URL and a code that you must use to authenticate.
Egyszerű szolgáltatásnév:As a service principal:
Készítse elő a. PEM-fájlt, amelyet a szolgáltatás egyszerű bejelentkezéséhez kíván használni.Prepare the .pem file to be used for service principal login.
A rendszerbiztonsági tag létrehozására szolgáló ügyfélszámítógépen exportálja az egyszerű szolgáltatás tanúsítványát pfx-ként a következő helyen található titkos kulccsal cert:\CurrentUser\My
.On the client machine where the principal was created, export the service principal certificate as a pfx with the private key located at cert:\CurrentUser\My
. A tanúsítvány neve megegyezik a rendszerbiztonsági tag nevével.The cert name has the same name as the principal.
Alakítsa át a pfx-t PEM-ra (használja az OpenSSL segédprogramot).Convert the pfx to pem (use the OpenSSL utility).
Jelentkezzen be a CLI-be:Sign in to the CLI:
az login --service-principal \
-u <Client ID from the Service Principal details> \
-p <Certificate's fully qualified name, such as, C:\certs\spn.pem>
--tenant <Tenant ID> \
--debug
Kapcsolat teszteléseTest the connectivity
Minden beállításnál a CLI használatával hozhat létre erőforrásokat Azure Stack hub-on belül.With everything set up, use CLI to create resources within Azure Stack Hub. Létrehozhat például egy erőforráscsoportot egy alkalmazáshoz, és hozzáadhat egy virtuális gépet.For example, you can create a resource group for an app and add a VM. A következő parancs használatával hozzon létre egy "MyResourceGroup" nevű erőforráscsoportot:Use the following command to create a resource group named "MyResourceGroup":
az group create -n MyResourceGroup -l local
Ha az erőforráscsoport sikeresen létrejött, az előző parancs kimenete az újonnan létrehozott erőforrás következő tulajdonságait eredményezi:If the resource group is created successfully, the previous command outputs the following properties of the newly created resource:

Ismert problémákKnown issues
Ismert problémák léptek fel a CLI Azure Stack hub-ban való használatakor:There are known issues when using CLI in Azure Stack Hub:
- A CLI interaktív mód.The CLI interactive mode. A parancs például az
az interactive
Azure stack hub még nem támogatja.For example, the az interactive
command, isn't yet supported in Azure Stack Hub.
- Azure Stack hub-ban elérhető virtuálisgép-rendszerképek listájának lekéréséhez használja a parancsot a parancs
az vm image list --all
helyett az vm image list
.To get the list of VM images available in Azure Stack Hub, use the az vm image list --all
command instead of the az vm image list
command. A beállítás megadásával --all
biztosíthatja, hogy a válasz csak az Azure stack hub-környezetben elérhető lemezképeket adja vissza.Specifying the --all
option ensures that the response returns only the images that are available in your Azure Stack Hub environment.
- Előfordulhat, hogy az Azure-ban elérhető virtuálisgép-rendszerkép-aliasok nem alkalmazhatók Azure Stack hubhoz.VM image aliases that are available in Azure may not be applicable to Azure Stack Hub. Virtuálisgép-lemezképek használata esetén a rendszerkép aliasa helyett a teljes URN paramétert (Canonical: UbuntuServer: 14.04.3-LTS: 1.0.0) kell használnia.When using VM images, you must use the entire URN parameter (Canonical:UbuntuServer:14.04.3-LTS:1.0.0) instead of the image alias. Ennek az URN-nek meg kell egyeznie a parancsból származtatott rendszerkép-specifikációkkal
az vm images list
.This URN must match the image specifications as derived from the az vm images list
command.