bicep/arm template how to get display name of location - arm-template

In bicep or arm template, how to get display location name?
Eg, I have input location name 'westus', I want to get its displayName like 'West US' since I have to put location name in an alert condition like:
{ field: 'properties.impactedServices[*].ImpactedRegions[*].RegionName' containsAny: [ 'west us' ] }
By the way, ``listLocations('/subscriptions/${subscriptionId}/providers/Microsoft.Web/locations/${toLower(location)}', '2016-06-01').displayName
which seems not work.

I dont think thats possible. ie this list doesnt show that is supported. and list* operations are actually HTTP PUT requests, not HTTP GET.
So I'd expect you'd need to add that data to the template

Related

Add custom properties to an alert rule in Azure

I have a Use Case i am working on.
An Alert is fired in Azure when some conditions are met:
Condition: Whenever the total task complete events is greater than 0
The alert rule has some basic information.
Subscription
Resource Type
Resource Group
There is a Custom properties section and i want to use this to enrich the alert rule.The information I am hoping to include is in a table called AzureDiagnostics. Field values,conditions i need as follows (i included some custom fields):
OperationName=="TaskCompleteEvent" jobId_s id_s == "analyse" ElapsedTime=datetime_diff('second', executionInfo_endTime_t, executionInfo_startTime_t) ElapsedTime_in_Hours_Minutes_Seconds=ElapsedTime * 1s TimeGenerated
Can someone guide me on the best way to include these as custom properties? Adds value to the alert instead of then going back into azure to find more information. Any help is appreciated
I don't really have enough information to go on to properly answer this however, if you are referring to a default rule that you cannot edit, you can easily create an automation rule to autoclose the alert, you use custom KQL to reference the SecurityAlert table to enrich, such as
SecurityAlert | where DisplayName contains "previousRuleName"
or
If it is already custom KQL you can simply add, whether that's to the same table by removing the already specified column or otherwise, by using the join ( operator

Acumata Web Service Endpoint add Vendor Locations

I'm trying to use a Contract API application to edit and maintain vendor Locations.
I'm slightly confused on how I add a detail to the web service endpoint. I can easily add fields, but it seems when I try to add a new element it's not actually loading anything.
Here is what I did:
Added Object with name "Locations" and type "Detail"
Under that, added a top level call "Location" with screen id "Customer Locations"
Added fields to that
I used this VB code:
VendorFind = soapClient.Get(New Vendor With {.ReturnBehavior = ReturnBehavior.All,
.VendorID = New StringSearch With {.Value = "V01026"},
.Locations = New Locations() {New Locations With {.ReturnBehavior = ReturnBehavior.All}}})
It compiles and works but doesn't load the locations.
Anyone have any thoughts on how I achieve this?
For your custom endpoint you might want to use the 'Populate' option on the web service endpoint screen and select the required fields . Use the Vendor Location summary to get header information like vendor, location name etc and then select the details by selecting the correct mapped object for instance "General Info--> Location Contact " . This works fine and populates location details correctly for a selected vendor using postman tool . I am not much familiar with Vb but I suppose the issue might be in the way the endpoint entities are extended.

NoSuchGroupException: No Group exists with the key {companyId=20116, friendlyURL=site1}

I manually created a site in Liferay, and want to get its object from a Java Liferay module. If I understand correctly, a site is represented by the Group class. So I wrote this:
Group group = GroupLocalServiceUtil.getFriendlyURLGroup(
Utils.getCompanyId(), "site1");
Problem: I get this exception:
com.liferay.portal.kernel.exception.NoSuchGroupException: No Group exists with the key {companyId=20116, friendlyURL=site1}
at com.liferay.portal.service.persistence.impl.GroupPersistenceImpl.findByC_F(GroupPersistenceImpl.java:3563)
at com.liferay.portal.service.impl.GroupLocalServiceImpl.getFriendlyURLGroup(GroupLocalServiceImpl.java:1141)
I am 100% sure that site1 exists. The exception still happens after I reindex all in "Server Administration".
What am I doing wrong?
Everything is perfect but when you lookup with friendly URL. You should pass friendly URL in param like "/site1"
Group group = GroupLocalServiceUtil.getFriendlyURLGroup(
Utils.getCompanyId(), "/site1");

MODX - Access TV's of resource fetched from a ResourceList and display with getImageList

I'm trying to output template variables from resources input into a MIGX template variable, which references a template variable with an input type of 'Resource List'. Is this possible?
I've got a template variable(TV) in MODX which has an input type of "Resource List", this TV is called 'product_offer'. This resource list has a where clause which states that it can only contain products with a certain template ID.
I then have another TV which has an input type of MIGX. I use this TV to allow one of my resources to select a list of Resources in a template variable. The MIGX TV's form tab JSON is below. This TV is called 'offersList'.
[
{"caption":"Product", "fields": [
{"field":"Product","caption":"Product","inputTV":"product_offer"}
]}
]
In one of my chunks i'm using getImageList (snippet that comes with migx) to display the list of resources that I've input into the 'offers_list'. Code snippet below:
[[getImageList?
&tvname=`offersList`
&tpl=`StoreCategoryTpl-New`
]]
The chunk "StoreCategoryTpl-New" accesses the resources with this specific ID's template variables and displays a number of them. A cut-down snippet of the chunk is below.
<div class="product-container">
<img src="[[+tv.productImage:phpthumbof=`w=150&h=150&zc=1`]]" alt="Thumb of ([[!getResourceField? &id=`[[+product]]` &field=`pagetitle`]])" />
<h3>[[+pagetitle]]</h3>
</div>
Everywhere else in the site I have used this chunk to output the result of a getResources call, getResources of course can output Template Variables.
Can I access the template variables from the resources I've selected in my 'offersList' MIGX TV and output them in the chunk? I can't find any material for this on the forum or through Google searching.
If not, is the only solution to do this with getResources, and perhaps make a new TV which allows the user to enter in multiple Resource ID's as the value, then feed that into the getResources call (to only get those resources)?
I can only guess, but did you try and set the input TV Type like mentioned here?
https://docs.modx.com/extras/revo/migx/migx.backend-usage
I'd try and set the TV type.
Anyway, in the output chunk, you are trying to access the TVs like you would do with pdoTools or getResources before. As you would have to set "includeTVs", I guess it is not the default behaviour to read the TVs values from the database.
Yout Attempt to read them with getResourceField instead should work, also with the tv.productImage.
One last thing: you're using phpthumbof. Try pthumb instead, it is the new version and you can use it just like phpthumbof before.

How to set display name of a workflow in SharePoint 2010 programmatically

I'm having an issue setting the display name for a workflow on feature activation.
What I have got is a workflow that I create with a desired internal name (using SPWorkflowAssociation.CreateListContentTypeAssociation to get an SPWorkflowAssociation object). Once the name is set with that method call, I set the SPWorkflowAssociation.Name to the desired display name after that, add the workflow association to the list, and then call update on the associated list.
The result I see is that the internal name and the display name are both changed (internal name is required to link between the SharePoint list and the Client Side Object Model and we need this internal name as the display name is different for other languages).
Does anyone know how to set this properly in code? It looks like something that should be possible but I'm getting no joy from my investigations.
Thanks!
I got around this by using the description field to store a 'static' name and then later find associations via this description field rather than the internal name.

Resources