Description of problem
For Azure Connector, DNN uses the default Cloud endpoint suffix which is "core.windows.net". There are multiple Sovereign Clouds in Azure (e.g. Azure China 21Vianet & Azure Government) and in order to connect to an account in one of these, the default endpoint suffix should not be used. For example, for US Government instance, "core.usgovcloudapi.net" should be used and for China instance, "core.chinacloudapi.cn" should be used.
Description of solution
The usages of Microsoft.WindowsAzure.Storage.CloudStorageAccount should be changed to use public CloudStorageAccount(StorageCredentials storageCredentials, string endpointSuffix, bool useHttps) constructor overload instead of public CloudStorageAccount(StorageCredentials storageCredentials, bool useHttps) (current implementation).
How to decide which endpointSuffix to use (default vs others)? There might be multiple solutions:
- The first one is to use
appSettings section of the web.config and define an optional configuration parameter there (e.g. SovereignAzureInstanceName) which will hold values like "US", "China" (those are the only existing 2 at the moment as far as I've researched - Germany also had one but it seems to be deprecated/migrated in 2021). The configuration setting will be optional and if the setting doesn't exist, the application will continue to work just like before. There will be an endpoint generator class which will return the endpointSuffix according to the appSettings configuration (this class might handle other endpoint translations later for which some of them are described here for China as an example).
- Another approach might be to put a dropdown field or a textbox into the screen which is used to add a new Azure Connector so that users are able to choose their own Sovereign instance or we might list the possible values for endpoint suffixes (including the default one) so that users are able to select one. We need to modify DB schema and existing Connector records in DB for this change though. If the users need multiple Azure Connectors, this solution would enable the users to be able to add mixed Azure instances (Sovereign & Non-Sovereign) although I'm not sure whether it would be worth it. As per my knowledge (someone might shed more light on this); government regulations forbid storing the data in another country so mixed usage (Sovereign & non-Sovereign together) would not be possible for these cases.
For these possible two solutions above, the first one seems to be the simplest to implement without touching too many places and without changing the design of the application that much. Feel free to put your suggestions too and please comment whether you approve of any of these changes.
Screenshots
One of the places that uses the default endpoint suffix (windows.net):

Description of problem
For Azure Connector, DNN uses the default Cloud endpoint suffix which is "core.windows.net". There are multiple Sovereign Clouds in Azure (e.g. Azure China 21Vianet & Azure Government) and in order to connect to an account in one of these, the default endpoint suffix should not be used. For example, for US Government instance, "core.usgovcloudapi.net" should be used and for China instance, "core.chinacloudapi.cn" should be used.
Description of solution
The usages of
Microsoft.WindowsAzure.Storage.CloudStorageAccountshould be changed to usepublic CloudStorageAccount(StorageCredentials storageCredentials, string endpointSuffix, bool useHttps)constructor overload instead ofpublic CloudStorageAccount(StorageCredentials storageCredentials, bool useHttps)(current implementation).How to decide which
endpointSuffixto use (default vs others)? There might be multiple solutions:appSettingssection of theweb.configand define an optional configuration parameter there (e.g.SovereignAzureInstanceName) which will hold values like "US", "China" (those are the only existing 2 at the moment as far as I've researched - Germany also had one but it seems to be deprecated/migrated in 2021). The configuration setting will be optional and if the setting doesn't exist, the application will continue to work just like before. There will be an endpoint generator class which will return theendpointSuffixaccording to theappSettingsconfiguration (this class might handle other endpoint translations later for which some of them are described here for China as an example).For these possible two solutions above, the first one seems to be the simplest to implement without touching too many places and without changing the design of the application that much. Feel free to put your suggestions too and please comment whether you approve of any of these changes.
Screenshots
One of the places that uses the default endpoint suffix (

windows.net):