IIS Shared Configuration Webfarm - Error when dynamically updating bindings - file

First time posting a question so apologies for anything I'm doing wrong.
I have a webfarm of 4 IIS servers running windows server 2016 which uses an azure file storage account for its webfiles. It also save its shared configuration files to the same azure file storage account. This webfarm is then behind an azure load balancer.
Everything works fine, until part of the website code adds an IIS binding. This then causes all the servers to display the error below:
Could not load file or assembly 'EntityFramework,...etc" The parameter
is incorrect. (Image attached for full error).
The only way to resolve this error is to clear the asp.net temporary files from the C drive of all the servers and run IISRESET on each box.
Any ideas?

So this was a mystery but the following changes have resolved the issue. I'm not sure which combination has fixed it, but this might help someone who has a similar issue.
Recreate website in IIS using new App pool.
Removed individual IIS bindings and replaced with wildcard (we had a really old-school system before where we had 100s of binding, maybe one of these was corrupted).
Thanks for your help!

Related

Azure Automation DSC - Permission and Module Issues

Are there any Azure Automation DSC gurus who can help with some guidance and know-how for pushing through a couple impasses I am currently encountering?
The task at hand is: Use Azure Automation Runbook to provision a VM. That VM should immediately be associated with a DSC configuration, which will adjust Windows features, settings, and install SQL Server according to a specific configuration. All tasks conducted need to be written in PowerShell and should require no manual input via Azure portal at any point.
At this time, the Runbook provisioning the VM is working perfectly. However, associating this new node with a DSC configuration is still a manual process, which also is working (with the exception of the next issue mentioned below). However, this process needs to be automated instead. How is this done? Via DSC resources as children of the VM resource in the ARM template?
Getting SQL Server installed is the next step. The xSQLServer DSC module seemed perfect for achieving this, but it currently has a bug in Azure Automation, which means that the xSQLServerSetup resource is not available, even when using older versions of xSQLServer. So, there appear to be two possible workarounds to this…
Workaround 1: Not use xSQLServer and just run a PS script that is local on the newly provisioned VM to install SQL Server using a command line installation using an INI file. The PS script to install SQL works, but only when run manually. When attempting to have DSC run this script, Azure is throwing an error that the script is not digitally signed. So, there appears to be a permissions scoping issue at play, and the DSC credential is not able to run the local PS script even though the local admin credential is being passed in. How does one get around this?
Workaround 2: Apparently, it is supposed to be possible to provision a VM, compile the DSC MOF local on that machine (with the full version of xSQLServer), and then push that registration back to Azure Automation. Though, it is unclear how exactly this would be done, as it appears to also require the execution of a local PS script, thus providing the same impasse as the first workaround. Is this perhaps via a Custom Script extension in the ARM template, or…?
I can see all of the parts in play, and I’ve found several helpful resources online that give breadcrumbs to the solution. But, the breadcrumbs are too far apart, and the proper way of wiring everything together is proving to be elusive. So, I’m here humbly asking for help and guidance in getting this worked out.
Any help would be greatly appreciated.
Thanks!
First of all that's a lot of questions instead of 1.
unless this is some kind of homework - there is no point in installing sql on a vm, there are a lot of vm + sql images in Azure and it would take 5 minutes instead of 60 to provision such a vm.
When attempting to have DSC run this script, Azure is throwing an error that the script is not digitally signed. - this means your script is not signed (not related to rights\permissions), look for execution policy, you need to set it to unrestricted before running your script (but you don't need to, because of the first point).
you compile mof or upload it and then you can "tie" a vm to that mof, it can be automated with powershell (both parts), there are a lot of guides on how to do that. Like this
As a general rule, use arm template to do the whole thing, again, there are lots of examples on how to achieve that (just browse this repo). Provisioning infrastructure with powershell (on azure) is not the best way of doing things.

Getting IIS Folder physical path inside a Windows Forms Application

This question is strictly related with Windows Forms as my task is to do this inside a SAP Business one addon using C#. My requirement is to alter some configuration values stored in a Web.Config file of a related wcf service hosted in IIS. I need to get the IIS folder path (even the default path could be like "C:\inetpub\wwwroot", looking for a way to get it without hard-coding it) inside the SAP B1 form (Think as inside of a Windows Forms).
I've tried out the suggestion posted in the Getting IIS Application filesystem path thread.
string apPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
Even if I added the System.Web reference to the project it gives me a null value, and I cant add the System.Web reference specifically to address this issue.
Also I've found Environment.SpecialFolder enum usage on MSDN but even it doesn't list IIS physical folder.
Environment.GetFolderPath(Environment.SpecialFolder.System))
Can someone suggest a workaround for this scenario? Even getting this value from the system registry would be ok.
You are trying to access the web application configuration information from IIS. That means you will need a library such as Microsoft.Web.Administration from Microsoft (part of IIS),
https://www.iis.net/learn/manage/scripting/how-to-use-microsoftwebadministration
or its open source equivalent from Jexus Manager,
https://www.nuget.org/packages/Microsoft.Web.Administration.Jexus

