1

我已经安装了最新的 Pulumi azuread 模块,当我尝试 pulumi 预览时出现此错误:

Previewing update (int):

     Type                          Name                Plan     Info
     pulumi:pulumi:Stack           test-int
     └─ azuread:index:Application  test                         1 error

Diagnostics:
  azuread:index:Application (test):
    error: Error obtaining Authorization Token from the Azure CLI: Error waiting for the Azure CLI: exit status 1

我的 index.ts 非常基础:

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as azuread from "@pulumi/azuread";

const projectName = pulumi.getProject();
const stack = pulumi.getStack();
const config = new pulumi.Config(projectName);

const baseName = `${projectName}-${stack}`;

const testRg = new azure.core.ResourceGroup(baseName, {
    name: baseName
});


const test = new azuread.Application("test", {
    availableToOtherTenants: false,
    homepage: "https://homepage",
    identifierUris: ["https://uri"],
    oauth2AllowImplicitFlow: true,
    replyUrls: ["https://replyurl"],
    type: "webapp/api",
});

使用旧模块 azure.ad 创建资源和 AD 应用程序可以正常工作。

我不知道我现在错过了什么......

编辑:

index.ts 旧方法

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const projectName = pulumi.getProject();
const stack = pulumi.getStack();
const config = new pulumi.Config(projectName);

const baseName = `${projectName}-${stack}`;

const testRg = new azure.core.ResourceGroup(baseName, {
    name: baseName
});

const test = new azure.ad.Application("test", {
    homepage: "https://homepage",
    availableToOtherTenants: false,
    identifierUris: ["https://uri"],
    oauth2AllowImplicitFlow: true,
    replyUrls: ["https://replyurl"]
});

pulumi 预览结果:

Previewing update (int):                                                                                                                                                                   

     Type                     Name                Plan       Info                                                                                                                          
     pulumi:pulumi:Stack      test-int                                                                                                                                           
 +   └─ azure:ad:Application  test                create     1 warning                                                                                                                     

Diagnostics:                                                                                                                                                                               
  azure:ad:Application (test):                                                                                                                                                             
    warning: urn:pulumi:int::test::azure:ad/application:Application::test verification warning: The Azure Active Directory resources have been split out into their own Provider.

    Information on migrating to the new AzureAD Provider can be found here: https://terraform.io/docs/providers/azurerm/guides/migrating-to-azuread.html                                   

    As such the Azure Active Directory resources within the AzureRM Provider are now deprecated and will be removed in v2.0 of the AzureRM Provider.                                       

Resources:                                                                                                                                                                                 
    + 1 to create                                                                                                                                                                          
    2 unchanged                                                                                                                                                                            

编辑2:

我在 Windows 10 上运行它:

  • az cli = 2.0.68
  • pulumi cli = 0.17.22
  • @pulumi/天蓝色 = 0.19.2
  • @pulumi/azuread = 0.18.2
  • @pulumi/pulumi = 0.17.21

以下是我对 Azure Active Directory Graph 的主要权限: 在此处输入图像描述

以及 Microsoft Graph 的权限: 在此处输入图像描述

4

1 回答 1

1

我遇到了这个问题,几个小时后我意识到 Fiddler 以某种方式干扰了 Az CLI 的运行

于 2020-07-06T17:26:25.087 回答