I am working on a scheduled task in Kentico and I need the task to call methods that exist in a separate web service. I'd like to know if it's possible or not and how to do that.
When connecting and interacting with web services there are no extraordinary steps that you have to take. There is a sample service present in CMSPages/WebService.asmx. that you can use as a reference to creating your own web service and you are free to add your own "asmx" handlers as you would to any other .NET application. Kentico is in the end a standard .NET application and you can create those without any problems.
Additionally I would recommend to using Web API 2.0 instead of the old asmx handlers. In order to see how you can create such web service you can check documentation which contains an example.
Related
When creating an Azure Static Site using the Blazor settings, you get an option to configure an API. My repository has an Azure Functions V3 API, and I want to use that. After making all the definitions, the build and deploy workflow fails. When I eliminate the api_location setting, the workflow succeeds.
I am pretty sure that the workflow expects a V2 Azure Functions application.
Can I supply a custom build command to build the V3 application?
Will role management work OK with V3?
Thanks!
According to this, a managed API can only use .NET Core 3.1, while V3 is .Net 5 based, so that is probably why the build failed.
Having said that, this document is from May 2020, so this maybe changing soon, hopefully...
Update: After discussing the matter with a Microsoft employee involved with the matter, they informed me that (a) the document is indeed up to date and (b) static apps API will .NET 6 support sometime in November...
My question is about make API request from azure web jobs.
I have created azure Apps service for my web application (MVC C#).I have one API that need to run once in a day.I found one component in azure namely Azure Job which is paid one.Later I get to know about web jobs in my same Apps Services which not need to pay anything more, but I am not able to find anything that connects Web Jobs with API calls.Everywhere its mentioned about '.exe' files only.
I think that the first thing is that you could refer to this document to learn what is webjob.
WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
As Ivan yang mentioend that you could create a console application or script and add call rest API code in it.
Note : If your app runs continuous or scheduled WebJobs, enable Always On to ensure that the WebJobs run reliably. This feature is available only in the Basic, Standard, and Premium pricing tiers.
I recommand that you also could use the Azure function to do that.
I am using VS 2017 and have successfully setup to use Stateless Web API. I can see the output of the default controller when I run it.
Now, I want to create web pages within this project and use AngularJS SPA within it to access its own API.
I am unable to find any examples which clearly show how to do this. Note this is ASP.NET Web API - not ASP.NET Core.
Someone please help.
I opened a support ticket with Microsoft and this can be done with the ASP.NET Web API support in service fabric. Web pages can be added to the self-hosted web api project, but each file has to be individually configured for this project - if you have hundreds of files, it does not allow you to configure the entire folder contents for the project, because you have to mark each file to build as content. The example they sent me is an obscure article in a Microsoft blog from a Microsoft Engineer nobody has heard of before.
Not worth it. Use the ASP.NET Core support.
I am planning use Semantic Logging Application Block in Web API hosted on Azure Web Role. I am planning to extend event source and create few event sources of mine.
I want to make sure that this component SLAB + Custom Event Source works properly on Azure Web Role.
Anyone has used this component on azure and want to share their experience?
I use SLAB in my apps, however be sure that it can be used in the azure service you need to ask Microsoft support.
http://azure.microsoft.com/en-us/documentation/articles/choose-web-site-cloud-service-vm/
for example at the bottom of the list you see that
Can listen to ETW events
is not supported for Web Sites but it seems to be fine for Web Roles. However, double check it with Azure support as caution is never enough.
Regards
Using Coldfusion 8/9, how would I go about managing IIS7. For example:
I am building a website generator, when someone fills out a form, a website will be generated. A step in this process will be to create an IIS site with specific host headers/ip bindings. Another step may be to allow the user to upload a SSL certificate. That may not be possible, I am not sure. But I do know that there should be a way to interact with IIS7.
Fortunately ColdFusion 8 and 9 can instantiate .NET components, this means you can access the .NET managed-code IIS administration API's:
Using Microsoft .NET Assemblies
IIS7 ships with two .NET managed-code management API's:
Microsoft.Web.Administration
Microsoft.Web.Management
These reside in: c:\windows\system32\inetsrv.
Using this functionality you should be able to consume these API's via ColdFusion to create websites and manage IIS functionality.
If there are problems calling these API's directly (i.e. some item of data doesn't marshal back to ColdFusion properly) you could always wrap calls to these API's with your own .NET code.
For more information about creating and managing websites using the API's above refer to the following links:
IIS 7 Configuration Reference
Powerful Administration Tools
How to Use Microsoft.Web.Administration
Managed-Code API Reference (IIS 7)
It should also be noted that the Windows account the site runs under should be a member of the Administrators group to manage IIS via these API's.
If this was a public facing site then I'd split the application in two. Your public facing ColdFusion (running under a low privileged account) site collects information about the site to be created. Post this data as a task into a queue (can be as simple as a database) of some sort to be read by either a scheduled task or a Windows service (running as a highly privileged user) which picks these tasks off of the queue periodically (say once every 15 or 30 seconds).
This is known as 'sandboxing' and means that if your ColdFusion site is hijacked then it's not running under elevated rights and can't do much damage. All the highly privileged tasks are sandboxed in a process that isn't surfaced via the web.
For CF7, I guess you can invoke powershell script with cfexecute?
http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools/
How about: http://iisweb.riaforge.org/ and http://iisvdir.riaforge.org/ ??
I do not think that it is a beneficial way to do this. It just won't work.