Managing metadata and security settings for storage accounts
Let us return to the connection string you used from the previous code project. A connection string including an admin key should not be used for connection in the production environment. Configuring RBAC for resources also can help with accessing the Azure storage account. The safer option is generating SAS tokens and leveraging them to connect from code or scripts. Remember that an admin key provides high-level access and if revealed by hackers, may damage your data. The same can happen if you generate a 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...