Managing Metadata and Security Settings for Storage Accounts
Let’s look at the connection string you used in the preceding code example. The connection string, including an admin key, should not be used for connection in the production environment. The safer option is to generate SAS tokens and leverage them to connect from code or scripts.
Remember that an admin key provides high-level access and, if compromised by hackers, may damage your data. The same can happen if you generate an SAS key with full permissions (you should follow the principle of least privilege). To avoid a security breach of your storage account, you should not hardcode the keys in the code or store them in the configuration file. Microsoft recommends using Azure Key Vault to store connection information (such as the connection string, SAS, or admin keys).
Moreover, the principle of least privilege should be applied to applications that manage storage accounts. The SAS technology will help granularly...