Created Azure Service Principal at Azure AAD, got all service principal information like,subscription ID,Tenant ID,secret key and Client ID and configured all these information in Jenkins Azure AD plugin then Verified the Service Principal.
It is not able to authenticate the Azure Stack environment, same I tried using below PowerShell script able to authenticate and display the resources in the environment
$TenantID="xxx"
$clientID ="xxx”
$key = "xxx"
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential `
-argumentlist $clientID, $SecurePassword
$EnvName="AzureStackpb2Admin"
Add-AzureRMEnvironment -Name $EnvName ArmEndpoint "https://management.xxx.com"
Add-AzureRmAccount -Credential $cred -Tenant $TenantID -ServicePrincipal
Login-AzureRmAccount -ServicePrincipal -Credential $cred -Tenant $TenantID -EnvironmentName $EnvName
I created a Jenkin Job which calls the same Powershell script,here also this is not able to authenticate attaching the error log.
My Query:
Does Jenkins supports Azure Stack and stack authentication using service principal.If so can you please provide me solution for my issue(Azure stack authentication using service principal from Jenkins Azure AD Plugin or Jenkin job calling a PowerShell file)