Is there a tool to dump/show event data templates defined in a provider's manifest? - etw

> wevtutil.exe gp <provider-name> /ge /gm /f:xml
prints the manifest given a provider, except for its data templates. Is there a tool I am missing that would display the templates defined in an installed provider's manifest? They must be out there in the binary WEVT_TEMPLATE resource, since the Tdh* functions seem to know about them.

Perfview can do this with this command:
PerfView userCommand DumpRegisteredManifest <provider-name>
This dumps the complete manifest into an XML.

Resource Hacker allows the display of WEVT_TEMPLATE structure.

Related

Can I use Referencing functions and UI controls such as 'Microsoft.Solutions.ArmApiControl' in the uiFormDefinition of an Azure Template Spec?

I'm creating a Template Spec using Bicep, which works fine. Adding a custom UI to the Template Spec using a uiFormDefinition file also works. However, when I try to use the control 'Microsoft.Solutions.ArmApiControl' in the UI definition, it fails with the error Failed to create element of type: 'Microsoft.Solutions.ArmApiControl' named 'sqlCapabilities'. I found that I can get rid of the error by removing all referencing functions from the path property, like this:
{
"name": "sqlCapabilities",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "/subscriptions/34d76722-9b63-464d-b742-11bf072d1fc1/providers/Microsoft.Sql/locations/westeurope/capabilities?api-version=2021-11-01"
}
}
... but that doesn't actually seems to do anything. (And even if this would work the element wouldn't be very useful without referencing functions.)
While reading the documentation, I noticed there are two sandboxes in the Azure Portal for developing uiFormDefinition files:
https://portal.azure.com/#view/Microsoft_Azure_CreateUIDef/FormSandboxBlade (titled "Form view Sandbox"), which is linked to from the Create portal form page of the ARM template documentation using the shortlink https://aka.ms/form/sandbox.
https://portal.azure.com/#view/Microsoft_Azure_CreateUIDef/SandboxBlade (titled "Create UI Definition Sandbox"), which is linked to from the Create portal interface page of the Azure Managed Applications Documentation.
They look similar, but they use different schemas: the UI Definition sandbox uses https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json# and the Form sandbox uses https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json. The Form sandbox also has a few additional options such as the ability to specify the "Package Type" and "CUID".
Both sandboxes have a list documenting UI elements, which both point to the same destination: the Azure Managed Applications documentation.
The thing is: when I use the "Create UI Definition Sandbox" the 'Microsoft.Solutions.ArmApiControl' UI element works fine, even when using referencing functions like location(). However, I can't use the resulting file with the Template Spec: it attaches OK but when trying to deploy the Template Spec in the Portal I get this error: Invalid UIFormDefinition Schema. Click here to fallback to default experience.
Using referencing functions and/or 'Microsoft.Solutions.ArmApiControl' in the "Form view Sandbox" results in the problems mentioned at the beginning of this question.
Experimenting further, it looks like all functions work in both sandboxes, with the exception of referencing functions like location(), resourceGroup() orsubscription(): those only appear to work in the UI definition sandbox. The same applies to some UI elements.
Perhaps I missed it, but I wasn't able to find where this behavior is documented.
Is there a way to use the referencing functions and Microsoft.Solutions.ArmApiControl in a form definition for a Template Spec? If so, how can I do that?
TL;DR - you can do what you want, take a look at this: https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-azure-templatespecs-with-a-custom-ui/ba-p/3586173
Long version, there are 2 schemas/formats for portal ui (as you discovered), there is an "old" version CreateUIDefinition.MultiVm.json and a newer version uiFormDefinition.schema.json - the newer version is largely a superset of the old version... i.e. it supports all the old stuff and has some new stuff. This distinction is not well documented yet.
templateSpecs only support the "newer" schema.
That help?

How to automatically associate a device with a device template?

I want to automatically associate my device with its template. There is an article about this here:
https://learn.microsoft.com/en-us/azure/iot-central/core/concepts-get-connected#automatically-associate-with-a-device-template
the sample code for this is in JS and says to include iotcModelId: '< this is the URN for the capability model>'; OR '__iot:interfaces': { CapabilityModelId: <this is the URN for the capability model> }
I can see in the python device SDK documentation on keyword args available during client creation.
https://github.com/Azure/azure-iot-sdk-python/wiki/key-word-arguments-during-client-creations
But I don't see anything in those keywords about the device template. I've tried a couple of permutations on my own, but nothing seems to work as I'm registering my device using ProvisioningDeviceClient.create_from_x509_certificate.
Anyone know the correct way to include the device template in the registration?
Once you have created your ProvisioningDeviceClient you need to set the provisioning_payload property to the JSON string that contains your model-id per documentation you have linked above.
There's a tutorial and sample on Microsoft Docs that illustrates this using Python: Tutorial: Create and connect a client application to your Azure IoT Central application.

