使用新的Pulumi azuread模块的身份验证错误

时间:2019-07-12 14:10:43

标签: azure pulumi

我已经安装了最新的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 / azure = 0.19.2
  • @ pulumi / azuread = 0.18.2
  • @ pulumi / pulumi = 0.17.21

以下是我对Azure Active Directory图的主要权限: enter image description here

以及Microsoft Graph的权限: enter image description here

1 个答案:

答案 0 :(得分:0)

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