Testing of ARM Templates using ARM TTK Tool in a DevOps Pipeline - azure-devops

I am trying to use ARM TTK and i am selecting my tests.
One of the tests that i want to run is apiVersions Should Be Recent
Now in my ARM template i have a resource block of type "Microsoft.DevTestLab/schedules".
The latest API version for this resource as per the link API Versions is 2018-09-15.
This is more than 2 years old and my test is failing as it is not fulfilling one of the conditions.
So how to tackle such kind of API versions if there is no current version available which is within 2 years. Any help is appreciated
learn.microsoft.comlearn.microsoft.com
Template test cases for test toolkit - Azure Resource Manager
Describes the template tests that are run by the Azure Resource Manager template test toolkit.
learn.microsoft.comlearn.microsoft.com
Microsoft.DevTestLab/schedules - Bicep & ARM template reference
Azure Microsoft.DevTestLab/schedules syntax and properties to use in Azure Resource Manager templates for deploying the resource. API version latest

The issue still available in a arm ttk issue & arm ttk issue2
To get a API Version for the specific Resource type use below PowerShell script.
((Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions
Refer for azure ARM schema generation azure-resource-manager-schemas
Refer for additional Steps https://stackoverflow.com/a/45066194/15997690
Solution is available if the latest version of API available check here in your case No latest version available for DevTestLab.
Please raise a support ticket and MS Q&A here

Related

Cannot set up SAP NW RFC with Azure DevOps

In our solution we are interacting with SAP using the "Classic" API of the SAP RFC SDK.
We have hosted the application in Azure Services, hence not possible to place the librfc32.dll in the required path of C drive.
We have added the librfc32.dll in the solution and marked it Copy Always to the folder.
While we publish the solution locally and deploy using FTP in Azure Services, it works fine.
However when deployed using ADO pipeline, it gives the below error.
We have checked both published and ADO generated artifact and in both places the librfc32.dll is present fine.
Cannot call classic RFC API. See help for details. Please put a recent 64-bit version of librfc32.dll in your System32 folder (typically C:\Windows\System32). See SAP note 413708. Please make sure you have installed Visual C++ 2005 SP1 ATL Security Update (x64). An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Any suggestion?

Compilation of Elyra-Pipelines to Tekton based Kubeflow fails

I've installed a kubernetes cluster running kubeflow pipelines based on tekton on top of KIND using the following instructions
Now I'm getting the following error message from the Elyra pipelines editor. Running against an argo based kfp cluster works fine.
Is the kfp compiler somehow not supporting tekton? Can someone please shine some light on this?
HTTP response body:
{"error_message":"Error creating pipeline: Create pipeline failed:
Failed to get parameters from the pipelineRun: Invalid input error:
Unsupported argo version.
Expected: tekton.dev/v1beta1.
Received: argoproj.io/v1alpha1",
"error_details":"Error creating pipeline: Create pipeline failed:
Failed to get parameters from the pipelineRun: Invalid input error:
Unsupported argo version. Expected: tekton.dev/v1beta1.
Received: argoproj.io/v1alpha1"}
There are different aspects to consider here:
There is a need to perform a custom deployment to enable Kubeflow Pipelines to integrate/use a Tekton environment. As you mentioned the steps are described here.
As for Elyra support, Elyra recent releases starting with Elyra 2.x has incorporated support for KFP using Tekton and further documentation is available in the Elyra user guide
If you are still using Elyra 1.x or lower, the below still applies:
Now, related to compiling and executing the Kubeflow Pipeline on a Tekton environment, Elyra is currently using the KFP SDK python package and the regular compiler to compile and generate the default ARGO YAML (see code here). In order to support Tekton, we will need to use a different python package (kfp-tekton==0.3.0) and there is also a need for a different code path during compilation (see example).
Another aspect is that it seems that there are some incompatibilities between the two pipelines as described in the migration path.
Regarding support, the Elyra project would welcome contributions.
As of now the Tekton compiler is in a separate package. You can install it with pip install kfp-tekton==0.3.0 for kubeflow 1.2 . Here is the user guide
Currently, Elyra doesn't support compiling for kfp-tekton, only kfp-argo
There is an open Issue on that with the Elyra team

AzureDevOps Exporting the ProcessTemplate

We have created a process template on the Enterprise level access on Microsoft AzureDevOps platform. We were looking to export the process template so that it can imported for some other organization. However we do not find an option to do so. Can anyone help?
The only way I've found so far to export inherited processes to other organizations is to use the process-migrator tool that's on GitHub made by Microsoft. There are some wonky things about it that don't totally work but hopefully should be a good start:
https://github.com/Microsoft/process-migrator
You download and install dependencies on the tool then you can run migrate or export/import (I think I usually do export/import).
I think that it works okay as-is except for if you have work item rules that are type CurrentUserIsMemberOfGroup, and picklists don't export correctly, but you'll want to do some testing of the tooling first. I also found out recently that this tooling uses an old SDK/API version (API v4.1) so hopefully it will be updated soon.
I am not sure through Azure DevOps UI but there are methods in Azure DevOps Services REST API
Export Process Template REST API Documentation
Import Process Template REST API Documentation
Parameters are pretty straighforward and well explained in MS Documentation.

VSTest-Task not running .NET Core 2.1 xUnit-Tests from Test-plan

I'm trying to create a release pipeline in VSTS that runs my xUnit-tests as specified in a Test Plan.
Long story short: I can't get it to work.
What I'm using:
Azure DevOps (formerly VSTS)
Visual Studio Test task (v2.*)
Test project targeting .NET Core 2.1
xunit 2.4 with xunit.runner.visualstudio 2.4
In Azure DevOps I defined a Test Plan that contains a Test Suite which contains a Test that has an Associated Automation which points to my xUnit test.
I had to use the REST API to link the test code to the Test as described here.
I can select that Test in the visual designer for the VSTest task.
When I run the release pipeline the VSTest task fails with the following error message:
DiscoveryMessage : System.IO.FileNotFoundException: Unable to find tests for D:\a\r1\a\Foo.Tests.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
The path to the Foo.Tests.dll is correct, all required files are copied as well.
I explicitly specified the framework version in a .runsettings file (as the option Other console options doesn't work when using the Test plan option).
Specified the path to custom test adapters
used Visual Studio 2017 and Installed by Tools Installer options
Added a .NET Core Tool installer to install the correct .NET Core SDK
...and any other combination of settings I could think of.
The error message is still the same.
Any ideas what I might be missing? Your help would be greatly appreciated at this point!
After several more hours we stumbled across a web page that stated that you don't have to copy the binaries of your test project as input for the VSTest task but PUBLISH it instead. That never came to mind as vstest.console.exe runs smoothly when you point it at the binaries on a local machine.
UPDATE: We had to add a Publish Artifact task at the end of our Build Pipeline and make the Release Pipeline pick up the published artifact.

Deploy specific version of Kubernetes to Azure Container Service

Is there any way to deploy a particular version of Kubernetes to ACS in Azure?
Using Azure resource manager, or az command.
It doesn't seem like template format for container service shows this info.
You can specify the version in ACS in selected regions. See the template example.
https://github.com/weinong/azure-quickstart-templates/tree/master/101-acs-kubernetes-with-version
We will be updating azure cli with this feature soon.
I suggest you to use acs-engine in this case. It is a tool for you to specify some custom definition like "orchestratorversion" for your case, and it can then generate an ARM template for deploying the k8s cluster.
You could download the acs-engine tool here https://github.com/Azure/acs-engine/releases (choose the version based on your need for the k8s version).
To achieve your goal, you have to provide a json file which the template you could find here https://github.com/Azure/acs-engine/blob/master/examples/kubernetes-releases/kubernetes1.7.json. You could alter the attribute "orchestratorversion" to either 1.5, 1.6 or 1.7 to suit your need. (or maybe 1.8 for the latest version)
When the json file is ready, you could turn it into the ARM template files by typing the following command
.\acs-engine.exe generate kubernetes.json
This will create a new directory called "_output" and you could find the azuredeploy.json and azuredeploy.parameters.json files there.
For more information about the attributes in the json file, take a look at https://github.com/Azure/acs-engine/blob/master/docs/clusterdefinition.md.
Another way you could also try is in the Deployment via Azure CLI specified here. https://github.com/Azure/ACS/tree/master/docs