Skip to main content

Posts

Showing posts from March, 2018

Swagger UI in ASP.NET Web API

What is SWAGGER UI? Swagger UI is an HTML/CSS/JS framework that provides interactive documentation of your RESTful APIs and generates a navigable UI of the documentation. Swagger UI provides automatically generated HTML assets that give you automatic documentation and even an online test tool. It is extremely easy to set up, and comes with a lot of configurable options like XML Documentation, various kinds of Authentications (Basic, OAUTH2, API key), etc. which can be configured depending on the security schemes set up in your APIs. This can reduce the time and efforts you spend on creating your Client Application to consume and test your RESTful APIs. With minimum amount of code, you will get an easy to use test client for your APIs. Benefits of using SWAGGER UI? A Sandbox! Create test client for your APIs in seconds! It's comprehensible for developers and non-developers. It's easily adjustable. It’s like a sitemap for your API. How to set Up the Swagger

Creating Azure Function from Visual Studio 2017 triggered from Azure Service Bus Topic

Recently, I was building an Azure Function from Visual Studio and encountered an issue with the auto generated Function.cs class file. My requirement was to create an Azure Function that would get triggered as soon as we receive a message on an Azure Service Bus Topic. For this I tried to use the Project template available in Visual Studio 2017. Unfortunately, when I tried to provide all the required values, and run the function, I got following error: First you get a warning which says: Warning: Cannot find value named 'Endpoint=sb:......' in local.settings.json that matches 'connection' property set on 'serviceBusTrigger' in '\Source\repos\FunctionApp1\MyFunction\bin\Debug\net461\Function1\function.json'. You can run 'func azure functionapp fetch-app-settings <functionAppName>' or specify a connection string in local.settings.json. This warning was followed by an error: [2/12/2018 9:48:05 AM] A ScriptHost error has occurre

Registering Service Endpoint for Azure Service Bus Topic in Microsoft Dynamics 365 CE

I will be using Plugin Registration tool to register Service Endpoint for Azure Service Bus Topic in my trial Microsoft Dynamics 365 CE Instance. Here are the steps to you need to follow: Step 1. Login to your Microsoft Dynamics 365 CE instance using plugin registration tool. Step 2. Once logged in, Press “Ctrl + E”, or from file menu, go to Register -> Register New Service endpoint. Step 3. Enter your Azure Service Bus Connection String in the shown popup, and click OK. Step 4. You will be presented Service Endpoint Registration popup, where you need to enter following details: Name: ASB Topic Endpoint (a friendly name to your service endpoint) Designation Type: Topic Topic Name: test_internal (enter your ASB Topic Name here) Message Format: JSON (can be .NET Binary, and XML as well) User Information Sent: None (can choose to pass on User ID as well) After entering these details, click on Save. Step 5. The Service

Scaling Azure Web Apps

What is Scaling? Scaling in Web Applications world refers to adaptability to changed load and traffic. Availability and Performance are the most important aspects of any Web Application. Hence, any Web App should be able to adapt to the changed amount of workload and traffic that it gets. When we deploy our web apps to azure, it is called an instance. It is allocated certain amount of hardware resources & servers depending upon your App Service Plan. There are basically two kinds of scaling that is performed on a web application: SCALE OUT (Horizontal) Scale Out refers to increasing the number of instances for your web application. To scale out a web app, you increase the number of virtual machine instances on which your web app is running. SCALE UP (Vertical) Scale Up refers to increasing the resource capacity, such as RAM and CPU cores, of the virtual machine on which your web app is running. Why Scaling? Pages load slowly, Network connections star