Azure REST Service Cost - azure

Is there any cost associated in sending API calls to the service endpoints mentioned at the following URL: https://learn.microsoft.com/en-us/rest/api/azure/ provided by Azure using Postman?

No, there's no cost associated with calling these APIs (at least API calls to manage Azure Resources Control Plane). However, please keep in mind that there's a limit on how many API calls you can make. You can read more about those limits here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits.

Related

Should I regroup all my Apis in one Api management

We have multiple Apis in our company.
I am working on a software for my company that will use 3 Apis only used by this software so we would like to use Azure Api management as a single point of access.
The question is:
Should we create an Api management for this software for this 3 Apis only and in the future create other Api management if needed.
Or should we create one and only one api management and any new or existing Api would go in this Api management (We could end with hundreds of API)?
With the First option, we limit the risk to these 3 apis but the cost would be higher.
In the second, there is the risk of single point of failure, imagine you do something wrong all Apis could be impacted. The price could be lower.
What do you think ?
Should we create an Api management for this software for this 3 Apis only and in the future create other Api management if needed.
Or should we create one and only one api management and any new or existing Api would go in this Api management (We could end with hundreds of API)?
You can create an Api Management only for your required 3 api's by using API aggregation concept.
And in the future if you want, you can create a new Api Management or you can also add other api's to the existing APIM.
With the First option, we limit the risk to these 3 apis but the cost would be higher. In the second, there is the risk of single point of failure, imagine you do something wrong all Apis could be impacted. The price could be lower.
Yes, the basic cost would be applicable but there will be no latency while accessing the api's and are also secured when using APIM.

Azure ServiceBus REST API total messages in a queue

I have been following the Azure Service Bus REST API documentation located at https://learn.microsoft.com/en-us/rest/api/servicebus/
I'm required to know the total number of messages in a queue before reading the first message. However, I cannot see a request/command to simply get the total/count number of messages in a given queue.
Is this not possible via the REST API and only available to SDK?
Thanks
You can certainly get this information through REST API. In fact, there are two different REST APIs using which you can get this information.
Using Azure Resource Manager REST API - It is newer and recommended way to work with Service Bus Namespaces. The operation you would want to perform is Queues - Get. The response body will contain the details about the messages count. This API would require you to get an Azure AD access token which is then used for authorization.
Using Old REST API - Though not recommended but you can use old Service Bus REST API to get the information. The operation you would to perform is Get Entity. This API would require you to use your Service Bus Namespace's shared access key for authorization.
Having said this, it is still recommended that you use the SDKs instead of consuming the REST API directly as SDKs are simply wrapper over REST APIs.
Yes you can you need to access it via the management API, more specifically this https://www.nuget.org/packages/Microsoft.Azure.Management.ServiceBus.Fluent/
Here is a great link explaining exactly how to use that package and get the counters you are after
https://www.florinciubotariu.com/retrieving-number-of-messages-in-service-bus-in-net-core/

Azure APIM as forward proxy

I am looking for some design guidance in using Azure APIM as a forward proxy between backend services (such as function apps or logic apps) and external clients.
We have a function app that processes invoice requests (for an order previously placed) from a mainframe system, does some transformations and sends them to an external party via HTTP. I have two options with the sending process.
Store external HTTP endpoint as an app setting in function app and let function app send the
transformed message directly to external party.
Send the transformed message to Azure APIM with the external HTTP endpoint set as the backend service (using set-backend-service APIM policy) and let APIM forward it to external party.
Now, are there are any real benefits with the second approach if the requirement is only to forward requests to external party from a security or operational standpoint? There are no requirements to enrich the outgoing message (add or remove headers, modify message body etc).
Personally, all I see is an extra hop with the second approach. But some of my teammates seem to think the second approach can offer some benefits in the way of analytics. There are some metrics available under APIM --> Analytics tab that lets you see the number of successful, failed requests etc. But I think this information is also available to Application Insights tied to the function app.
Just interested to see some insights around this so we can make an informed decision.
I guess using Azure API Management would be an over-engineering in your case, assuming the Azure Function is only going to be the caller of the Azure API Management instance.
Even though Azure API management provides analytics, url-rewrites, transformations, analytics etc - it makes more sense when you use it to govern the API. Ask yourself a question on, how many of the Azure API management functionalities are going to be leveraged fully in your case.
Remember Azure API management by design is an API governance tool where you can perform throttling, monetizing your API by giving access to it to different 3rd party with segregated subscription keys. In my opinion, Azure API management comes into the scene where you need to distribute some API to 3rd party applications, which clearly not in your case.

What would be the cost for invoking azure management API

As a newbie to azure environment, I have the following queries to ask
1. What would be the cost for invoking azure management API (I didn't get any documentation which defines cost)
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions?api-version=2016-06-01
What would be the better way of maintaining PROD and DEV environments for logicapps and app services? My current plan is to differentiate it with the resource group. Is this a preferable way to go with?
Thanks in advance!
Partial answer to your questions
What would be the cost for invoking azure management API (I didn't get
any documentation which defines cost)
There's no cost of invoking Azure Management API. However there is a limit on how many API requests you can make (essentially throttling). You can find more information about it here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling.

how can i detect and get email notification of traffic in azure api management

i have question regarding Azure API Management again : ).
i am using API management which is API Gateway doing HTTPS to Azure Storage REST API directly
and is there any way that i cant get email notification when there are massive requests or high latency at response ??
Thanx for reading : )
You can configure alert notifications either in the portal or via the REST API or .NET SDK to monitor for specific Azure Storage Metrics that you want.
See https://azure.microsoft.com/en-us/documentation/articles/insights-receive-alert-notifications/ for more details.
For massive requests, you might want to consider using "TotalRequests" or "TotalBillableRequests" in a specific time period.
For high response latency, you can track "AverageE2ELatency" or "AverageServerLatency" in a specific time period.
See https://azure.microsoft.com/en-us/documentation/articles/storage-monitoring-diagnosing-troubleshooting/#monitoring-performance for more details on these specific metrics and how they relate to performance monitoring.
Hope this helps.
Sriprasad's answer makes sense for configuration from the Storage side. From the API Management side, you cannot currently set a notification on any event other than the built-in ones (subscription requests, new subscriptions, application gallery requests, new issues/comments, approaching of user subscription quota limit).
You can use Log-To-Eventhub policy to log a message to event hub for every request and consume it in a custom or third party solution like AppInsights/Runscopee to fire an alert.
Refer
https://azure.microsoft.com/en-us/documentation/articles/api-management-log-to-eventhub-sample/
If your requirement is to get report/metrics from API Management you can use the management rest api's for APIM.
https://msdn.microsoft.com/en-us/library/dn781421.aspx
Specifically you might want to look at reportByAPI (which gives you useful metrics in response like callcounts, apiTimeAvg) based on which you can setup alerts/email notification.
https://msdn.microsoft.com/en-us/library/dn781421.aspx#ReportByAPI

Resources