Deploying Microsoft.Maps/account - azure-resource-manager

I have used an ARM Template to deploy a Microsoft.Maps/account resource to Azure.
That was successful:
Resource Microsoft.Maps/accounts 'nzmoebasedemo0000bt' provisioning status is succeeded
I'd like to retrieve the Primary key generated, within the ARM template, in order to persist it to a KeyVault.
I looked in https://resource.azure.com but the Maps/account provider was not listed, so could find no hint as to what property to read.
I tried:
[listKeys(resourceId('Microsoft.Maps/account', 'parameters('keyVaultVaultSecretMapsAccountResourceName')'), providers('Microsoft.Maps', 'account').apiVersions[0]).keys[0].value]"
Abd got back:
#{parameters=; status=Trial run failed. ; outputs=; provisionStateSucceeded=False; deploymentOutput=; errorCode=InvalidTemplate; errorMessage=Deployment template validation failed: 'The template resource 'azure.arm.base.keyVault.vault.secret' at line '168' and column '9' is not valid: Unable to evaluate template language function 'providers': function requires the second argument to be a multi-segmented resource type excluding the resource provider namespace. Invalid function argument 'account'. Please see https://aka.ms/arm-template-expressions/#providers for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.'.}
Which in this case...seems incorrect.
What am I not seeing/getting?
Thanks!
Edit:
As per suggestion given, the following did pass a test run.
"[listKeys(resourceId('Microsoft.Maps/account', parameters('keyVaultVaultSecretMapsAccountResourceName')), '2018-05-01').keys[0].value]"
But when actually run, got the following:
1:02:35 AM - Resource Microsoft.Maps/account 'nzmoebasedemo0000bt' failed with message '{
"error": {
"code": "InvalidResourceType",
"message": "The resource type could not be found in the namespace 'Microsoft.Maps' for api version '2018-05-01'."
}
}'
Edit again:
As per guidance given in the comments, the following works! (after correcting api version, spelling mistake, and using 'primaryKey' property:
"[listKeys(resourceId('Microsoft.Maps/accounts', parameters('keyVaultVaultSecretMapsAccountsResourceName')), '2018-05-01').primaryKey]"

So the problem was due to a typo, the provider\resource is Microsoft.Maps/accounts

Related

Robot Framework & mongoDB- getting invalid Json output

I have an issue that i was not able to solve yet & it is blocking my work with MongoDB.
I use MongoDBLibrary in robot framework and I'm able to query the mongoDB server BUT
the issue is that i get the response as invalid JSON.
example for the invalid output:
[{'_id': ObjectId('5f9ecf8ca9bec554567d'), 'policy_name': 'test'}, {'_id': ObjectId('6090fead53bc363856788'), 'policy_name': 'automation'}, {'_id': ObjectId('619cf036761c281e366767327'), 'policy_name': 'Without Module'}, {'_id': ObjectId('619cf729ea016d1e33364543'), 'policy_name': 'With module'}]
how can i get / convert the output to a valid json in robot framework.
i tried many solution but could not find the right one.
what does this error mean: "NameError: name 'ObjectId' is not defined nor importable as module"?
please assist

Node-Red Get File from SFTP

I am using Node-red to connect to SFTP and to get a file.
Th Problem is that it returns always this error:
"Error: sftp.realPath: The "string" argument must be of type string or
an instance of Buffer or ArrayBuffer. Received type number
(1645531908336) 1645531908336"
Note: I did not get this error on "List" and i have tried many SFTP servers. Always the same error
this is the image of my node
1645531908336 looks like it is the timestamp from a standard msg.payload value from an inject node.
Assuming this is the node-red-contrib-better-sftp node then it looks like it is badly written and will always take the value of msg.payload and override any configured path and filename in the node config. This is a really bad design and should only use the input message if the value is left blank in the config.
https://github.com/sublime93/node-red-contrib-better-sftp/blob/10f67d46f3d762b254f7a6f22539ba4c95d6331e/transports/sftp/index.js#L148
So the quick option for you to test is to remove the msg.payload from the inject node you are testing with.
You should also raise an issue with the nodes author to fix this behaviour.
EDIT: There already is an open issue (from mid 2020) https://github.com/sublime93/node-red-contrib-better-sftp/issues/9

How to locate the method using an error message string?

I would like to know where is this error code located in the AOT. Would like to know the path to understand the structure and develop custom code.
Transaction has been selected, for settlement, although settlement type: none was selected
I generally use one of two methods to locate message strings.
Provided the cross reference is updated (it should be in dev) use the "Label editor" to to search for then string, see this answer.
Put a breakpoint in top of info.add method, disable CIL if needed, then rerun to get the error message invoking the debugger, see this answer.

An error occurred getting entities in Linkedin's WhereHows

After installing Linkedin's WhereHows following the github docs (https://github.com/linkedin/WhereHows/blob/master/wherehows-docs/getting-started.md#getting-started), logging into the web UI, and navigating to the Datasets tab, it complains
An error occurred getting entities
SyntaxError: JSON.parse: unexpected character at line 3 column 1 of the JSON data
Looking at the developer console in the web browser, can see the error outputs
SyntaxError: JSON.parse: unexpected character at line 3 column 1 of the JSON data[Learn More] vendor-01c52695e9f268de5628f7bec75d6bb1.js:65255:14
tryCatcher http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65255:14
invokeCallback http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65437:15
publish http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65422:9
Queue</Queue.prototype.invoke http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:27963:17
Queue</Queue.prototype.flush http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:27848:25
DeferredActionQueues</DeferredActionQueues.prototype.flush http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28035:25
Backburner</Backburner.prototype.end http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28169:26
Backburner/this._boundAutorunEnd http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28131:17
Unhandled promise rejection SyntaxError: JSON.parse: unexpected character at line 3 column 1 of the JSON data
Stack trace:
tryCatcher#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65255:14
invokeCallback#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65437:15
publish#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:65422:9
Queue</Queue.prototype.invoke#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:27963:17
Queue</Queue.prototype.flush#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:27848:25
DeferredActionQueues</DeferredActionQueues.prototype.flush#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28035:25
Backburner</Backburner.prototype.end#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28169:26
Backburner/this._boundAutorunEnd#http://localhost:9001/assets/assets/vendor-01c52695e9f268de5628f7bec75d6bb1.js:28131:17
Does anyone know what this error means and where to look to investigate further (first time working with wherehows and the given output on its own it not very helpful to my uninitiated self)?
** Note my configuration variables for the Play frontend (https://github.com/linkedin/WhereHows/blob/master/wherehows-docs/getting-started.md#frontend-setup) look like
export WHZ_DB_USERNAME="wherehows"
export WHZ_DB_PASSWORD="wherehows"
export WHZ_DB_URL="jdbc:mysql://localhost/wherehows"
export WHZ_ES_DATASET_URL="localhost:9200/wherehows"
export WHZ_ES_METRIC_URL="localhost:9200/_nodes/stats" (honestly don't know if this is correct (don't use elasticsearch much))
export WHZ_ES_FLOW_URL="localhost:9200/wherehows/flows_jobs"
export YOUR_HDFS_BROWSER_LINK="http://node004.myco.local:8888/filebrowser/#"
export WHZ_LDAP_URL="ldap://co.myco.local:389"
export WHZ_LDAP_PRINCIPAL_DOMAIN="#co.local"
export WHZ_LDAP_SEARCH_BASE="ou=mapr access,dc=co,dc=local"
Looking at this github issue seems to dedscribe something similar recent problem (around May 1, 2018) (https://github.com/linkedin/WhereHows/issues/1131#issuecomment-385882867). The response is in chinese, but using google translate it reads:
The latest code has a dao method did not write SQL, throw an exception directly, may be the author has not finished, you can try to use the 1.0.0 this tag, I tried this is no problem
So checking out the commit with tag v1.0.0
git checkout tags/v1.0.0
Adding redoing the parts of the installation that needed redoing (eg. adding the extralibs, setting the frontend configuration variables, starting the front- and backends), I see that error message no longer appears.

Subsonic template for SQLite is incorrect

The SQLite.ttinclude (for VB) should have
tbl.Schema="";
in the LoadTables procedure, otherwise the Struts.tt will not compile
Running transformation: System.ArgumentNullException: Value cannot be null.
Parameter name: objectToConvert
at Microsoft.VisualStudio.TextTemplating.ToStringHelper.ToStringWithCulture(Object objectToConvert)
at
Microsoft.VisualStudio.TextTemplatingBB4B38057266A6749A8A039E145DE2BB.GeneratedTextTransformation.TransformText()
I am using the lastest 3.0.0.3 zip from the subsonicproject.com website
Please file this at http://github.com/subsonic/SubSonic-3.0/issues so you can track the status of this bug. If you don't have account (or don't want to create one), just add a comment here and one of us will file it on your behalf.

Resources