问题描述
我希望使用计划的C#Azure函数来管理一些Azure资源.
I'm hoping to manage some Azure resources using a scheduled C# Azure Function.
当前在我制作的命令行应用程序中,我一直在使用库"Microsoft.IdentityModel.Clients.ActiveDirectory"进行令牌授权,并使用"Microsoft.Azure.Management.Compute"进行资源管理的客户端调用,如下所示
Currently in a command line application I've made, I've been using libraries 'Microsoft.IdentityModel.Clients.ActiveDirectory' for token authorization and 'Microsoft.Azure.Management.Compute' for client calls for resource management like so.
//... var credential generated my AD authentication and extending Microsoft.Rest.ServiceClientCredentials
using (var client = new ComputeManagementClient(credential)) {
client.SubscriptionId = "[SOME_SUBSCRIPTION_ID]";
client.VirtualMachines.BeginPowerOff("[RESOURCE_GROUP]", "[VM_NAME]");
}
我的管理客户端可以在不提供用户凭据或密钥秘密之类的凭据建立的情况下与Azure资源进行交互吗?
Can my management client interact with Azure resources without providing a User Credential or Key-Secret like credential establishment?
我以前的经验与AWS有关,并且诚然,这混淆了我对Azure资源管理的看法.
My previous experience is related to AWS and admittedly it has confused my view of Azure Resource Management.
我看过的较早的帖子是:启动和停止Azure虚拟机
Older posts I've looked at are: Start and Stop Azure Virtual Machine
和
是是否可以通过Azure功能停止/启动Azure ARM虚拟机?
-编辑1-
我希望基于具有各种权限的分配角色,在Lambda的AWS资源客户端中寻找类似于运行时凭证的内容.我会看一下证书.
I was hoping for something similar to run-time credentials in AWS resource clients for Lambda based on an assigned role with a variety of permissions. I will have a look at certificates though.
推荐答案
好吧,我真的不明白您希望如何在不进行身份验证的情况下进行身份验证,我想您唯一的选择就是证书?
https://azure.microsoft .com/en-us/resources/samples/active-directory-dotnet-daemon-certificate-credential/
Well, I don't really understand how do you expect to authenticate without authenticating, I guess your only option would be certificates?
https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-daemon-certificate-credential/
这篇关于Azure Function角色,例如停止Azure虚拟机的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!