Hello Team,
I am trying to create DevOps Service Connection (Type AzureRM) using Azure DevOps Pipelines.
When I am Creating manually running commands using Powershell, it works. But when I am putting it as a Powershell Pipeline Task (In line Script), it throws the below Error:-
ERROR: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
Here goes the below details:-
- Commands which I ran manually and is successfully Executed -
az devops login
(Will ask for PAT Token)
az devops configure --defaults organization= project=
$passwd="Enter Service Principal Secret"
$env:AZURE_DEVOPS_EXT_AZURE_RM_SERVICE_PRINCIPAL_KEY=$passwd
az devops service-endpoint azurerm create --azure-rm-service-principal-id --azure-rm-subscription-id --azure-rm-subscription-name --azure-rm-tenant-id --name --org --project
az devops service-endpoint list --output table
$id = az devops service-endpoint list --query "[?name==''].id" -o tsv
az devops service-endpoint update --id $id --enable-for-all
- Powershell Pipeline Task (In line Script) -
- task: PowerShell@2
displayName: CREATE SERVICE CONNECTION IN DEVOPS
inputs:
targetType: 'inline'
script: |
az devops service-endpoint azurerm create --azure-rm-service-principal-id --azure-rm-subscription-id --azure-rm-subscription-name --azure-rm-tenant-id --name --org --project
$id = az devops service-endpoint list --query "[?name==''].id" -o tsv
az devops service-endpoint update --id $id --enable-for-all
env:
AZURE_DEVOPS_EXT_AZURE_RM_SERVICE_PRINCIPAL_KEY: "Enter Service Principal Secret"
Can you let me know what is the issue here with the pipeline...
Many Thanks
Regards, Arindam Mitra
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Hello Team,
I am trying to create DevOps Service Connection (Type AzureRM) using Azure DevOps Pipelines.
When I am Creating manually running commands using Powershell, it works. But when I am putting it as a Powershell Pipeline Task (In line Script), it throws the below Error:-
ERROR: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
Here goes the below details:-
az devops login
(Will ask for PAT Token)
az devops configure --defaults organization= project=
$passwd="Enter Service Principal Secret"
$env:AZURE_DEVOPS_EXT_AZURE_RM_SERVICE_PRINCIPAL_KEY=$passwd
az devops service-endpoint azurerm create --azure-rm-service-principal-id --azure-rm-subscription-id --azure-rm-subscription-name --azure-rm-tenant-id --name --org --project
az devops service-endpoint list --output table
$id = az devops service-endpoint list --query "[?name==''].id" -o tsv
az devops service-endpoint update --id $id --enable-for-all
displayName: CREATE SERVICE CONNECTION IN DEVOPS
inputs:
targetType: 'inline'
script: |
az devops service-endpoint azurerm create --azure-rm-service-principal-id --azure-rm-subscription-id --azure-rm-subscription-name --azure-rm-tenant-id --name --org --project
$id = az devops service-endpoint list --query "[?name==''].id" -o tsv
az devops service-endpoint update --id $id --enable-for-all
env:
AZURE_DEVOPS_EXT_AZURE_RM_SERVICE_PRINCIPAL_KEY: "Enter Service Principal Secret"
Can you let me know what is the issue here with the pipeline...
Many Thanks
Regards, Arindam Mitra
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.