question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WARNING: No connection string, account key or sas token found

See original GitHub issue

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug I have old and new release pipelines failing on a Terraform CLI task for Command init.

deployment of state resources task YAML:

variables: environment: ‘test’

steps:

  • task: AzureResourceGroupDeployment@2 displayName: ‘Release deployment state resources’ inputs: azureSubscription: ‘subscriptiondetials removed’ resourceGroupName: ‘$(names.prefix)-$(names.project)-deploy-rg’ location: ‘$(locations.primary)’ csmFile: ‘$(System.DefaultWorkingDirectory)\Resources$(paths.targets.publish.resources)\storage_account.template.json’ csmParametersFile: ‘$(System.DefaultWorkingDirectory)\Resources$(paths.targets.publish.resources)\storage_account.parameters.json’ overrideParameters: ‘-storage_account_name “deploymentstate” -storage_account_location “$(locations.primary)” -storage_account_tag_department “$(tags.department)” -storage_account_tag_environment “$(environment)” -storage_account_tag_project “$(tags.project) Deployment” -storage_account_tag_owner “$(tags.owner)” -storage_account_tag_resource “Storage Account”’

Terraform initialise task YAML:

variables: environment: ‘test’

steps:

  • task: charleszipp.azure-pipelines-tasks-terraform.azure-pipelines-tasks-terraform-cli.TerraformCLI@0 displayName: ‘Terraform : initialize’ inputs: command: init workingDirectory: ‘$(System.DefaultWorkingDirectory)\Resources\publish\resources’ backendType: azurerm backendServiceArm: ‘subscription’ ensureBackend: true backendAzureRmResourceGroupName: ‘project-description-deploy-resource-group’ backendAzureRmResourceGroupLocation: ‘$(locations.primary)’ backendAzureRmStorageAccountName: ‘deploystorageaccount’ backendAzureRmContainerName: deploymentstate backendAzureRmKey: ‘teststate’

here is the log for the failed task

