小编Ste*_*fan的帖子

从二头肌循环中调用的模块获取输出

如何从循环中调用的模块中检索输出变量?我喜欢在下一步中将子网添加到 vnet。

主二头肌

module vnet01 'vNet.bicep' = [ for vnet in vnets :  { 
        name: vnet.name
        scope:  virtualNetworkRg
        params: { 
          vnetName: vnet.name
          vnetAddressPrefix: vnet.vnetAddressPrefix
          location: location
        }
      }]
Run Code Online (Sandbox Code Playgroud)

vNet.二头肌

param ...

resource vnet 'Microsoft.Network/virtualNetworks@2021-08-01' = {
  name: vnetName
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        vnetAddressPrefix
      ]
    }
  }
}

//Output
output id string = vnet.id
Run Code Online (Sandbox Code Playgroud)

azure azure-resource-manager azure-bicep

6
推荐指数
1
解决办法
2150
查看次数

从 Microsoft Identity Client 1 更新到 2,7 后的问题

var scope = AzureAdB2COptions.ApiScopes.Split(' ');
    string signedInUserID = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
    TokenCache userTokenCache = new MSALSessionCache(signedInUserID, this.HttpContext).GetMsalCacheInstance();
    ConfidentialClientApplication cca = new ConfidentialClientApplication(AzureAdB2COptions.ClientId, AzureAdB2COptions.Authority, AzureAdB2COptions.RedirectUri, new ClientCredential(AzureAdB2COptions.ClientSecret), userTokenCache, null);

    AuthenticationResult result = await cca.AcquireTokenSilentAsync(scope, cca.Users.FirstOrDefault(), AzureAdB2COptions.Authority, false);

    HttpClient client = new HttpClient();
    HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, AzureAdB2COptions.ApiUrl);

    // Add token to the Authorization header and make the request
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
    HttpResponseMessage response = await client.SendAsync(request);
Run Code Online (Sandbox Code Playgroud)

使用 Microsoft Identity Client 1.0,示例代码运行完美。更新到 Microsoft Identity Client 2.7 后,我出现了两个错误

ClientApplicationBase.Users' 已过时:'使用 GetAccountsAsync 代替(参见 …

c# asp.net azure-ad-msal

3
推荐指数
1
解决办法
2651
查看次数

JS字段渲染返回标准字段渲染

如何返回字段的标准渲染?

(function () {

    var readonlyFiledContext = {};
    readonlyFiledContext.Templates = {};
    readonlyFiledContext.Templates.Fields = {
        // Apply the new rendering for Age field on Edit forms
        "Title": {
            "EditForm": FieldTemplate
        }
    };

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(FiledContext);

})();

function FieldTemplate(ctx) {

     return ;
    }
}
Run Code Online (Sandbox Code Playgroud)

这取决于我要呈现字段的值。当该值不为null时,将其设为fancy;当该值等于“ null”时,则像标准渲染一样进行渲染。如何在此代码段中返回标准字段呈现?

感谢您的帮助Stefan

javascript sharepoint jslink

1
推荐指数
1
解决办法
7243
查看次数