Congigure logic app failure alerts using azure ARM template - azure-logic-apps

I have added the alert rule and action group manually in the Azure portal to send mail whenever it fails.
Is it possible to create these things using the Azure resource manager template?

Yes, this tutorial will help you create the alert using ARM template. You can refer to the "simplestaticmetricalert.json" and "simplestaticmetricalert.parameters.json" in this tutorial and replace the parameters in json with your parameters. Then use PowerShell or Azure CLI to deploy the template.
By the way, if you are confused about some parameters in "simplestaticmetricalert.parameters.json", you can use this command below
az monitor metrics alert show [--ids]
[--name]
[--resource-group]
[--subscription]
to show the properties of the alert you have created before for your reference when you edit the new template.

Related

How can you obtain the full URL of a HTTP triggered Logic App in the Azure Portal, if you can't use the designer?

How can you obtain the full URL of a HTTP triggered Logic App in the Azure Portal, if you can't use the designer?
Usually if I create a logic app with the HTTP trigger, after the first time I save it, the "Designer" has the full URL, including the sig, and even an option to "Copy Url", e.g.
https://prod.northeurope.logic.azure.com:443/workflows/.../paths/invoke?...&sig=xxxxxxx
But if I create a logic app in the "Code view" with multiple triggers, e.g. one for GET, one for POST, I can't switch to the "Designer".
So how can I get the full URL?
... without using e.g. PowerShell and the Az cmdlets, e.g.
Get-AzLogicAppTriggerCallbackUrl
-ResourceGroupName $(LogicAppResourceGroupName)
-Name $(LogicAppName-ProcessData)
-TriggerName "manual"
Actually Logic app http trigger endpoint URL is a sas URL with below format:
https://<request-endpoint-URI>sp=<permissions>sv=<SAS-version>sig=<signature>
And you don't have dev tool, the efficient ways are the REST API:listcallbackurl and the Az command:Get-AzLogicAppTriggerCallbackUrl.
The rest api description provides a simple way to test the API with Try it button, just log in without additional auth token generation.
Also Azure Portal provides the Azure Cloud Shell to use the PowerShell and Bash command to manage Azure resources.
If you can use the Run Trigger button and select the Run with payload buttons in the code view, you can get the full url from the pane that pops up, with a convenient button to copy the full url.

Salesforce: Execute python script through Apex class

I have a custom button in Salesforce and a python script which takes the data from Accounts table, perform some logic and save it in an object (a different table).
I want to execute python script by clicking the custom button. Hence, is there any way to execute the python script through Apex class?
You can't run the Python on Salesforce so you'll need to run it somewhere else like Heroku. Then when the button is clicked you'll need to send the data to the Python app via something like a Webhook or Apex callout.

Remove all ACL from user access of content using IBM WCM API

Is there a way to remove/reset user access from content item when we restart workflow of that content item using ibm WCM API?
You don't need to use custom work flow actions to reset it. Once you restart the work flow, the content will take the access from the current work flow stage.
Avoid giving administrator defined privileges to work flow content:
keep all privileges as work flow defined
you can use API's to rest access for content c as below
c.removeMembersForAccess(Access.EDITOR, c.getMembersForAccess(Access.EDITOR));

backand : issues with user creation, deletion, update

I'm creating an app using ionic/angularjs using Backand as the backend service. I have it setup to use a MySQL database.
1) When I create a user through the SDK (version 1.8.2 from the CDN), the user shows up in Registered Users area but does not get a row in the 'users' table. Someone mentioned that I should have Anonymous Access set to User as they said this is a permissions issue but that did not solve the issue for me.
2) I can manually add a user through the Backand GUI and the user gets a row in the 'users' table as I would expect.
3) I can not manually delete users or rows in the 'users' table through the Backand GUI. I get an error stating that the "Delete My App User" failed to perform. You can't specify target table 'users' for update in FROM clause. I haven't modified the Security Actions at all. They're all default. Updating a user receives a similar error.
4) I created a blank app in Backand and updated my app with the new tokens and app name. I was able to login to that app using login credentials that were created on the original app but were not a part of this app. Does this mean users can access any Backand once registered with one app on the system?
Am I just really missing how 'users' registration and logins are suppose to work in Backand?
Any guidance would be appreciated. Thank you in advance.
You can read more on the Back& security concept here.
User can only access to the app he was registred into. In your case I believe the second app has anonymus access, so you have signed in to the first app and got access token, and using the anonymus header you accessed the second app.
Please use incognito window mode for the second app and then you could debug two apps.
You can also review Back& User example to play around with the security.

Implicit/Explicit Login Filter - Set Data in Filter which can be available to all portlets after login - Webpshere Portal 8

I'm unable to do the following: Any help is appreciated . Thanks .
1) Set some data(Objects) into HttpSession in custom Implicit/Explicit Login Filters and access that data across all the portlets after logging in.
2) Tried this - HttpSession sesson = request.getSession(true) and set an attribute on the session . But unable to access the attribute inside the portlets after logging in .
3) Last option is Dynacache. Avoiding this and checking this to see if there is any elegant way doing using Implicit/Explicit login filters.
Use Case: Set some shared data in Implicit / Explicit Login Filters and access it in all portlets after logging in .
References used:
http://www.ibm.com/developerworks/websphere/library/techarticles/0905_buchwald/0905_buchwald.html
You can achieve the same result with Explicit/Implicit login filter and SessionValidation filter as below:
Inside Explicit/Implicit login filter set data as session attribute.
Create a SessionValidationFilter and inside this filter read the attribute from session and set it as request attribute. Now configure this filter from WAS admin console.
Inside the portlet use following code snippet to get the shared data:
PortletUtils.getHttpServletRequest(renderRequest).getAttribute(attributeName)
OR
PortletUtils.getHttpServletRequest(actionRequest).getAttribute(attributeName)
AFAIK there is no way to get the HTTPSession from the Portlet API. However most Portal implementations do offer a platform specific way of accessing it.
import com.ibm.wps.pb.utils.portlet.PortletUtils;
...
HttpServletRequest httpRequest = PortletUtils.getHttpServletRequest(portletRequest);
HttpSession httpSession = httpServletRequest.getSession();
You can use this in your portlet to access the HTTPSession object and then manipulate it as you need.
I don't know how you're trying to pull data from the portlet session but, there is this article for Portal v5. At quick glance, it seems to imply that you could set something in the HTTP Session and then access it as an application-scoped portlet session attribute. However if this behavior is simply an implementation detail and not part of the official documentation, I wouldn't rely on this to be true in the future.
To share data across portlet once user is logged in is a two step process.
Inside Explicit/Implicit login filter set data as session attribute.
Create a ServletFilter and inside this filter read the attribute from session and set it as request attribute. Now configure this servlet filter with wps.ear as follows:
a. Export the servlet filter as JAR and place this JAR at
C:\IBM\WebSphere\PortalServer\shared\app\
Note: I assume that WebSphere portal server is installed at C:\IBM
b. Add filter mapping for your custom filter in web.xml and web_merged.xml present at
C:\IBM\WebSphere\wp_profile\config\cells\10Cell\applications\wps.ear\deployments\wps\wps.war\WEB-INF\
Inside the portlet use following code snippet to get the shared data:
PortletUtils.getHttpServletRequest(renderRequest).getAttribute(attributeName)
or
PortletUtils.getHttpServletRequest(actionRequest).getAttribute(attributeName)
Restart the portal server.

Resources