I'm trying to access logs from my application insights from code via LogsQueryClient. In documentation I see that I would need endpoint to my azure monitor(which is logical) but I'm unable to find it in azure and when googling I had no luck finding what I need or at least didn't find something that would look to me like answer to my problem.
This is constructor I believe I should use from documentation.
Any help would be kindly appreciated thanks.
You only need the workspaceId of your Log Analytics Workspace:
Then query like this:
logsQueryClient = new LogsQueryClient(new DefaultAzureCredential());
var response = await logsQueryClient.QueryWorkspaceAsync("2c6892c2-6c05-49f8-a88c-********", "apprequests | take 10", new QueryTimeRange(TimeSpan.FromHours(1)));
Related
This this documentation describes the concept of topic filters, but I can't see an equivalent in the new Azure.Messaging.ServiceBus. The previous way would be something like:
var filter = new CorrelationFilter();
filter.To = "test";
var ruleDescription = new RuleDescription("rulename", filter);
await subscriptionClient.AddRuleAsync(ruleDescription);
Please can someone point me to documentation, or give some guidance as to how this is dealt with by the new SDK?
The comment from Gaurav Mantri is correct; topic filters and other resource management is done using the ServiceBusAdministrationClient from the Azure.Messaging.ServiceBus package.
General use of the administration client is covered in this sample and there is a dedicated sample available that demonstrates working with topic filters. The topic filter sample can also be downloaded directly through the MS Docs site.
I have an issue trying to filter usages for Azure Consumption, as specified in the official documentation, based on:
properties/resourceName eq '{resourceName}
The complete URI is:
$ConsumtionUsagesUri = "https://management.azure.com/subscriptions/$subId/providers/Microsoft.Billing/billingPeriods/$BillingPeriod/providers/Microsoft.Consumption/usageDetails?$expand=meterDetails,additionalProperties&$filter=properties/resourceName eq '{resourceName}'&api-version=2019-10-01"
The query returns all the results regardless of filter. Thanks everyone for your help!
This may be because your syntax is not correct. If you would like to filter by resource name, you have to follow this syntax. Please note that the case sensitivity may return different result.
properties/instanceName eq '{instanceName}'
For other syntax, please check the Azure Consumption API repo. I believe this will work with Azure Consumption API.
it will be like => ?api-version=2021-10-01&$expand=meterDetails&metric=amortizedcost&$filter=tags/Vendor eq '******'
API documentation is not correct.
I have been trying out the AADv2 sample from BotAuth to no avail.
The error that I keep getting after I select the button on the action card is that either a HTTP 500 internal server error, or Cannot GET /botauth/aadv2. When I check if the root web page or the messaging endpoint is working or not, I get the same error - either Cannot GET / or Cannot GET \api\messages. The root page I have been trying to get to is https://(botname).azurewebsites.net
May I know what steps I can take to resolve this issue? I have tried to Google the error, but to no avail. Please let me know if you need more information!
Since you are test the sample directly on Azure Web Apps, there should be a few of questions we should pay attention on.
1, const MICROSOFT_APP_ID = envx("MICROSOFT_APP_ID");
const MICROSOFT_APP_PASSWORD = envx("MICROSOFT_APP_PASSWORD");
we declare the environment valiable as MicrosoftAppId and MicrosoftAppPassword. Please modify this sentence as
//bot application identity
const MICROSOFT_APP_ID = envx("MicrosoftAppId");
const MICROSOFT_APP_PASSWORD = envx("MicrosoftAppPassword");
2, And you also need to check the environment variables are set correctly in Application settings of Azure Web App, which is shown at https://github.com/MicrosoftDX/botauth/tree/master/Node/examples/aadv2#3-setup-environment-variables
3, You can leverage online code editor to develop, debug, and manage your project on Azure Web Apps.
And in the output column, you can see the detailed errors throwm by the application. You can leverage these info to narrow down your issue.
Tips, after you changing the application settings, it's better to restart your Azure Web App.
I'm currently evaluating the new Azure Search feature in Windows Azure. I'm wondering if there's a way to do a MoreLikeThis query similar to lucene/elasticsearch?—pass in a document text and get a list of documents that are similar to the passed in document. I know Azure Search uses elasticsearch in the background (Source).
I haven't found this anywhere in the API, but maybe I'm missing something hidden in the parameters. I think this is a very useful feature and it would be shame if it's not included.
Yes it comes in the new version of azure search : 2015-02-28-Preview
see here : http://azure.microsoft.com/en-us/documentation/articles/search-api-2015-02-28-preview/
moreLikeThis=[key]
Here a sample:
GET /indexes/[index name]/docs/suggest?[query parameters]
Host: [search service url]
accept: application/json
api-key: [admin key]
C#
Uri uri = new Uri(_serviceUri, "/indexes/catalog/docs/suggest?$filter=discontinuedDate eq null&$select=productNumber&search=" + Uri.EscapeDataString(searchText));
There's a sample project on Codeplex:
https://azuresearchadventureworksdemo.codeplex.com/
Suggestions (Azure Search API):
http://msdn.microsoft.com/en-us/library/azure/dn798936.aspx
(Azure Search API)
http://msdn.microsoft.com/en-us/library/azure/dn798927.aspx
Unfortunately this feature is not currently available in Azure Search.
See Pablo's comment on Scott Guthrie's blog.
I know that this is an antique question, but it's one of the first when googling for 'morelikethis azure search'.
Anyway, with the new API version 2019-05-06-Preview there is a new preview feature called moreLikeThis (not in the SDK yet) where you can pass in an id of an existing document (I know, not a text like the David asked for). E.g.
GET /indexes/[index]/docs?moreLikeThis=[documentId]&api-version=2019-05-06-Preview
You can filter the compared fields by defining a list of properties with the searchFields parameter, e.g.
GET /indexes/[index]/docs?moreLikeThis=[documentId]&searchFields=[field]&api-version=2019-05-06-Preview
Of course this can also be POSTed, for more details have a look here.
when I Post data and Query a Table with the database as: Dev datastorage (emulator) it works.
When I Post data Table with the data in Azure data base (have account) it works.
When I Get data from Table with the data in Azure data base (have account) it does not works.
In both the cases the code is the same.except the key and account credentials.
Is it I should do anything to Query ?
var query = azure.TableQuery
.select().from('dummytable').where('PartitionKey eq ?', key);
can any one suggest why Query is not working.
should there be anything else that need to be done
From Storage Explorer it works, I am able to see the entities.
only from the program I am not able to get the response. But in the same program "PUT"operation is working.
Was happening the same to me.. did an upgrade from the azure npm package 0.6.1 to 0.6.7 and now works, hope this helps.
I would look at the value that is on your partition key. There are some values that aren't on the list of invalid characters that Azure has issue with. For example before SDK 1.7 you could safely insert a % in a key, but if you queried for it specifically it wouldn't work. To test if this is the problem try running your query but without the filter and make sure your row is returned.
After reading the msdn mailing lists, I have upgraded the azure npm with the latest package 0.6.7 and it works. looks to be an issue with azure