I have an Azure storage account with Input and Archive directories. I want to:
Check for new XML files in the Import folder.
Read the contents of any files and validate the data.
Rename the XML file and move it to the Archive folder.
I don't want to have to set up a Gateway as I would need to check it was secure. Therefore, I have set up a recurrence trigger to poll the directory. This is my logic app so far.
This is the output I get.
Here is the error message in full.
```{
"status": 400,
"message": "The specified resource name length is not within the permissible
limits.\r\nclientRequestId: f7ed6db1-6ee4-43a3-bd3a-796162f3a58c",
"error": {
"message": "The specified resource name length is not within the permissible limits."
},
"source": "azureblob-ne.azconn-ne-01.p.azurewebsites.net"
}
```
Check the blob connector reference you will find the problem, the Get blob content action ask the blob id and you pass the whole blob property json, that's why it show the error..
The right way is choose the blob id actually the blob path is acceptable. You could refer to my flow.
Related
Hello I am trying to create a new azure search service with S2 or S3 tier.
However, as I try to create, I am getting validation error:
Any idea how to resolve this?
below are raw error details:
{
"telemetryId": "127e12a7-2de5-420d-8ce3-181a5e663337",
"bladeInstanceId": "Blade_f10d818ac9854758a2308220f06e7274_5_0",
"galleryItemId": "Microsoft.Search",
"createBlade": "CreateBladeV3",
"code": "InvalidTemplateDeployment",
"message": "The template deployment 'Microsoft.Search' is not valid according to the validation procedure. The tracking id is 'd2a97835-fd96-4b15-95f9-416e19086f31'. See inner errors for details. Please see https://aka.ms/arm-deploy for usage details.",
"details": [
{
"code": "ServiceQuotaExceeded",
"message": "Operation would exceed standard3 service quota"
}
]
}
It looks to me like either the subscription you are using doesn't allow for paid services or you are trying to create an index in the service via import that is too large. However, S2 and S3 allow quite large indexes, so my guess is the former.
Disclaimer: I am very new to all of this, so please be patient. :)
My aim is to create a directory schema extension targeting the User resources of my O365 company directory. The extension is very simple with just 3 string fields. The idea is that every user in the directory should have this extension applied to their User object with specific values for the 3 fields it contains.
For this, I used the Graph Explorer, where I used my Admin tenant account to create a simple (domain verified) directory schema extension (domain_schemaname) with 3 fields, targeting the User resource.
I can confirm that the directory schema extension is created with status Available, using /v1.0/schemaExtensions.
After I updated the directory, I executed a Graph Explorer query to get the Extensions for myself (i.e. /v1.0/me/extensions), as well as of other users in the directory, however, the value of extensions node always returns an empty/null value([]).
I am confused, since I was under the impression that once I create a directory schema extension for a particular resource target (i.e. the user resource), the schema extension would appear immediately in the properties of any existing or new instance of a user resource. Then, I would be able to PATCH the specific user with the values for the directory schema extension.
The issue is that when I try to add an extension to a User instance, through the Graph Explorer, it always creates an openTypeExtension type of extension, whereas I just want to assign the User just the contents of a directory schema extension already created in the schemaExtensions for my organization.
So, it seems that I am not able to use Graph Explorer to apply a directory schema extension to a specific User object.
Am I using the wrong tool for the job ?
Can you advise how do I populate all the users in my O365 directory with the particular directory schema extension and assign a unique value for every user ?
Do I need to use Microsoft Graph Client library and MSAL/ADAL to create a console app to create my directory schema extension and apply it to every user in my directory, and then update its value for every different user ?
Thank you for your help.
I can confirm that the directory schema extension is created with status Available, using /v1.0/schemaExtensions.
After I updated the directory, I executed a Graph Explorer query to get the Extensions for myself (i.e. /v1.0/me/extensions), as well as of other users in the directory, however, the value of extensions node always returns an empty/null value([]).
After creating the schema extension, we need to update the value of extension property before we can get its value.
For example, I register an schema extension like request below:
POST: https://graph.microsoft.com/v1.0/schemaExtensions
Content-type: application/json
authorization: bearer {access_token}
{
"id": "coursesforuser",
"description": "Graph Learn training courses extensions",
"targetTypes": [
"User"
],
"properties": [
{
"name": "courseId",
"type": "Integer"
},
{
"name": "courseName",
"type": "String"
},
{
"name": "courseType",
"type": "String"
}
]
}
Then I update this property on the specific user:
PATHCH:https://graph.microsoft.com/v1.0/me
Content-type: application/json
authorization: bearer {access_token}
{
"exte5t2z4fr_coursesforuser":{
"courseId":"123",
"courseName":"New Managers",
"courseType":"Online"
}
}
After that, we can get this property using the $select parameter:
GET: https://graph.microsoft.com/v1.0/me?$select=exte5t2z4fr_coursesforuser
authorization: bearer {access_token}
More detail about the schema extension, you can follow link below:
Add custom data to groups using schema extensions
I am trying to get the attached file from the received mail and store it as Blob property in the GAE datastore. I am using Google app engine Python.
The file should be added to datastore only if the file is a excel file. Following code shows the method i have used for this. In that class 'mail_message.attachments' will give a list of attachments of the received mail. From that we can get only the file name and file content . But here i have to get the format of the file for checking whether it's a excel file. so that's why i have used the following method.
class LogSenderHandler(InboundMailHandler):
def receive(self, mail_message):
file_format_supported=['application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet','application/vnd.ms-excel']
for payload_no in range(len(mail_message.original.get_payload())):
one_payload = mail_message.original.get_payload(payload_no)
if one_payload.get_content_type() in file_format_supported:
uploadfile=Files()
uploadfile.temp_file=one_payload
uploadfile.put()
this code gives me the error
Property temp_file must be convertible to a Blob instance (Blob() argument should be str instance, not instance)
what i want to do converting the payload type as "str instance" to store it as blob property.
**Is there any other method to find the file type after getting the attachment list using mail_message.attachments. File content got from this attachment list can be stored to GAE datastore as blob property after decoding **.
So I have a lot of instant message logs/history that I want to back up from my chat client, Cisco WebEx Connect in Windows 7. These are stored under C:\Users\\AppData\Local\WebEx Connect\Archive and the file is called "myemailaddress".db3
After downloading SQLiteBrowser to open this file, I get the error:
SQLiteManager: Error in opening file "myfile".db3 - either the file is encrypted or corrupt
Exception Name: NS_ERROR_FILE_CORRUPTED
Exception Message: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageService.openUnsharedDatabase]
The file isn't corrupted so I'm thinking perhaps it is encrypted in some way - opening the file in Notepad displays random characters like the following, with no recognisable text:
=¢^£ÍV¶»ñû‡«–
`×ÚµÏýº°ÎîÎL
Besides that file which contains the actual messages, there is another small 20kb file under the folder ConnectDB that has various config settings (such as create CacheTable) and it says on the first line (when opened in Notepad): "SQLite format 3" - so clearly this one isn't encrypted.
Is there any way to extract the data from the first file to something readable (ie, text)? It's only around 5MB in size so shouldn't be causing any memory issues.
Unfortunately I haven't found a way for decrypting this file, however if you're still able to access the messenger client and have a live account you can still export them person by person by clicking on the person in question (make sure you've got view offline people enabled if you're retriving offline user's chat history) > click on the history tab > click on "save as".
I hope this is of use to you.
I need to extract attatchments out of salesforce? I need to transfer some notes and attachments into another environmant. I am able to extract the notes but not sure how to go about extracting the attatchments
Thanks
Prady
This mostly depends on what tools/utilities you use to extract. The SOQL for Attachment sObject will always return one row at a time if Body field is included in the query. This is enforced to conserver resources and prevent overbearing SOQL scripts.
Approach #1, if queryMore is not available: Issue a SOQL without Body field to enumerate all attachments, then issue one SOQL per attachment ID to retrieve Body
Approach #2: Issue a SOQL to retrieve all needed attachments then loop using queryMore to get them one at a time.
Approach #3: If you can "freeze" the SF environment and just want to take snapshot of the system to pre-load a different one to be used going forward you can use "data exports". In setup menu, in data management there is an export data command, make sure you click "Include in export" to include all binary data. After due process it will give you a complete data backup you can crunch offline.
Btw, body is base64 encoded, you'll need to decode it to get the actual binary
Here is the solution I've used to get the attachment binary content from SalesForce. The example in their documentation points the following:
curl
https://na1.salesforce.com/services/data/v20.0/sobjects/Document/015D0000000NdJOIA0/body
-H "Authorization: Bearer token"
So there are a couple different elements here. The host (https://na1.salesforce.com) you should be able to get after the login process, this host is session based so it can always change. Second element is the rest of the URL, that you will get from the "body" field of the Attachment object. Third and last element is the Authorization header, which is composed by the string "Bearer ", plus the token that is given to you after you authenticate with the SF backend.
The response is the binary file, it is NOT in base64, just save it to a file and you are good to go.
Here is an example of how I did it in Objective C:
// How to get the correct host, since that is configured after the login.
NSURL * host = [[[[SFRestAPI sharedInstance] coordinator] credentials] instanceUrl];
// The field Body contains the partial URL to get the file content
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"%#%#", [host absoluteString], {AttachmentObject}.body]];
// Creating the Authorization header. Important to add the "Bearer " before the token
NSString *authHeader = [NSString stringWithFormat:#"Bearer %#",[[[[SFRestAPI sharedInstance] coordinator] credentials] accessToken]];
NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0];
[urlRequest addValue:authHeader forHTTPHeaderField:#"Authorization"];
[urlRequest setHTTPMethod:#"GET"];
urlConnection = [NSURLConnection connectionWithRequest:urlRequest delegate:self];
Hope it helps.
You can use SOQl Query options, or if you are looking for some automation tool that will help you with quick export, then you can try AppExchange App Satrang Mass File Download - https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EcsAOUAZ&tab=e
Disclaimer: I work at Satrang Technologies, the publisher of this Mass File Download AppExchange App.
In SalesForce attachment will be against an Object for e.g. Account object.
Steps to retrieve attachment (in Java)
Get the ID of the Object to which a file is attached. e.q. Account Object
String pid = Account__r().getId();
Execute a Query on Salesforce Object "Attachment" for the ID in Step 1
*String q = "Select Name, Body, ContentType from Attachment
where ParentId = '" + pid + "'";
QueryResult qr = connection.query(q);
SObject[] sarr = qr.getRecords();*
SObject so = sarr[0];
Typecast Salesforce Generic Object (SObject) to "Attachment" object
*Attachment att = (Attachment)so;*
Retrieve the Byte Array Stream from Body of Attachment, and do the operation needed on byte array.
*byte[] bName = att.getBody();
// Do your operation in byte array stream*