title: Cannot find the CREDENTIAL '<db_scoped_creds>', because it does not exist or you do not have permission
body: <p>I created external tables using the steps specified here: <a href="https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature</a>.</p>
  <p>Within Synapse workspace, I am able to access external table data (as it uses my AD credentials). However, it doesn't work from an external platform, redash in this case. In order to access data from redash, I created a db user and this is where I think I am missing a step to somehow grant this user to access database scope credentials.</p>
  <p>Steps, I took to create external table with required creds:</p>
  <ol>
  <li>Create database scope credentials to access data inside blob storage</li>
  </ol>
  <pre><code>CREATE DATABASE SCOPED CREDENTIAL datalake_credentials
      WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
      SECRET = 'SAS TOKEN';
  </code></pre>
  <ol start="2">
  <li>Create external datasource using credential created in previous step</li>
  </ol>
  <pre><code>CREATE EXTERNAL DATA SOURCE datalake_raw_marketing
  WITH ( LOCATION = 'https://mydatalake.blob.core.windows.net/raw/marketing'
            , CREDENTIAL= [datalake_credentials]
  );
  </code></pre>
  <ol start="3">
  <li>Finally create an external table using datasource</li>
  </ol>
  <pre><code>CREATE EXTERNAL TABLE [dbo].[Customers]
  (
      [Id] [varchar](36),
      [FirstName] [varchar](100),
      [Email] [varchar](100),
      [Date] [varchar](100),
      [Group] [varchar](100)
  )
  WITH (DATA_SOURCE = [datalake_raw_marketing], LOCATION = N'sub_dir/customer_list_*.csv',FILE_FORMAT = [QuotedCsvWithHeaderFormat])
  GO
  </code></pre>
  <p>Using information on this page <a href="https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature</a> I tried &quot;Grant permissions to use credential&quot; using:</p>
  <pre><code>GRANT REFERENCES ON CREDENTIAL::[datalake_credentials] TO [redash];
  </code></pre>
  <p>But it always results in:</p>
  <blockquote>
  <p>Cannot find the CREDENTIAL 'datalake_credentials', because it does not exist or you do not have permission.</p>
  </blockquote>