<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>laleh</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/laleh/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/laleh/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:09:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Call secure azure hosted API from SharePoint online</title>
      <link>https://docs.microsoft.com/archive/blogs/laleh/85</link>
      <pubDate>Tue, 20 Dec 2016 13:04:41 GMT</pubDate>
      <dc:creator><![CDATA[Laleh Akbarynoor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/laleh/?p=85</guid>
      <description><![CDATA[The goal of this post is to provide steps to call the azure hosted API from SharePoint online using...]]></description>
      <content:encoded><![CDATA[The goal of this post is to provide steps to call the azure hosted API from SharePoint online using JavaScript and the ADAL.js library, no signing-prompt, everything should be handled in the script using ADAL.js to authenticate secure API

<strong>Configuration Azure API </strong>
<ol>
 	<li>Create azure API , You can read about<span></span><a href="https://azure.microsoft.com/en-us/documentation/articles/app-service-api-apps-why-best-platform/">Azure API apps here</a><span> and follow a good <em>Getting </em>started <a href="https://azure.microsoft.com/en-us/documentation/articles/app-service-api-dotnet-get-started/">tutorial here</a>.  </span></li>
 	<li>Publish your azure API in azure, check the API</li>
 	<li>Browse to azure portal, select your API application , select <strong>Authentication/Authorizations</strong></li>
</ol>
<ul>
 	<li>Set the App Service <strong>Authentication: On</strong></li>
 	<li>Action to take when request us not authenticated: <strong>Log in with Azure dictionary</strong></li>
 	<li>Authentication providers: <strong>Express</strong></li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2016/12/15.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/15-300x97.jpg" alt="1" width="555" height="180" class="alignnone wp-image-95" /></a>

&nbsp;
<ol start="4">
 	<li>Now the API is protected with Azure AD, if you navigate your API via browser you will be prompted for login</li>
 	<li>When we set authentication in Express mode, the app will be created automatically in Azure Active directory, you can see the name under Azure AD app</li>
 	<li>Brows to Azure management portal, click on <strong>active directory</strong> in left navigation<a href="https://msdnshared.blob.core.windows.net/media/2016/12/25.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/25-300x71.jpg" alt="2" width="515" height="122" class="alignnone wp-image-105" /></a></li>
 	<li>Click on the Directory which will be federated to your office 365 (or any source you want to call azure API which uses the same azure active directory as your configured for you API authentication)</li>
 	<li>Click on the Application, and you will find you AD app in the list which has been created with Express method as we discussed om step nr.3</li>
 	<li>Now we need to create new app in AAD which will be our communication channel from office 365 to Azure API, Click on ADD on footer</li>
 	<li>Enter name and select “<strong>W</strong><strong>EB APPLICATION AND/OR WEB AP</strong>” option</li>
 	<li>For <strong>Sign in URL</strong> enter your SharePoint online Url which you are planning to call Azure API from</li>
 	<li>For <strong>APP ID URL</strong>, enter unique Url, this will be used as a unique logical identifier for your app.</li>
 	<li>After the app created, click on Configure, copy the <strong>Client ID</strong> which will be used later­­</li>
 	<li>Under <strong>Permission to other applications</strong>, Click “<strong>Add Application</strong>”, on the next page select “<strong>All Apps” </strong>and select you Azure API app which you double checked in step nr.8, and confirm</li>
 	<li>You will be redirected back to Configure page, <strong>Under Permission to other applications</strong>, now you see your azure API app is listed here, click on <strong>delegated permission</strong>, select the access to app</li>
 	<li>At the bottom of the page, click <strong>Manage manifest &gt; Download manifest</strong>.</li>
 	<li>Download the file to a location where you can edit it.</li>
 	<li>In the downloaded manifest file, search for the <strong>oauth2AllowImplicitFlow</strong> Change the value of this property from <strong>false</strong>to <strong>true</strong>, and then save the file.</li>
 	<li>Click <strong>Manage manifest &gt; Upload manifest</strong>, and upload the file that you updated in the preceding step.</li>
 	<li>Azure management portal, select setting and copy your AAD subscription ID for related AAD</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2016/12/35.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/35-300x131.jpg" alt="3" width="350" height="153" class="alignnone wp-image-115" /></a><!--more-->

<strong>Call Azure API from SharePoint Online</strong>

Once the above steps have been done, you can call azure API from sharePoint online  which is using same Active directory above
<ol>
 	<li>Edit the page and add Script Editor web part</li>
 	<li>Add following script
<ul>
 	<li>subscriptionId, see step nr.20</li>
 	<li>clientId see step nr.13</li>
</ul>
</li>
</ol>
&nbsp;

&nbsp;

&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;

&lt;script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.13/js/adal.min.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;

function CallAzureAPI() {

"use strict";

var subscriptionId = "xxxxxxxxxxxxxxxxxxxxxxxxxx";

var clientId = "xxxxxxxxxxxxxxx";

&nbsp;

window.config = {

subscriptionId: subscriptionId,

clientId: clientId,

postLogoutRedirectUri: window.location.origin,

endpoints: {

AzureApiUri: 'https://xxxxxx.azurewebsites.net'

},

cacheLocation: 'localStorage' // enable this for IE, as sessionStorage does not work for localhost.

};

var authContext = new AuthenticationContext(config);

// Check For &amp; Handle Redirect From AAD After Login

var isCallback = authContext.isCallback(window.location.hash);

authContext.handleWindowCallback();

if (isCallback &amp;&amp; !authContext.getLoginError()) {

window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST);

}

// If not logged in force login

var user = authContext.getCachedUser();

if (user) {

// Logged in already

console.log(user);

}

else {

// NOTE: you may want to render the page for anonymous users and render

// a login button which runs the login function upon click.

authContext.login();

}

// Acquire token for Files resource.

authContext.acquireToken(config.endpoints. AzureApiUri, function (error, token) {

// Handle ADAL Errors.

if (error || !token) {

console.log('ADAL error occurred: ' + error);

return;

}

var ApiUri = "https://xxx.azurewebsites.net/api/GET";

$.ajax({

type: "GET",

url: ApiUri,

headers: {

'Authorization': 'Bearer ' + token,

}

}).done(function (response) {

console.log('Successfully called API.');

console.log(response);

&nbsp;

}).fail(function () {

console.log('Calling API failed.');

&nbsp;

});

});

}

&lt;/script&gt;

&lt;input type='button' value='Call Azure API' onclick=" CallAzureAPI ();"/&gt;]]></content:encoded>
    </item>
    <item>
      <title>Azure subscription in Azure Resource manager</title>
      <link>https://docs.microsoft.com/archive/blogs/laleh/azure-resource-manager</link>
      <pubDate>Mon, 29 Aug 2016 20:02:51 GMT</pubDate>
      <dc:creator><![CDATA[Laleh Akbarynoor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/laleh/?p=75</guid>
      <description><![CDATA[If you used to use Azure in classic mode you might get confused about powershell commands in azure...]]></description>
      <content:encoded><![CDATA[If you used to use Azure in classic mode you might get confused about powershell commands in azure resource manager in order to be select your azure subscription  follow these commands
<pre>PS C:\&gt; Get-AzureRmSubscription –SubscriptionName "your subscription" | Select-AzureRmSubscription

normally remember most of classic model commands will follow with rm and end of the verbs.

read more about it 
https://azure.microsoft.com/en-us/documentation/articles/resource-manager-deployment-model/</pre>]]></content:encoded>
    </item>
    <item>
      <title>workflow failed with Unauthorized error</title>
      <link>https://docs.microsoft.com/archive/blogs/laleh/workflow-failed-with-unauthorized-error</link>
      <pubDate>Tue, 13 Jan 2015 02:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Laleh Akbarynoor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/laleh/2015/01/13/workflow-failed-with-unauthorized-error/</guid>
      <description><![CDATA[&nbsp;when workflow failed ro start with this error :
Retrying last request. Next attempt scheduled...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;when workflow failed ro start with this error :</p>
<p>Retrying last request. Next attempt scheduled in less than one minute. Details <br />of last request: HTTP Unauthorized to <br />https://sitename/_vti_bin/client.svc/web/lists/getbyid(guid'guid') Correlation <br />Id: id Instance Id: id<br /><br />&nbsp;uls :</p>
<p>01/12/2015 19:21:04.06 w3wp.exe (NLAMSPSHWF001:0x2B80) 0x2778 SharePoint Foundation Claims Authentication ae0tc High The registered mappered failed to resolve to one identity claim. Exception: System.Runtime.InteropServices.COMException (0x800703FA): Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa Illegal operation attempted on a registry key that has been marked for deletion. (Exception from HRESULT: 0x800703FA).&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.Library.SPRequest..ctor()&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, SPAppPrincipalToken appPrincipalToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.Administration.SPFarm.get_RequestAny()&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPSecurity.GetCurrentUserTokenNoApplicationPrincipalDelegated(SPWebApplication webApp, Uri siteUrl)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPSecurity.GetCurrentUserToken()&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPSecurity.EnsureOriginatingUserToken()&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.Office.Server.Security.UserProfileIdentityClaimMapper.GetMappedIdentityClaim(Uri context, IEnumerable`1 identityClaims)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.IdentityModel.SPIdentityClaimMapperOperations.GetClaimFromExternalMapper(Uri contextUri, List`1 claims) 324f82b4-5cee-fea5-86a9-368c6e129213</p>
<p>&nbsp;solution:</p>
<p><strong></strong>&nbsp;first make sure the STS ApplicationPool identity has full control on UPA.</p>
<ul>
<li>In InetMgr, go to advanced settings for Security Token Service Application Pool</li>
<li>change "Load User Profile" to true.</li>
<li>Recycle application pool</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Get-spfarmconfig has misleading value</title>
      <link>https://docs.microsoft.com/archive/blogs/laleh/get-spfarmconfig-has-misleading-value</link>
      <pubDate>Wed, 24 Sep 2014 06:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Laleh Akbarynoor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/laleh/2014/09/24/get-spfarmconfig-has-misleading-value/</guid>
      <description><![CDATA[You may notice if you run Get-spfarmconfig you will receive&nbsp; following...]]></description>
      <content:encoded><![CDATA[<p>You may notice if you run <strong>Get-spfarmconfig </strong>you will receive&nbsp; following output<strong><em>&nbsp;</em></strong>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/0844.setfarm.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/0844.setfarm.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/0844.setfarm.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/0844.setfarm.png" alt="" width="340" height="138" border="0" /></a></p>
<p><strong></strong>&nbsp;</p>
<p>you can change the value of <strong>WorkflowBatchSize </strong>via <strong>set-spfarmconfig</strong></p>
<p>&nbsp;And then if you try to run the equivalent command in stsadm (<strong><em>stsadm -o getproperty -pn workflow-eventdelivery-batchsize)</em> </strong>you will notice there is no actual change in WorkflowBatchSize by "set-spfarmconfig"</p>
<p>This is a known issue and one of the properties returned by get-spfarmconfig in powershell is the <strong>WorkflowBatchSize</strong> property. However,The value of this property is not actually the workflow batch size, it is the <strong>work item batch size</strong>.Changing this property will change the work item batch size, and have no effect on the workflow batch size.</p>
<p>As&nbsp;workaround to change the workflow batch size,the stsadm command below has to be used: <br /><br /><strong>stsadm.exe -o setproperty -propertyname workflow-eventdelivery-batchsize -propertyvalue &lt;value&gt;</strong></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 workflow troublehsooting</title>
      <link>https://docs.microsoft.com/archive/blogs/laleh/sharepoint-2013-workflow-troublehsooting</link>
      <pubDate>Wed, 03 Sep 2014 06:40:00 GMT</pubDate>
      <dc:creator><![CDATA[Laleh Akbarynoor]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/laleh/2014/09/03/sharepoint-2013-workflow-troublehsooting/</guid>
      <description><![CDATA[If you are using workflow manger in sharepoint 2013 you might face different issues&nbsp; which you...]]></description>
      <content:encoded><![CDATA[<p>If you are using workflow manger in sharepoint 2013 you might face different issues&nbsp; which you are not sure either the issue is comming form workflow manger or sharepoint , by following troubleshooting check list you might find at least the area you need to focus more</p>
<p>&nbsp;</p>
<p><em><strong>check list in workflow manager server&nbsp; :</strong></em><br />1.&nbsp;Check <a href="https://[wfms]:12290">https://[wfms]:12290</a> or <a href="https://[wfms]:12291">https://[wfms]:12291</a> if they are responding<br />2.&nbsp;Check &rdquo;WorkflowMgmtPool&rdquo; is started <br />3.&nbsp;Following services are running</p>
<ul>
<li>Workflow Manager Backend</li>
<li>Service Bus Message Broker</li>
<li>Service Bus Gateway</li>
<li>Windows Fabric Host Service (FabricHostSvc)</li>
</ul>
<p><br />4.&nbsp;Get workflow farm information ,&nbsp;workflow database &nbsp;by&nbsp; Start Workflow Manager PowerShell <br />&bull;&nbsp;get-WFfarm<br />&nbsp;<br />5.&nbsp;Check if the Workflow Manager farm running(workflow service backend and&nbsp; front end should be rennin)&nbsp; by&nbsp; Start Workflow Manager PowerShell<br />&bull;&nbsp;get-WFfarmStatus</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/0218.1.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/0218.1.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/0218.1.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/0218.1.PNG" alt="" width="396" height="124" border="0" /></a><br />&nbsp;<br />6.&nbsp;Check oAut in accessible by https:// [wfms]:12291/$SYSTEM/$Metadata/json/1</p>
<p>7.&nbsp;Restart the WorkflowServiceBackend service</p>
<ul>
<li>net stop WorkflowServiceBackend</li>
<li>net start WorkflowServiceBackend</li>
</ul>
<p>&nbsp;</p>
<p>If all is fine then time to focus on sharepoint :)</p>
<p><em><strong>check list SharePoint server :</strong></em></p>
<p>1.&nbsp;check if you are at least in version March PU 2013 <br />2.&nbsp;Check &ldquo;workflow service application&rdquo; started <br />3.&nbsp;Check , workflow service application &ldquo;workflow is connected&rdquo;<br />4.&nbsp;Check &ldquo;User Profile Service&rdquo; <br />5.&nbsp;Check &ldquo;App Management Service&rdquo; is started<br />6.&nbsp;Check <a href="https://[FQDN]:12290">https://[FQDN]:12290</a> or <a href="https://[FQDN]:12291">https://[FQDN]:12291</a> if they are responding<br />7.&nbsp;Check <a href="https://[sp13server]/Lists/Workflow">https://[myserver]/Lists/Workflow</a> History for error message<br />8.&nbsp;Check in SharePoint designer if you see workflow 2013 option</p>
<p><br />&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/2816.1.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/2816.1.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/2816.1.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/2816.1.PNG" alt="" width="364" height="246" border="0" /></a></p>
<p>&nbsp;</p>
<p>9.&nbsp;Try to register workflow manager <br />Register-SPWorkflowService &ndash;SPSite "<a href="https://myserver/mysitecollection">https://myserver/mysitecollection</a>" &ndash;WorkflowHostUri "<a href="https://workflow.example.com:12290">https://workflow.example.com:12290</a>"&nbsp; &ndash;force</p>
<p><br />10.&nbsp;Each server in the SharePoint Server 2013 farm must have the Workflow Manager Client installed.<br />11.&nbsp;Make sure workflow initiator is not a system account<br />12.&nbsp;workflow initiator must have a user profile<br />13.&nbsp;Check following " Microsoft.SharePoint.WorkflowServices.Activities.dll" version are sync with each other</p>
<ul>
<li>&nbsp;C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowServices.Activities\v4.0_15.0.0.0__71e9bce111e9429c&nbsp;  Will be installed with Developer tools</li>
<li>&nbsp;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\WorkflowActivities  Will be installed with SharePoint</li>
<li>&nbsp;Database "WFResourceManagementDB", table "Scopes", path "SharePoint "check the default workflow configuration xml&nbsp; file&nbsp;</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/4784.1.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/4784.1.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/14/4784.1.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-14/4784.1.PNG" alt="" width="327" height="106" border="0" /></a><br />&nbsp;14.&nbsp;We recommend to have all SharePoint and workflow manager (Office developer tools&nbsp; in development environment ) sync and have in latest version</p>
<p>&nbsp;</p>
<p>Hope it helps :)</p>]]></content:encoded>
    </item>
  </channel>
</rss>