我正在使用 ADAL 身份验证设置 azure 函数,但 pulumi 存在一个问题,因为函数应用程序需要创建广告应用程序,然后广告应用程序需要创建函数应用程序才能设置回复 url。
const adAppName = `${projectName}-${env}`
const adApp = new azuread.Application(adAppName, {
name: adAppName,
requiredResourceAccesses: [
{
resourceAccesses: [
{
id: "311a71cc-e848-46a1-bdf8-97ff7156d8e6",
type: "Scope",
},
],
resourceAppId: "00000002-0000-0000-c000-000000000000",
}
],
replyUrls: [ 'https://myapp.azurewebsites.net/.auth/login/aad/callback' ] // This url is hardcoded
});
const appFunctionName = `${projectName}-${env}`;
const appFunction = new azure.appservice.FunctionApp(appFunctionName, {
...resourceGroupArgs,
name: appFunctionName,
appServicePlanId: appServicePlan.id,
authSettings: {
enabled: true,
unauthenticatedClientAction: 'RedirectToLoginPage',
defaultProvider: 'AzureActiveDirectory',
issuer: `https://sts.windows.net/${azure.config.tenantId}/`,
activeDirectory: {
clientId: adApp.applicationId
}
},
storageConnectionString: storageAccount.primaryConnectionString,
version: '~2',
appSettings: appSettings,
});
我们如何解决这种循环引用?我想用 appFunction url 的值创建replyUrls。
谢谢