2020-02-18T09:17:31.8884457Z ##[section]Starting: Terraform : initialize 2020-02-18T09:17:31.8972618Z ============================================================================== 2020-02-18T09:17:31.8972744Z Task : Terraform CLI 2020-02-18T09:17:31.8972798Z Description : Execute terraform cli commands 2020-02-18T09:17:31.8972868Z Version : 0.4.19 2020-02-18T09:17:31.8972914Z Author : Charles Zipp 2020-02-18T09:17:31.8972980Z Help : 2020-02-18T09:17:31.8973040Z ============================================================================== 2020-02-18T09:17:32.5471249Z [command]C:\hostedtoolcache\windows\terraform\0.12.20\x64\terraform.exe version 2020-02-18T09:17:33.1308681Z Terraform v0.12.20 2020-02-18T09:17:33.1529307Z [command]C:\windows\system32\cmd.exe /D /S /C ““C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd” login --service-principal -t *** -u *** -p " 2020-02-18T09:18:02.1665395Z [ 2020-02-18T09:18:02.1665916Z { 2020-02-18T09:18:02.1666106Z “cloudName”: “AzureCloud”, 2020-02-18T09:18:02.1666354Z “id”: “removes id”, 2020-02-18T09:18:02.1666541Z “isDefault”: true, 2020-02-18T09:18:02.1666728Z “name”: “removed subscribername”, 2020-02-18T09:18:02.1666880Z “state”: “Enabled”, 2020-02-18T09:18:02.1667160Z “tenantId”: "”, 2020-02-18T09:18:02.1667321Z “user”: { 2020-02-18T09:18:02.1667502Z “name”: “***”, 2020-02-18T09:18:02.1667659Z “type”: “servicePrincipal” 2020-02-18T09:18:02.1667825Z } 2020-02-18T09:18:02.1667968Z } 2020-02-18T09:18:02.1668126Z ] 2020-02-18T09:18:02.1896913Z [command]C:\windows\system32\cmd.exe /D /S /C ““C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd” account set -s **" 2020-02-18T09:18:03.5257527Z [command]C:\windows\system32\cmd.exe /D /S /C "“C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd” group create --name -content-deploy-rg --location northeurope" 2020-02-18T09:18:06.1804023Z { 2020-02-18T09:18:06.1804643Z “id”: "//resourceGroups/-content-deploy-rg", 2020-02-18T09:18:06.1804919Z “location”: “northeurope”, 2020-02-18T09:18:06.1805902Z “managedBy”: null, 2020-02-18T09:18:06.1806101Z “name”: "-content-deploy-rg", 2020-02-18T09:18:06.1806271Z “properties”: { 2020-02-18T09:18:06.1806450Z “provisioningState”: “Succeeded” 2020-02-18T09:18:06.1806613Z }, 2020-02-18T09:18:06.1806787Z “tags”: null, 2020-02-18T09:18:06.1806953Z “type”: “Microsoft.Resources/resourceGroups” 2020-02-18T09:18:06.1807130Z } 2020-02-18T09:18:06.1994065Z [command]C:\windows\system32\cmd.exe /D /S /C ““C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd” storage account show --name contentdeploysa --resource-group ****-****content-deploy-rg" 2020-02-18T09:18:09.6260977Z { 2020-02-18T09:18:09.6261175Z “accessTier”: “Hot”, 2020-02-18T09:18:09.6261243Z “azureFilesIdentityBasedAuthentication”: null, 2020-02-18T09:18:09.6261331Z “creationTime”: “2020-02-18T09:16:53.240309+00:00”, 2020-02-18T09:18:09.6261431Z “customDomain”: null, 2020-02-18T09:18:09.6261488Z “enableHttpsTrafficOnly”: true, 2020-02-18T09:18:09.6261584Z “encryption”: { 2020-02-18T09:18:09.6261643Z “keySource”: “Microsoft.Storage”, 2020-02-18T09:18:09.6261722Z “keyVaultProperties”: null, 2020-02-18T09:18:09.6261784Z “services”: { 2020-02-18T09:18:09.6261852Z “blob”: { 2020-02-18T09:18:09.6261908Z “enabled”: true, 2020-02-18T09:18:09.6261979Z “keyType”: “Account”, 2020-02-18T09:18:09.6262048Z “lastEnabledTime”: “2020-02-18T09:16:53.318413+00:00” 2020-02-18T09:18:09.6262130Z }, 2020-02-18T09:18:09.6262184Z “file”: { 2020-02-18T09:18:09.6262240Z “enabled”: true, 2020-02-18T09:18:09.6262311Z “keyType”: “Account”, 2020-02-18T09:18:09.6262380Z “lastEnabledTime”: “2020-02-18T09:16:53.318413+00:00” 2020-02-18T09:18:09.6262459Z }, 2020-02-18T09:18:09.6262512Z “queue”: null, 2020-02-18T09:18:09.6264556Z “table”: null 2020-02-18T09:18:09.6264611Z } 2020-02-18T09:18:09.6264677Z }, 2020-02-18T09:18:09.6264746Z “failoverInProgress”: null, 2020-02-18T09:18:09.6264821Z “geoReplicationStats”: null, 2020-02-18T09:18:09.6265090Z “id”: "/***8/resourceGroups/-****content-deploy-rg/providers/Microsoft.Storage/storageAccounts/”, 2020-02-18T09:18:09.6265201Z “identity”: null, 2020-02-18T09:18:09.6265258Z “isHnsEnabled”: null, 2020-02-18T09:18:09.6265314Z “kind”: “StorageV2”, 2020-02-18T09:18:09.6265387Z “largeFileSharesState”: null, 2020-02-18T09:18:09.6265449Z “lastGeoFailoverTime”: null, 2020-02-18T09:18:09.6265523Z “location”: “northeurope”, 2020-02-18T09:18:09.6265585Z “name”: “********contentdeploysa”, 2020-02-18T09:18:09.6265668Z “networkRuleSet”: { 2020-02-18T09:18:09.6265725Z “bypass”: “AzureServices”, 2020-02-18T09:18:09.6265799Z “defaultAction”: “Allow”, 2020-02-18T09:18:09.6265866Z “ipRules”: [], 2020-02-18T09:18:09.6265936Z “virtualNetworkRules”: [] 2020-02-18T09:18:09.6266003Z }, 2020-02-18T09:18:09.6266057Z “primaryEndpoints”: { 2020-02-18T09:18:09.6266140Z “blob”: “https://********contentdeploysa.blob.core.windows.net/”, 2020-02-18T09:18:09.6266224Z “dfs”: “https://********contentdeploysa.dfs.core.windows.net/”, 2020-02-18T09:18:09.6266320Z “file”: “https://********contentdeploysa.file.core.windows.net/”, 2020-02-18T09:18:09.6266389Z “internetEndpoints”: null, 2020-02-18T09:18:09.6266465Z “microsoftEndpoints”: null, 2020-02-18T09:18:09.6266540Z “queue”: “https://********contentdeploysa.queue.core.windows.net/”, 2020-02-18T09:18:09.6266637Z “table”: “https://********contentdeploysa.table.core.windows.net/”, 2020-02-18T09:18:09.6266721Z “web”: “https://********contentdeploysa.z16.web.core.windows.net/” 2020-02-18T09:18:09.6266800Z }, 2020-02-18T09:18:09.6266857Z “primaryLocation”: “northeurope”, 2020-02-18T09:18:09.6266944Z “privateEndpointConnections”: [], 2020-02-18T09:18:09.6267008Z “provisioningState”: “Succeeded”, 2020-02-18T09:18:09.6267230Z “resourceGroup”: "-****content-deploy-rg”, 2020-02-18T09:18:09.6267299Z “routingPreference”: null, 2020-02-18T09:18:09.6267372Z “secondaryEndpoints”: { 2020-02-18T09:18:09.6267447Z “blob”: “https://********contentdeploysa-secondary.blob.core.windows.net/”, 2020-02-18T09:18:09.6267538Z “dfs”: “https://********contentdeploysa-secondary.dfs.core.windows.net/”, 2020-02-18T09:18:09.6267623Z “file”: null, 2020-02-18T09:18:09.6267679Z “internetEndpoints”: null, 2020-02-18T09:18:09.6267755Z “microsoftEndpoints”: null, 2020-02-18T09:18:09.6267835Z “queue”: “https://********contentdeploysa-secondary.queue.core.windows.net/”, 2020-02-18T09:18:09.6267939Z “table”: “https://********contentdeploysa-secondary.table.core.windows.net/”, 2020-02-18T09:18:09.6268029Z “web”: “https://**contentdeploysa-secondary.z16.web.core.windows.net/" 2020-02-18T09:18:09.6268119Z }, 2020-02-18T09:18:09.6268177Z “secondaryLocation”: “westeurope”, 2020-02-18T09:18:09.6268260Z “sku”: { 2020-02-18T09:18:09.6268318Z “name”: “Standard_RAGRS”, 2020-02-18T09:18:09.6268393Z “tier”: “Standard” 2020-02-18T09:18:09.6268448Z }, 2020-02-18T09:18:09.6268517Z “statusOfPrimary”: “available”, 2020-02-18T09:18:09.6268582Z “statusOfSecondary”: “available”, 2020-02-18T09:18:09.6268644Z “tags”: { 2020-02-18T09:18:09.6268713Z “Department”: “Umkhosi”, 2020-02-18T09:18:09.6268774Z “Environment”: “test”, 2020-02-18T09:18:09.6268845Z “Owner”: "”, 2020-02-18T09:18:09.6268909Z “Project”: “****content Deployment”, 2020-02-18T09:18:09.6268989Z “Resource”: “Storage Account” 2020-02-18T09:18:09.6269048Z }, 2020-02-18T09:18:09.6269119Z “type”: “Microsoft.Storage/storageAccounts” 2020-02-18T09:18:09.6269181Z } 2020-02-18T09:18:09.6433516Z [command]C:\windows\system32\cmd.exe /D /S /C ““C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd” storage container create --name contentapideploymentstate --account-name ********contentdeploysa” 2020-02-18T09:18:12.5041524Z { 2020-02-18T09:18:12.5042073Z “created”: true 2020-02-18T09:18:12.5042261Z } 2020-02-18T09:18:12.5043052Z WARNING: No connection string, account key or sas token found, we will query account keys for your storage account. Please try to use --auth-mode login or provide one of the following parameters: connection string, account key or sas token for your storage account. 2020-02-18T09:18:12.5113066Z ##[error]Error: WARNING: No connection string, account key or sas token found, we will query account keys for your storage account. Please try to use --auth-mode login or provide one of the following parameters: connection string, account key or sas token for your storage account.

