我們通過遵循Microsoft Azure的文檔在天青雲中創建Azure堆棧。如何在天藍色的雲中創建天藍色的堆棧
我們停留在這個文件建立:https://docs.microsoft.com/en-us/azure/azure-stack/azure-stack-policy-module
在這個標題:將策略應用到
$resourceGroupName = ‘myRG01’
$s = Select-AzureRmSubscription -SubscriptionName "<Azure Subscription Name>"
$policy = New-AzureRmPolicyDefinition -Name AzureStackPolicyDefinition -Policy (**Get-AzureStackRmPolicy**)
New-AzureRmPolicyAssignment -Name AzureStack -PolicyDefinition $policy -Scope /subscriptions/$subscriptionID/resourceGroups/$rgName
,當我們在上面我們得到以下mwntioned錯誤PowerShell腳本運行的資源組:
Get-AzureStackRmPolicy : The term 'Get-AzureStackRmPolicy' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:81
+ ... ion -Name AzureStackPolicyDefinition -Policy (Get-AzureStackRmPolicy)
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureStackRmPolicy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
您是否導入模塊? – Itchydon
Azure Stack在您的「數據中心」中託管Azure服務,而不是在公有云中託管。 Azure協議棧策略僅用於限制Azure協議棧可以使用的服務。你有Azure Stack環境嗎? – Mihir
a。可以[在Azure中安裝Azure堆棧](https://azurestack.blog/2017/07/deploy-azure-stack-development-kit-on-an-azure-vm/)。灣這不是安裝Azure Stack文章。 C。你安裝了Azure Stack powershell模塊嗎? – 4c74356b41