作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Azure PowerShell 从 azure DevOps 部署 ARM 模板,如下所示。
这是订阅级别部署。我遇到以下错误。
The term 'Get-AzSubscription' 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.
Install-Module -Name Az -AllowClobber -Scope CurrentUser
Import-Module Az
$context = Get-AzSubscription -SubscriptionId xxxxxxxx
Set-AzContext $context
New-azdeployment -Name "SKL" -Location westeurope -TemplateFile .\delegatedResourceManagement.json -TemplateParameterFile .\delegatedResourceManagement.parameters.json
日志:
##[section]Starting: Azure PowerShell script: InlineScript
==============================================================================
Task : Azure PowerShell
Description : Run a PowerShell script within an Azure environment
Version : 3.153.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-powershell
==============================================================================
##[command]Import-Module -Name C:\Modules\azurerm_6.7.0\AzureRM\6.7.0\AzureRM.psd1 -Global
##[command]Clear-AzureRmContext -Scope Process
##[command]Disable-AzureRmContextAutosave -ErrorAction Stop
##[command]Add-AzureRMAccount -ServicePrincipal -Tenant *** -Credential System.Management.Automation.PSCredential -Environment AzureCloud @processScope
##[command] Select-AzureRMSubscription -SubscriptionId xxxxxxx -TenantId ***
##[command]& 'd:\a\_temp\xxxxxxd.ps1'
##[warning]User declined to install module (Az).
##[error]The specified module 'Az' was not loaded because no valid module file was found in any module directory.
##[command]Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop
##[command]Clear-AzureRmContext -Scope Process -ErrorAction Stop
##[error]The term 'Get-AzSubscription' 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.
##[section]Finishing: Azure PowerShell script: InlineScript
最佳答案
关于Azure 开发运营 : Powershell 'Get-AzSubscription' is not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57055269/
SpruceMail 是一款 SaaS 产品,可帮助公司发布赚钱的 Facebook 广告。产品的价值定位很简单:Facebook 广告是复杂的。你要折腾很多事情,可能很快几千美元就花掉了却回报
别人的成功经验抄不来,但是别人遇到的坑我们可以躲。能够躲过越多的坑离目标就越近。 别人的成功经验抄不来,但是别人遇到的坑我们可以躲。能够躲过越多的坑离目标就越近。本人虽然进入互联网行业
我是一名优秀的程序员,十分优秀!