GET / POST using Clarion

I have Clarion 9 app that I want to be able to communicate with HTTP servers. I come from PHP background. I have 0 idea on what to do.
What I wish to be able to do:
Parse JSON data and convert QUEUE data to JSON [Done]
Have a global variable like 'baseURL' that points to e.g. http://localhost.com [Done]
Call functions such apiConnection.get('/users') would return me the contents of the page. [I'm stuck here]
apiConnection.post('/users', myQueueData) would POST myQueueData contents.
I tried using winhttp.dll by reading it from LibMaker but it didn't read it. Instead, I'm now using wininet.dll which LibMaker successfully created a .lib file for it.
I'm currently using the PROTOTYPE procedures from this code on GitHub https://gist.github.com/ddur/34033ed1392cdce1253c
What I did was include them like:
SimpleApi.clw
PROGRAM
INCLUDE('winInet.equ')
ApiLog QUEUE, PRE(log)
LogTitle STRING(10)
LogMessage STRING(50)
END
MAP
INCLUDE('winInetMap.clw')
END
INCLUDE('equates.clw'),ONCE
INCLUDE('DreamyConnection.inc'),ONCE
ApiConnection DreamyConnection
CODE
IF DreamyConnection.initiateConnection('http://localhost')
ELSE
log:LogTitle = 'Info'
log:LogMessage = 'Failed'
ADD(apiLog)
END
But the buffer that winInet's that uses always returns 0.
I have created a GitHub repository https://github.com/spacemudd/clarion-api with all the code to look at.
I'm really lost in this because I can't find proper documentation of Clarion.
I do not want a paid solution.
It kind of depends which version of Clarion you have.
Starting around v9 they added ClaRunExt which provides this kind of functionality via .NET Interop.
From the help:
Use HTTP or HTTPS to download web pages, or any other type of file. You can also post form data to web servers. Very easy way to send HTTP web requests (and receive responses) to Web Servers, REST Web Services, or standard Web Services, with the most commonly used HTTP verbs; POST, GET, PUT, and DELETE.
Otherwise, search the LibSrc\ directory for "http" and you will get an idea of what is already there. abapi.inc for example, appears to provide a wrapper around wininet.lib.

Precompiled Azure Function and SOAP endpoints

I'm writing a precompiled Azure function that will perform a SOAP call to ServiceNow. The code works as a standalone exe but I can't seem to get it converted to a precompiled function. In know it's because my DLL can't find the app.config file but what's the best way to get around it. Error message below. ServiceNow requires I set certain bindings and endpoint configuration. The other contractors for their ServiceNowSoapClient class allow me to specify a url directly but don't seem to allow me to get to the binding settings.
Exception while executing function: Functions.TimerTriggerCSharp.
System.ServiceModel: Could not find endpoint element with name
'ServiceNowSoapDev' and contract 'ServiceNowReference.ServiceNowSoap'
in the ServiceModel client configuration section. This might be
because no configuration file was found for your application, or
because no endpoint element matching this name could be found in the
client element.
In WCF you can define your client binding and endpoint programmatically instead of using app.config. Use the constructor of the generated client with two parameters:
new ServiceNowSoapClient(binding, remoteAddress);
See more code here.

Launch Documents To Go app from third party Blackberry App

I was wondering if it's possible to open doc, xls, pdf, etc files using the "Documents To Go" app from a third party blackberry app.
If you want to open a specific document, since Docs ToGo registers to handle these extensions, you can use the Registry invocation and it will be handled for you. Take a look at the Registry and Invocation classes, the following code will open the document in the given path, Docs ToGo will take over through the Registry:
Invocation invocation = new Invocation(path);
Ragistry reg = = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);
If there is no registered handler for the file content type a ContentHandlerException will be thrown with error code ContentHandlerException.NO_REGISTERED_HANDLER.
Note: there's a small bug in Docs ToGo - closing the document or clicking the back button might not lead the user back to your application.
EDIT: The getRegistry function takes a class fully qualified name e.g. com.softartisans.SilverDust, where SilverDust is the class mane. You can find more info about the use of the Registry in this online book starting page 291 - Client use of Registry. I originally linked to the javax Registry, but it is more useful to look at the BlackBerry Registry docs.
You can use the ApplicationManager class to launch other applications, for example by looking up its descriptor and using runApplication(). You can also pass arguments in the descriptor and if the application looks at arguments passed into it, it may actually open the specified file.

Resources