2020-02-18T09:18:12.8541515Z ##[section]Finishing: Terraform : initialize

To Reproduce Create terraform release pipeline. after a task to deploy state resource follow procedure to create normal terraform release pipeline

Expected behavior Expect terraform to create all resources in Azure

Environment summary Create terraform release pipeline. after a task to deploy state resource follow procedure to create normal terraform release pipeline. YAML files show above

Additional context can this be related to this https://github.com/Azure/azure-cli/issues/12193 ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

15reactions
ghostcommented, Feb 21, 2020

Please don’t write warnings to stderr (at least unless that’s in a major version increment as it should be considered a breaking change).

stderr should just be for errors 😃

5reactions
Juliehzlcommented, May 27, 2020

To block the warning message, you can add --only-show-errors in your command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choose how to authorize access to blob data with Azure CLI
You can authorize data operations using Azure AD credentials, with the account access key, or with a shared access signature (SAS) token.
Read more >
az storage container list. doesnt work, referencing deleted ...
After running the command with debug: az storage container list --debug --account-name tfsa$UNIQUE_ID --query [].name --output tsv.
Read more >
RBAC Roles for Azure CLI storage operations - Michael Burch
The pipeline failed yesterday, with only the following message in the logs WARNING: No connection string, account key or sas token found, ...
Read more >
Azure CLI reports missing credentials to access storage ...
I'm quite confused with how the credentials and logins work for Azure. Since the access token is already granted through the login, shouldn't ......
Read more >
Generate SAS token for Azure storage account, Generate SAS and ...
From the Storage Account blade click on Shared access signature. ... WARNING: No connection string, account key or sas token found, we will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found