Azure Devops. - Importing from one project/repository to another - azure

I am trying to import project from one repository to another on Azure DevOps and running into this error:
Your import of https://asbc#dev.azure.com/application/repo/_git/mycode repository failed due to VS403655: The push was rejected because storage:621b7803-367a-307b-8a15-0164783333e2 contains ':', which isn't a valid file or directory character. .
All solutions I found are suggesting force push to the new repo but we need to retain history. I will appreciate if there is any way to copy these files without using third-party tools or custom development using APIs.

Related

How can I exclude a file on Azure Devops in the Deployment?

I apologize for my english, im using a translator.
I need make a deployment on Azure Devops using Continous Deployment but i need exclude a file from the repository (i cant change the repository) then create a deployment in IIS.
I have a WebService file in the repository but i cant ignore or delete it from git. I need to use Azure Devops to ignore it then make a continuous deployment.
Another approch is also to use .artifactsignore. By including this file you can describe which files you want to ignore before building the artifacts package. The tricky part here is correct placing of the file.
Where you save the .artifactignore file depends which path you have specified for the publish pipeline artifact task in your pipeline definition.
Here is good example which helped me to use it:
https://www.jfe.cloud/control-pipeline-artifacts-with-artifactignore-file/
You can use the task Delete Files, as covered below:
# Delete files
# Delete folders, or files matching a pattern
- task: DeleteFiles#1
inputs:
#SourceFolder: # Optional
#Contents: 'myFileShare'
#RemoveSourceFolder: # Optional
The input source folder can be folder $(rootFolder) or $(Build.ArtifactStagingDirectory).
I've had a similar problem and solved it this way. Especially .git or .vsfolder.

CI/CD from Azure Deployment Center failing because repo name must be lower case

I had an App Service configured 6 months ago with GitHub CI/CD and it was working fine. Logged into it to find this new deployment center and having to use github actions - so I figured that, and it generated a an action with a yaml file. But it's failing with the error
buildx failed with: error: invalid tag "waldopickem.azurecr.io/***/reactpickem:4fed0719c66061876de0d28cc1bd460b0b818275": repository name must be lowercase
I've tried renaming my github repo to lower case it....but I can't rename App Services (and my app service is camel case).
This seems quite basic. How do I get this unblocked? I don't know yaml but basic searches didn't turn up an easy solution.
Please help - ci/cd used to work. Now Azure changed to add new features (which I don't care about) and I'm stuck.
The term "repository" is overloaded. It's not talking about the code repository, but rather the container repository -- the thing that's being replaced with *** in the error message.
Rename whatever is in the *** to an environment variable waldopickem.azurecr.io/***/reactpickem:4fed0719c66061876de0d28cc1bd460b0b818275"
For example, you might have: waldopickem.azurecr.io/${{secrets.AzureAppService_ContainerUsername}}/reactpickem:4fed0719c66061876de0d28cc1bd460b0b818275"
change it to:
waldopickem.azurecr.io/my-repo-name/reactpickem:4fed0719c66061876de0d28cc1bd460b0b818275"
or
just remove it altogether so that reactpickem becomes the repo name like
waldopickem.azurecr.io/reactpickem:4fed0719c66061876de0d28cc1bd460b0b818275"

DNN Site azure DevOps build pipeline error

I have DNN site package , i pushed the code into Azure DevOps repository.
If we want to create build pipeline for the DNN site package we need to add below Task.
1.NuGet Restore
2. Set DNN Version Number
3. Build Solution
4. Test Assemblies
5. Copy Files
6. Publish Artifacts
Here my question is , When i am trying add build solution task , we need to give solution path(.sln or .csproj).But DNN site has only packages so i am getting below error
ERROR : Error Image
You should confirm that whether there is a xxx.sln file under your current repo. If not, you should push it into the repo.
Besides,check into your current repo, and determine which branch your project is in, based on that, you should check whether you select the right branch which the solution exists under the pipeline.
Also, you could specify all csproj files rather than a sln file to check if that works.

Running Kentico continuous integration on Azure app services

We have a new project in which we are trying to make use of the built in continuous integration in Kentico for tracking changes to templates, page types, transformations etc.
We have managed to get this working locally between two instances of a Kentico database, making changes in one, syncing the changes through CI and then restoring them up to the second database using the Continuous integration application that sits in the bin folder in the Kentico site.
The issue we are having is when it comes to deploying our changes to our dev and live environments.
Our sites are hosted as Azure App services and we deploy to them using VSTS (Azure DevOps) build and release workflows however, as these tasks run in an agent, any powershell script we try to run to trigger the CI application fails because it is not running in the site / server context.
My question is, has anyone managed to successfully run Kentico CI in the context of an Azure app service? Alternatively, how can I trigger a powershell script on the site following a deployment?
Yes, I've got this running in Azure DevOps within the release pipeline itself. It's something that we're currently rolling out as a business where I work.
The key steps to getting this working for me were as follows:
I don't want to deploy the ContinuousIntegration.exe or the repository folders, so I need to create a second artefact set from source control (this is only possible at the moment with Azure Repos and GitHub to my knowledge).
Unzip your deployment package and copy the CMS folder to a working directory, this is where you're going to run CI. I did this because I need the built assemblies available.
From the repo artefact in step 1, copy the ContinuousIntegration.exe and CI repository folders into the correct place in your unzipped working folder.
Ensure that the connection string actually works for the DB in your unzipped folder, if necessary, you may want to change your VS build options in regards to how the web.config is handled.
From here, you should be able to run CI in the new working folder against your target database.
In my instance, as I don't have CI running on the target site it means that everything is restored every time.
I'm in to process of writing this up in more detail, so I'll share here when I've done that.
Edit:
- I finally wrote this up in more detail: https://www.ridgeway.com/blog/web-development/using-kentico-12-mvc-with-azure-devops
We do, but no CI. VSTS + GIT. We store virtual objects in the file system and using git for version control. We have our own custom library that does import export of the Kentico objects (the ones are not controlled by Git).Essentially we have a json file "publishing manifest" where we specify what objects need to be exported (i.e. moved between environments).
There is a step from Microsoft 'Powershell on Target Machines', you guess you can look into that.
P.S. Take a look also at Three Ways to Manage Data in Kentico Using PowerShell
Deploy your CI files to the Azure App Service, and then use a Azure Job to run "ContinuousIntegration.exe"
If you place a file called KenticoCI.bat in the directory \App_Data\jobs\triggered\ContinuousIntegration - this will automatically create a web job that you can can trigger:
KenticoCI.bat
cd D:\home\site\wwwroot
ren App_Offline.bak App_Offline.htm
rem # run Kentico CI Integraton
cd D:\home\site\wwwroot\bin
ContinuousIntegration.exe -r
rem # Removes the 'App_Offline.htm' file to bring the site back online
cd D:\home\site\wwwroot
ren App_Offline.htm App_Offline.bak

Azure Website Git deployment with 3rd party libs not in nuget

I would like to use Azure git deployment with a product I am working on. We reference a 3rd party library which is privately supplied and not available on Nuget.
Azure syncs with the git repo as you would expect, but when it compiles it fails with errors saying it is unable to find the types within the 3rd party library.
The library is checked in to git in the bin folder.
How can I get Azure to reference this library when compiling?
There should be nothing special about doing this on Azure Web Apps vs doing it locally. If your assembly is committed and you reference it from its committed location, everything should just work.
If it doesn't, please try running through the steps in this document to help identify the issue.
You should be able to use standard NuGet practices to make this work. Looking at the documentation for Package Sources you just need to add the package source (like myget.org) to the nuget.config file place this at the same level as you *.sln file.

Resources