I have to deploy Dotnet application (Target Framework is 4.7) in Azure App Service using Azure DevOps Pipeline and manually. And it has three deployment slots like Dev, QA and Staging. Is there any way to handle appsetting.json for deployment slots? (I mean if I have appsettings.development.json, appsetting.QA.json...)
Related
I am having 3 “Deploy a Release” steps in a Octopus project. I need to deploy each steps in a different Azure WebApp. How can achieve the this.
For example I have an octopus project named ‘Fruit’, and I have 3 steps in the project, each one to “Deploy a Release”
Step 1: Apple - To be deployed on an Azure Web-app ‘Alpha’ in Dev Environment.
Step 2: Orange - To be deployed on an Azure Web-app ‘Bravo’ in Dev Environment.
Step 3: Mango - To be deployed on an Azure Web-app ‘Charlie’ in Dev Environment.
All the azure web apps are under the same account. Kindly help.
Assuming that you will be having separate package feeds (alpha package,...) for each steps, you should be able to achieve deployment to each web app in same environment by using variables scoped to each specific step.
variable scoping
As we are deploying to the already existing applications our files get locked.
How should we add the appofline file so the deployments can use that file and coordinate with VSTS pipeline ?
VSTS Pipeline
ERROR MESSAGE
2017-10-03T15:07:34.9492376Z Info: Updating file (xxx-xxxx-dev\xxx.xxx.Web.dll).
2017-10-03T15:07:37.8157267Z ##[error]Failed to deploy web package to App Service.
2017-10-03T15:07:37.8187261Z ##[warning]Try to deploy app service again with Rename locked files option selected.
2017-10-03T15:07:37.8187261Z ##[error]Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'xxx.xxxx.Web.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Error count: 1.
The Task App Offline option of Azure App Service Deploy task will take the app service offline, since it doesn’t work for you, you can stop or restart azure web app through Stop-AzureRMWebApp/Restart-AzureRmWebApp powershell through Azure PowerShell task or use "Azure App Service Manage" task and then deploy package through Azure App Service Deploy task.
Somewhat new to Azure. We have 3 different cloud service accounts (dev/qa/prod). We have the same 1 web role and 2 worker roles we'd like to deploy to these cloud service accounts. In Visual Studio (2013), I have currently one Azure Project with the 1 web role and 2 worker roles. I have created 3 different ServiceConfigurations for each environment. I can create a deployment package using the corresponding ServiceConfiguration. So far so good.
Now, it seems I can only have one ServiceDefintion.csdef file. If I want different VM sizing for my envs (i.e. different ServiceDefinition.csdef file for each env), how can I accomplish this?
Found various solutions/options:
http://blogs.msdn.com/b/philliphoff/archive/2012/07/02/transform-windows-azure-service-model-files-during-packaging.aspx
Azure: Is there any way to deploy different instance sizes for test/production
However, I ultimately resolved the issue at our deployment server (Octopus). I have a single definition file and 2 config files (local and cloud) - the defaults in VS. For workstation debug the local serviceconfiguration is used. When I build and package I use the cloud serviceconfiguration as starting point. Then in Octopus I transform / variable substitute both the servicedefintion and serviceconfiguration based on target deployment environment.
I'm using Jenkins to produce cspkg files using msbuild. It stores build results in azure blob storage. Then I use management portal to deploy them.
The biggest drawbacks I see are:
1. Deployments can be accidentally deleted easily.
2. There is no straightforward* way to check which version the cloud service has.
Is there a better way to manage deployments?
Its definitely not the best experience is it?
The approach I tend to use is as follows:
Build the deployment package and add the version number to the package filename (taken from AssemblyInfo.cs) e.g. MyCloudService-1.2.0.0.cspkg - this should be trivial using msbuild.
Push the package to Cloud Storage.
Perform the deployment of the package from Storage, with the Deployment Label '[CLOUD SERVICE NAME]-[VERSION] # [DATE & TIME]' e.g. 'MyCloudService-1.2.0.0 # 10-09-2015 16:30'
Check the deployment package into a 'Packages' directory in source control.
If you need to identify the version of the package deployed to the cloud service, you can see the Deployment Label on the Azure Management Portal:
'Old' Portal (manage.windowsazure.com):
'New' Portal (portal.azure.com):
I have a solution which have three applications
a. One web application
b. Two web services
I want to host
applicaton on One website A
and services on Another website B
When I am trying to host build using automatic build deployment in TFS, I am getting only one web service. Can anybody tell me how to host these 3 applications.
Following is the build arguments which I am using in build definition
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSVC /p:Configuration=Dev /p:MSDeployServiceUrl="https://X.X.X.X:8172/MsDeploy.axd" /p:DeployIisAppPath="Default Web Site/SampleApplicaion" /p:UserName="username" /p:Password="password" /p:AllowUntrustedCertificate=True
Thanks,
Ashwani
In your arguments you are specifying that all deploys should go to "Default Web Site/SampleApplicaion". The command arguments will override any values you have set in your project configuration and so all apps will be deployed to this IIS website.
Instead you need to set the IIS site in the configuration settings of your project. Then you can specify Website A and B and that setting will be used when running your build.