Can i have 2 services (.svc) in one Azure WCFWebRole? - wcf

I have my Azure cloud solution, with a WCFWebRole, and i created 2 services (.svc).
On localhost they both work great.
But when i publish my solution to Azure, only one of the .svc's are uploaded
What am i missing?
I read a lot of threads about people combining all their service interfaces into one .svc file for some reason, but i see no point in that, if worst comes i will divide the .svc files into 2 WebRoles (which will be a waste, and probably not possible when thinking about it, because i have Windsor Castle and Nhibernate configured on the WebRole, so Lifestyles won't be kept between the webroles)
It doesn't seem like a big dig having more than one .svc when working on localhost...
Thanks

Yes, you can have more than one .svc WCF service in a single WCF project assigned to a single Azure Cloud Services Web Role.
This GitHub project is a sample of such a project that, after configured with storage credentials in ServiceConfiguration.Cloud.cscfg and when deployed to a Windows Azure Cloud Service, will answer to requests to both Service1.svc?wsdl and Service2.svc?wsdl.
To verify if your .svc files are being uploaded in the package, you can go to the bin\Release\app.publish directory under your cloud project and extract the .cspkg file (it is in ZIP format). Inside it you'll find a large .cssx file. Extract it as well. Inside this file look into the approot directory. You'll find the project files there. The same files should be found in the csx\Release\roles under your cloud project.
If the .svc files are indeed being uploaded and they're not executing in the cloud environment, check your WCF bindings and endpoints.
You may also activate Remote Desktop in a single development cloud instance and connect to the server to verify logs and events, and to inspect the application directories.

Related

Confusion regarding WCF at Azure

I have few WCF services, deployed at IIS, which are consumed by some android devices. I'm have to move all my databases and services to Azure. I googled to find out how to deploy WCF at Azure, and found a concept of WebRole and Azure Cloud Service project. See THIS SO POST
But at the same time, I just tried creating a new webapp in Azure and simply published my WCF services project there, and it worked fine. (I tested with client).
My Question is,
What is the difference between the methods mentioned in the post I linked, and the way I deployed? I'm concerned, because I'm expecting high amount of requests.
Is it okay to deploy my already created/ready services the way I did?
What is preferred?
Both (WebApp and Web role) will work for your scenario.
The main difference between this two way is that Web role allows you to connect to it through remote desktop.
You can keep using WebApp and configure Auto Scaling (based on CPU usage or at a specific time).

How to publish a WCF against a publish settings file?

I have created a site in Azure and downloaded the publish settings file. When I click publish in VS I get the option to select a file with publish settings but only for the ASP.NET project. More or less like so.
The problem is that I'm trying to publish a WCF library and the publish option allows only for IIS, FTP or system. I can't find an option for publishing via the settings file I've downloaded.
How can I point my WCF project to the PUBXML file?
Edit
Based on the comments and replies, I also installed ASDK. Those are the projects I can choose now.
This is what you are looking for. This screenshot is from Visual Studio Community 2013.
and then...
.. then app.config additions for your addresses, bindings, and contracts
.. then Azure Endpoint configuration
Your best bet would be to publish your library within a Worker Role and open an http endpoint through configuration.
you can also configure ASP.NET to host your WCF endpoint. Again, just a bit of configuration needed for that.

Hosting a continuosly running Console application

Azure VM, Cloud service or Web job?
I have a configurable console application which runs continuosly. Currently it is running on a VM and consumes lot of memory (it is basically doing data mining).
The current requirement is to have multiple instances of this application with different set of configuration which can be changed by specific users.
So where should I host this application such that the configuration can be modified using some front end which provides access managements(like Sharepoint),ability to stop it/restart (like WCF service) without logging on the VM?
I am open to any suggestions/ideas. Thanks
I don't think there's any sold answer to this question as there is the preference variable but for what it's worth, if it were up to me I would deploy it against individual azure VM's for each specific set of users. That way if the server resources went up because of config changes the user group made it is isolated to that group, and with azure, will scale automatically to meet the resource demand. Then just build a little .net web app to allow user to authenticate and change configuration settings.
You could expose an "admin" endpoint for your service (obviously you need authentication here!) that:
1. can return the current configuration
2. accept new configuration
3. restart the service (if needed). Stopping the service will be harder, since that leaves the question on how to start it again.
Then you need to write your own (or use a 3-party (like sharepoint or a CMS)) application that will handle your users and under the hood consume your "admin" endpoint.
Edit: The hosting part: If I understand you correctly your app is just an console application today, and you don't know how to host it? Well, there are many answers to that question. If you have a operations department go talk to them, if you are on your own play around and see what fits you and your environment best!
My tip: go for a http/https protocol/interface - just because there are many web host out there, and you can easy find tools for that protocol. if you are on the .NET platform check out Web.API or OWASP
Azure now has Machine learning to process data mining.
You should check if it's suit to you.
Otherwise, you can use Webjob:
Allow you to have multiple instances of your long time running job (Webjon scaling out).
AppSettings can be change from the Azure Portal or using the Azure Management API

Is app.config file exposed for Windows Service like WCF service web.config file using IIS?

I'm new to creating Windows Services to host WCF, as I've been using IIS to do this. I've created a Windows Service to host about a dozen of WCF services, and have set up an app.config file in Visual Studio to handle all the endpoints and addresses for each of the services.
Where on the file system are windows services installed? Is there a way to reconfigure the config file to change bindings/addresses without having to uninstall/reinstall the service?
I've been doing this with the published web.config file that is present in the inetpub for WCF services that are using IIS, I'm wondering if it's the same with a windows service.
The answer to your title question is YES. The app.config to Windows Services is the same as the web.config is to IIS hosted web services.
Windows services are usually deployed as regular executable files in a certain place within a product specific path. The app.config placed next to this executable is with the same name as the executable appended with .config. So a ScanService.exe has a ScanService.exe.config next to it that contains its configuration.
Hans , I have developed/installed my distributed services(.NET remoting) with as windows services, What happens is you need to specify folder while installing the service. eg you select the folder as "C:\Program Files\MyService" then your MyService.exe.config will be installed in same folder as "C:\Program Files\MyService"
so your can find "C:\Program Files\MyService.exe.config" and modify your bindings and then restart your windows service.
Other points you consider is
There will be no AppPool here so what ever account you will use while installing the services will be used to run your services. you may need to provide some additional permissions if you are using simple domain\account
in case you need to access event log or registry via your service.
Or in you can modify your service account later on after installing the services.
Is there any particular reason you want to move away from IIS ? As my WCF services also live in IIS so was wondering if you facing any issues with one.

What files in Service References must be deployed to consume a WCF service?

I'm concerned about files should be included in a deployment of a .NET project. I have console applications that are consuming a WCF service. The WCF service is running over HTTP. Do I need to deploy all the XSD, SVCINFO, WSDL & SVCMAP files that are in the Service References folder?
Thanks for any help. I sure wish there was a single page at Microsoft that definitively explained what file types were required in a deployment.
The only bits you need at installation time are the compiled code and the .config file. The rest of the pieces (the code, WSDL, etc) or all for compile / design time.