Closed Pinaki-1 closed 10 months ago
Updated the task -
- task: TerraformTaskV4@4
displayName: 'Terraform apply TaskV4'
inputs:
provider: 'azurerm'
Now I am getting a different error :
Code: AuthorizationFailed
│ Message: The client '******-*****-*******' with object id
│ '******-*****-*******' does not have authorization to
│ perform action 'Microsoft.DBforPostgreSQL/flexibleServers/read' over scope
│ '/subscriptions/*********/resourceGroups/*********/providers/Microsoft.DBforPostgreSQL/flexibleServers/pos-*********'
│ or the scope is invalid. If access was recently granted, please refresh
│ your credentials.
Hi, running az cli requires you to do az login before you can use the command on an azure resource. the terraform extension does not do az login automatically.
Thanks
@mericstam and so what is the best practice ? Add az login ...
into the terraform script ?
If you have a dependency on a az command in you terraform script i would would add a script task with az login before the terraform task is executed
I have an issue running the az cli script using local-exec provisioner.
Receive the following error: ERROR: Please run 'az login' to setup account
Task snippet -
Terraform part :