- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个 Azure Function(托管在应用服务计划中),它将枚举我的订阅中的 Assets 并使用它们执行某些操作。
我的网站设置方式符合我的预期,但每次登录-AzureRmAccount 都会出错,并发出通知
Login-AzureRmAccount : No certificate was found in the certificate store with thumbprint xxxxxxxx
以下是一些相关内容:
首先我创建证书:
$cert = New-SelfSignedCertificate -CertStoreLocation cert:\currentuser\my -Subject "cn=$appCommonName" ...etc...
$keyValue = [System.Convert]::ToBase64String($cert.GetRawCertData())
$aNewApp = New-AzureRmADApplication -DisplayName $AzureADApplicationName -HomePage $AppHomePage -IdentifierUris $appIDUri -CertValue $keyValue -EndDate $cert.NotAfter -StartDate $cert.NotBefore
#export the cert for use future upload to Azure
$password = ConvertTo-SecureString -String "supersecrettpassword" -Force -AsPlainText
Export-PfxCertificate -Cert $cert -FilePath "Export-cert.pfx" -Password $password
Export-Certificate -Type CERT -Cert $cert -FilePath "Export-cert.cer"
后来我配置我的服务主体并授予其读取权限
$theSvcPrincipal = New-AzureRmADServicePrincipal -ApplicationId $ApplicationId
$testRole = Get-AzureRmRoleAssignment -RoleDefinitionName Reader -ServicePrincipalName $ApplicationId
通过 ARM 部署的魔力,我最终在托管 azure 功能的网站中获得了两个应用程序设置:WEBSITE_LOAD_CERTIFICATES
值为 * 和 CertThumbprint
值为我上传的证书的指纹 SSL certificates
区域。
最后,部署ARM模板后,我按照this Stack Overflow post中的说明上传证书。
考虑到所有准备工作,我希望这能在我的函数中发挥作用:
Login-AzureRmAccount -ServicePrincipal -CertificateThumbprint $env:CertThumbprint -ApplicationId $env:ApplicationId -TenantId $env:TenantId
但是当该行执行时,尽管我在网站上有一个具有匹配指纹的证书,但我得到 no cert found wiht matching thumbprint
错误。
最佳答案
好吧,这有点尴尬。事实证明,我用来配置应用服务的 ARM 模板使用的是动态 sku:
"properties": {
"name": "[parameters('hostingPlanName')]",
"computeMode": "Dynamic",
"sku": "Dynamic"
}
而不是标准 sku:
"sku": {
"name": "B1",
"tier": "Basic",
"size": "B1",
"family": "B",
"capacity": 1
},
一旦我切换了两者,我就能够访问证书存储。
我见过this issue discussed on github ,但当同事使用 Azure Web 界面预配客户端证书后能够从动态计划上托管的函数应用访问客户端证书时,驳回了该请求。我仍然无法解释他是如何做到这一点的,但我亲眼所见,并通过他的部署中的 ARM 模板来验证他是否使用基于消费的模型。
关于powershell - Azure 函数和 Powershell - 无法使用证书登录 AzureRmAccount,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42380511/
我尝试用 google 搜索此内容,但尽管搜索列表中有许多有希望的项目,但它们全部都是关于 ARM 与 ASM 或 Add-AzureRmAccount 与 Connect-AzureRmAccoun
我在 Azure PowerShell 中遇到了问题。我无法连接到 AzureRM 帐户。它显示此错误: Connect-AzureRMAccount : The term 'Connect-Azur
我在使用 Azure PS 模块时遇到问题。我已经通过 PS gallery 安装了以下内容: Install-Module AzureRM Install-Module Azure (并重新启动)
我想将 Add-AzureRmAccount 与我的 Microsoft 帐户凭据一起使用,但我不知道该怎么做。我想创建一个由 Windows 任务计划程序运行的非交互式脚本。因此,我无法使用交互式登
尝试使用 PowerShell 连接到 Azure 时出现以下错误。该帐户以前可以使用,但不确定发生了什么变化。已为组织启用多重身份验证,但应排除此帐户。这是一个组织帐户;不是微软帐户。我在网上发现了
我有一个关于 Login-AzureRmAccount cmdlet 的问题,我正在尝试解决这个问题。当我运行 Login-AzureRmAccount 并使用我的凭据进行身份验证时,凭据对象是否存储
Add-AzureRmAccount 或别名 Login-AzureRmAccount 似乎不像 Add-AzureAccount 那样在 session 之间持续存在。 有办法让它持续下去吗? 最佳
我利用 ARM 模板自动化了几个步骤来进行 Java/Tomcat 部署,但在通过证书自动登录方面没有取得成功。 我已使用 OpenSSL 为虚构域“project.company.com”创建了自签
我的 Azure 帐户有两个与之关联的目录 - 一个用于生产环境,一个用于测试环境。目前,当我运行 Login-AzureRmAccount 时,它会登录到生产订阅。是否可以在 Azure RM 端配
我正在尝试验证脚本以通过 PowerShell 连接到 Azure。 $username = "asdfasdf" $password = "asdfasdf" $secstr = New-Objec
当我尝试从 VS Code 终端登录 Azure RM 时,它只是挂起。不显示登录/密码提示。 有什么方法可以从该终端登录吗?否则,运行/调试 Azure PS 脚本会变得比应有的更加复杂:) 最佳答
我想通过 power shell 使用以下命令在 azure 中创建一个新的资源组: New-AzureRmResourceGroup - Name name -Location "WesternEu
我正在构建一个 Azure Function(托管在应用服务计划中),它将枚举我的订阅中的 Assets 并使用它们执行某些操作。 我的网站设置方式符合我的预期,但每次登录-AzureRmAccoun
我已经在 Windows server 2012 R2 上安装了 AzureRm 和 Azure 模块。我可以从此模块运行其他 cmdlet(例如,AddAzureRmAccount、Get-Azur
我正在使用 powershell 脚本登录到 azure,为此我编写了简单的命令“Login-AzureRmAccount”,并在单击按钮时将该脚本调用到 C# 代码中。它在本地工作正常,但是当我在服
我已经在我的 Ubuntu 机器上安装了 Powershell。当我在 PowerShell 中输入 Login-AzureRmAccount 时,出现如下错误: PS> Login-AzureRmA
我有一个使用 Connect-AzureAD 和 Login-AzureRmAccount 的 PowerShell 脚本。尽管两者都使用相同的凭据,但我还是被要求输入两次。有没有办法只提示用户一次并
正如标题所暗示的,我正在尝试在 Powershell 中自动执行 AzureRMAccount 的登录过程。 我搜索了我能找到的每个网站上的每个论坛,尝试了每种不同的解决方案组合(好吧,除了有效的解决
我正在尝试通过脚本以非交互方式登录我的 Azure 帐户。我只是不知道为什么会失败: $secpasswd = ConvertTo-SecureString "P@$$W0rd" -AsPlainTe
我正在尝试使用 Azure 自动化帐户系统管理身份选项关闭 VM。 但是我最终遇到了以下错误。 根据其他文章,提到升级模块 Update-ModulesInAutomationToLatestVers
我是一名优秀的程序员,十分优秀!