C# 定义要在Pulumi中使用的Azure订阅
我使用以下(标准)-Pulumi-代码创建一个简单的资源:C# 定义要在Pulumi中使用的Azure订阅,c#,azure,pulumi,C#,Azure,Pulumi,我使用以下(标准)-Pulumi-代码创建一个简单的资源: public MyStack() { var current = Output.Create(GetSubscription.InvokeAsync()); this.CurrentSubscriptionDisplayName = current.Apply(current => current.DisplayName); // Create an Azure R
public MyStack()
{
var current = Output.Create(GetSubscription.InvokeAsync());
this.CurrentSubscriptionDisplayName = current.Apply(current => current.DisplayName);
// Create an Azure Resource Group
var resourceGroup = new ResourceGroup("dingdongdiehexisttot"); // TODO: Conf
// Create an Azure Storage Account
var storageAccount = new Account("storage", new AccountArgs
{
ResourceGroupName = resourceGroup.Name,
AccountReplicationType = "LRS",
AccountTier = "Standard"
});
// Export the connection string for the storage account
this.ConnectionString = storageAccount.PrimaryConnectionString;
}
403失败,因为它是在订阅中创建的,不允许在订阅中创建资源。我有多个订阅,希望定义要使用的订阅。我可以使用“GetSubscription”检索当前订阅,但没有找到任何方法来实际设置要使用的订阅
如何定义要使用的订阅
(在运行pulumi之前,我使用az登录成功登录)这里有几个选项:
az帐户集--订阅订阅
ARM\u SUBSCRIPTION\u ID
az帐户集--订阅订阅
ARM\u SUBSCRIPTION\u ID