setting up asp application on hosting provider changing

i have never worked on windows iis, asp and mssql but now i am forced to do so.
the plot:
i have an asp mvc application (the exact folder tree copied from the old disabled server) and an mssql backup file (.bak). I have managed to restore the database and i have copied my application folder to httpdocs. BUT still...when i try to access the server it pops lots of errors. i know, lack of knowledge and app setup.
my question, in what order should i start setting up my app (what files, what settings..etc for a complete windows noob); i have no start point, i'm confused, put me on the track please. Any advice will be appreciated, any reference.
Keep in mind that i have advanced knowledge in apache server, php, mysql, html, css, javascript BUT ABSOLUTE ZERO in IIS,mssql,asp :D
PS: it's kind of urgent! and i have to learn as i go.
What kind of errors are you getting?
is an code error? or what?
in my experience, when you get a new windows hosting, or server, sometimes you need to activate .asp pages, since it reads only aspx by default, also, to see the code line errors you need to configure that, because normaly the errors are hidden.
to show errors on a server, you go to control panel, administrative tools, IIS, and then somewhere is the option to show errors on browser.
If you are in a hosting with plesk there is also an option to enable .asp pages and to show errors on browser.

CakePHP 1.3: Server power outage. Now plugin wont work

My host had a power outage on their servers which caused a lot of headaches, including some corrupted database tables. All that seems to be fixed now. However, I am having issues connecting to my plugins.
When I try I get the following error:
Error: The requested address '/admin/paginas/paginas' was not found on this server.
All the other plugins are displaying the similar errors.
I have uploaded the entire cake library thinking it is a corrupted file there. However it does not work. I have also uploaded routes.php.
Where should I look to fix this problem?
FIXED. I am not sure why, but after my Host recovered files from the OUTAGE CACHE ended up in /tmp/logs/. I moved it to /tmp/and everything now works. RATHER STRANGE

Winforms: Write app.settings during Setup

I've battled with modifying Configuration settings in the App.config file in the past, and gave up any hope of making it work. Now again, I find myself in the same shoes, but this time determined to sort it out!
The application Im creating is a WindowsForms .NET 3.5 (SP1) app. It is to be used in a closed, networked environment. It is not a SmartClient app, but an "always-connected" one, and transacts over the local network with a central database server.
The app works fine, and now that Im ready to deploy and create the setup files, I must ask 2 very important questions:
How do I (especially!) 'modify' the ConnectionString value from the Setup Wizards? ;and
How/where do/should I encrypt this value?
This is surely something every developer goes thru when moving from development to production, and I would sincerely appreciate any help.
Thank you!
This question provides good information on how to modify the configuration file (in general) during setup.

Resources