With reference to the official document
When this application setting isn't present when running in Azure, the environment is assumed to be Production.
Even after overriding AZURE_FUNCTIONS_ENVIRONMENT and ASPNETCORE_ENVIRONMENT to Production, I am still getting Development in Azure.
My Azure Function is a running on serverless consumption plan, on Windows environment, runtime version ~3.
Related
There is something that I cannot really understand during the AWS CodeStar development flow. Let's say I am developing a web app (MVC) locally, it works and now I want to test it remotely before deploying to the final production environment.
CodeStar has created a Git repository for pushing the changes and it automatically starts the building, testing and deployment tasks. I have few questions:
How can I deploy a change to verify that it works BEFORE doing any sort of commit (avoiding to put dirty commits in the case there are some errors) to the remote environment?
How can I DEBUG a remotely ASP.NET application (breakpoints, etc...)?
How can I tell the application to use a different development database (or any other AWS service) while it is in the development "status" ?
Thank you for your delucidations.
I am working on ASP.net project in which I have defined some environment variables and I am fetching it in Startup.cs
Environment.GetEnvironmentVariable("InstanceName")
When I run this project on windows, it works as expected. But when we deployed to AWS Linux server, it is not reading env. variable correctly.
Is there diff. way on Linux to handle env. variables?
I have an ASP.NET Core web site that I'm deploying to a VM running IIS on Windows Server 2019. (It's on Azure, but I don't think that that really matters here.) There are some settings that I've configured as environment variables in the IIS Manager. It works fine, but when I deploy a new version using Web Deploy from Visual Studio, the settings get wiped out and the site breaks until I go back into IIS Manager and set them again. Is there a way to set IIS environment variables on the server so that the won't get erased when I deploy a new version? I'd prefer not to use appsettings.json because I don't want the values checked into my Git repository.
I develop the code for my application against the Sandbox environment in Azure. my current appsettings.json file contains connection strings for Database, Azure Storage, etc which point to the Sandbox environment.
When the api is deployed through the DevOps pipeline to Dev, Staging and Production Env, the api should point to Database, azure Storage etc that are present in the respective environments Dev, staging and production.
I am trying to go with approach in Startup file
But I can't able to go further on the above to achieve this is in DevOps deployment.
You can achieve this by JSON variable substitution. For more information, refer here.
I have solution with startup project that have .ccproj format. This is an Azure project that require Azure SDK installed. By default i am able to run it using IIS Express with Azure storage emulator & Azure compute emulator. But when i make some changes i need to recompile entire solution and re-run it. How can i deploy it in IIS server ? Could you advise me alternative deploy method how to run it in simplest way ?
I want to re-compile and attach to process after make some changes in project without restarting IIS Express & Azure emulators, it takes a lot of time.
#DotNetGoose,
should be able to run on IIS but you will need to abstract all the calls that your code read content from RoleEnvironmental and direct them to read from Web.config, and have a copy of corresponding settings in your web.config.
once the abstraction is done, set your web app as default startup project, you should be able to run them as normal web app on iis or iisexpress.