Removing the Private Link of a Storage Account

Removing the Private Link of a Storage Account

This article explains how to revert a private link azure storage account back to a public link one.

1.  Re-enable the "public network access" for the storage account as shown:

2.  Delete the “private endpoint” connection as shown:

A screenshot of a computer

AI-generated content may be incorrect.

2.  Generate a new SAS token for the storage account and then turn off the private link connection by using Create or Update Storage instance API and nullifying the privateLinkServiceConnection parameter in the API request as shown:

Notes
The following code snippet only shows how to use the nullifying parameter in Python. It might be different for other languages.

  1. import requests
  2. url = "https://api.mk.io/api/v1/projects/projectName/media/storage/storageAccountName"
  3. payload = { 
  4.     "spec": {
  5.         "credential": { 
  6.             "sasToken": "New SAS Token"
  7.         },
  8.         "privateLinkServiceConnection": None,  
  9.         "type": "Microsoft.Storage",
  10.         "url": "Storage Account URL"
  11.     } 
  12. }
  13. headers = {
  14.     "accept": "application/json",
  15.     "content-type": "application/json",
  16.     "authorization": "API Token"
  17. }
  18. response = requests.put(url, json=payload, headers=headers)
  19. print(response.status_code)
  20. print(response.text)


3.   Lastly, confirm and make sure that the new SAS token is in a validated state and that all the assets under the updated storage account are accessible.