I want to get data from different database tables in azure search,is it possible? or any other workaround or best search - azure

My website is hosted on Azure, i want to implement Azure search indexing, but there are some limitations of showing data to anyone. So when i retrieve data from a table, i will check user id and all details from different userrole table and pick some data on the basis of userid,
Can i get data from different database tables using Azure search indexing? currently i am getting onlye one table data on one index?
i have to implement Azure index search, or please suggest me any other workaround for my problem.
for example
i have a table of "users","userroles", "projects" and "tasks".
i want to show tasks of projects related to user. foreign key will be used. now if i create azure index, it will only run my query on tasks table, it will not check the tasks details from projects,users, etc tables. so my question is how i can create such type of index or query in Azure search, where i use different tables to get relevant and correct data in my search.

You can add those roles on your Azure Search index, specifying which roles have access, and use Odata to filter the results.
https://.search.windows.net/indexes//docs?search=&$filter=Administrator%20eq%20true
You can learn more about filters on this documentation.

Related

Query data from Azure Purview

Moving from AWS Glue to Azure Purview and i am confused about something
Its is possible to query Azure purview data catalog/assets in the same way we can query from AWS Glue data catalog using AWS Athena?
Unfortunately, you cannot query data from Azure Purview.
The Purview search experience is powered by a managed search index. After a data source is registered with Purview, its metadata is indexed by the search service to allow easy discovery. The index provides search relevance capabilities and completes search requests by querying millions of metadata assets. Search helps you to discover, understand, and use the data to get the most value out of it.
The search experience in Purview is a three stage process:
The search box shows the history containing recently used keywords
and assets.
When you begin typing the keystrokes, the search suggests
the matching keywords and assets.
The search result page is shown with assets matching the keyword entered.
For more details, refer to Understand search features in Azure Purview.

Azure easiest way to publish and query a list of values

I am looking for the easiest and cheapest way to use Azure to publish a list of values to be query by my application. I am currently using Azure Application Insights to send telemetry events and try to use a similar mechanisms to serve my need.
I tried to use the Azure Application Insight query and the tags but I can not find a good way to store the list of values.
I am wondering if a rest API would be the right way forward or if there is something even easier? The system is very similar to a revocation list:
The list is published with no security (e.g. simply use the API key)
The C# client starts and retrieves the list and perform some action is the list is successfully retrieved.
Any advice will be welcome.
Application insights is not a good place to store this kind of data. It will add many extra columns and the query results is not very friendly which may take you lots of time to parse it.
For azure table storage, you can store the key and value pair into 2 different columns like mykeyColumn / myvalueColumn, then you can easy use the table storage sdk(it's available for both azure table storage and azure cosmos db services) to query the records(one or many) in just one query command.
For better performance, I recommend you can store these key-value pairs with the same partition key, then in your code, you can define your query filter like below:
TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "xxx")
This filter will return all the key-value pairs in the specified partition key, next, you can easy to get each of them.
For the usage of the sdk Microsoft.Azure.Cosmos.Table, please refer to this doc.
For the usage of query filter, you may take a look at this doc(It may use the old sdk, but the query filter is the same).
And if the key-value pairs will not be updated or no new ones will be added, you can also consider store them in json format, and use the blob storage.

Ordering data in Azure Cosmos Table API

Azure Storage Tables have been superseeded by Azure Cosmos Table API at a significantly higher price point but also with new features like automatic secondary indexing.
One of the pain points using Azure Storage Tables was, that in order to achieve custom ordering of query, we have to redundantly store the data with different Partition/Row-Keys as the documentation states, that
Query results returned by the Table service are sorted in ascending
order based on PartitionKey and then by RowKey.
However, the next paragraph states, that
Query results returned by the Azure Table API in Azure DB are not
sorted by partition key or row key. For a detailed list of feature
differences, see differences between Table API in Azure Cosmos DB and
Azure Table storage.
Following, the link, i find that
Query results returned by the Table API aren't sorted in partition
key/row key order as they're in Azure Table storage.
So i am a bit confused now, how to achieve ordering when using Cosmos Table API. Is there no ordering at all? Or can i specify ordering with my querys?
For Azure Cosmos Table API, this one is correct: "Query results returned by the Azure Table API in Azure DB are not sorted by partition key or row key".
So the returned results is no sorting as of now.
Somebody has asked this issue before at GitHub here.
And the MS team suggests vote on this user voice. And they may add this basic sort feature in future.
Hope it helps.
Additional information to this topic i found out from the GitHub thread:
The latest preview of CosmosDB Tables SDK (0.11.0-preview) has OrderBy support:
https://github.com/MicrosoftDocs/azure-docs/issues/26228#issuecomment-471095278

Best solution for dynamic spatial data

I'm trying to find the best solution for storing dynamic spatial data. I wonder if any of Microsoft's Azure solutions could work. Azure Table Storage would let me create a lot of custom and dynamic structures stored on fast SSD disks.
Because of data's dynamic nature, common indexing seems useless. I would also like to create a lot of table-like structures so the whole architecture cannot be static. Using Azure Table Storage I would dynamically create a table based on country, city, etc sorted by latitude or longitude.
I would appreciate any clue.
Azure Table Storage has mostly been replaced by Azure Cosmos DB.
At the time of writing the Table Storage page even says:
The content in this article applies to the original basic Azure Table storage. However, there is now a premium offering for Azure Table storage in public preview that offers throughput-optimized tables, global distribution, and automatic secondary indexes. To learn more and try out the new premium experience, please check out Azure Cosmos DB: Table API.
You can use Cosmos DB via the Table API, but you'll probably find the Document DB API to be more powerful.
Documents are "schema-free". You can just throw your documents in to a collection, and then you can query against them.
You can create documents which have geo-spatial properties which are indexed automatically.
Then you can perform geo-spatial queries against those properties.
For example you might give each of your documents a point, and then create a query to select all documents that are inside of a polygon.
Or maybe you want to find out how far away each document is from a given point.

Azure Search default database type

I am new to Azure Search and I have just seen this tutorial https://azure.microsoft.com/en-us/documentation/articles/search-howto-dotnet-sdk/ on how to create/delete an index, upload and search for documents. However, I am wondering what type of database is behind the Azure Search functionality. In the given example I couldn't see it specified. Am I right if I assume it is implicitly DocumentDb?
At the same time, how could I specify the type of another database inside the code? How could I possibly use a Sql Server database? Thank you!
However, I am wondering what type of database is behind the Azure
Search functionality.
Azure Search is offered to you as a service. The team hasn't made the underlying storage mechanism public so it's not possible to know what kind of database are they using to store the data. However you interact with the service in form of JSON records. Each document in your index is sent/retrieved (and possibly saved) in form of JSON.
At the same time, how could I specify the type of another database
inside the code? How could I possibly use a Sql Server database?
Short answer, you can't. Because it is a service, you can't specify the service to index any data source. However what you could do is ask search service to populate its database (read index) through multiple sources - SQL Databases, DocumentDB Collections and Blob Containers (currently in preview). This is achieved through something called Data Sources and Indexers. Once configured properly, Azure Search Service will constantly update the index data with the latest data in the specified data source.

Resources