mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-29 06:03:26 -08:00
fix postgresql
This commit is contained in:
@@ -51,13 +51,25 @@ az postgres flexible-server identity update \
|
||||
--system-assigned Enabled
|
||||
```
|
||||
```sql
|
||||
|
||||
-- Make sure the extension is installed
|
||||
CREATE EXTENSION IF NOT EXISTS azure_storage;
|
||||
|
||||
CREATE EXTERNAL DATA SOURCE ManagedIdentity
|
||||
|
||||
-- Login using storage keys
|
||||
SELECT azure_storage.account_add('<storage-account>', '<storage-key>');
|
||||
-- Login using managed identity
|
||||
SELECT azure_storage.account_add(azure_storage.account_options_managed_identity('<storage-account>', 'blob'));
|
||||
|
||||
-- List configured accounts
|
||||
SELECT * FROM azure_storage.account_list();
|
||||
|
||||
-- List all the files in the storage account
|
||||
SELECT *
|
||||
FROM azure_storage.blob_list(
|
||||
'<storage-account>',
|
||||
'<container>'
|
||||
);
|
||||
|
||||
-- Access one file inside the storage account
|
||||
SELECT *
|
||||
FROM azure_storage.blob_get(
|
||||
'<storage-account>',
|
||||
@@ -66,7 +78,6 @@ FROM azure_storage.blob_get(
|
||||
decoder := 'text'
|
||||
) AS t(content text)
|
||||
LIMIT 1;
|
||||
|
||||
```
|
||||
|
||||
Additionally it is necesary to have the public access enabled if you want to access from a non private endpoint, to enable it:
|
||||
|
||||
Reference in New Issue
Block a user