简体   繁体   English

如何在无人值守的情况下找回用户名和密码 Azure Function

[英]How to retrieve UserName and Password in unattended Azure Function

I have a runbook that is currently executed via a webhook call in order to execute some powershell code on a site.我有一个当前通过 webhook 调用执行的运行手册,以便在站点上执行一些 powershell 代码。 This is been working great.这一直很好用。

I have been instructed to convert this code to an Azure function. No big deal, right?我被指示将此代码转换为 Azure function。没什么大不了的,对吧? Well.... I was able to get it set up without too much trouble - I created it in VS Studio and then deployed to Azure. The problem is that in the code I need to log in and my username and password are hard-coded in the script.好吧....我能够毫不费力地设置它 - 我在 VS Studio 中创建它然后部署到 Azure。问题是在代码中我需要登录并且我的用户名和密码很难 -在脚本中编码。 When I had run this in the runbook I called a Credential stored in the Automation account but that does not seem to be an option here.当我在 runbook 中运行它时,我调用了一个存储在自动化帐户中的凭据,但这似乎不是这里的一个选项。

I have seen other people ask the same question and the answer is often "application settings", which of course is not protected.我见过其他人问过同样的问题,答案通常是“应用程序设置”,这当然不受保护。
This is to run unattended so I (obviously) can't ask for credentials.这是在无人值守的情况下运行,所以我(显然)不能要求提供凭据。 I am running PowerShell 7.我正在运行 PowerShell 7。

Any help would be greatly appreciated.任何帮助将不胜感激。

You can use Key vault references with Azure Function App to access secrets.您可以将密钥保管库引用与 Azure Function 应用程序一起使用来访问机密。 You can protect your secrets stored in Key vault using RBAC .您可以使用 RBAC保护存储在 Key vault 中的机密。 Azure function app also provides integration with AAD where you can use Identity instead of secrets. Azure function 应用程序还提供与 AAD 的集成,您可以在其中使用身份而不是密码。 Additionally you can go through this document regarding more information on securing Azure Functions.此外,您可以 go 通过此文档了解有关保护 Azure 功能的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Azure Active Directory 验证用户名/密码 - Validate username/password from Azure Active Directory 如何允许用户名/密码和电子邮件/密码登录? - How to allow username/password and email/password login? Azure AD 认证,带用户名和密码,也有 MFA - Azure AD authentication with Username and Password and also have MFA Pulumi:如何从 Azure 中的 Function 应用程序中检索 function 名称? - Pulumi: How can I retrieve function names from a Function App in Azure? 如何找回早期版本的 AWS SSM 密码? - How to retrieve earlier version of AWS SSM password? 从 Angular 获取没有客户端密码的 Azure AD 访问令牌,Power BI 的用户名/密码 - Get Azure AD access token without client secret, username/password for Power BI from Angular 您能否通过 web 请求使用用户名和密码而不使用 client_id 获得 Azure 的访问令牌? - Can you get an access token for Azure with a username and password and without using a client_id via web request? 如何使用 api 密钥或用户名密码访问 GMail API? - How to access GMail APIs using api key or username password? 如何获取 azure 机器人密码 - How to get the azure bot password 如何使用无人值守的控制台应用程序读取交换 email - How to read exchange email with unattended console app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM