How to get all configuration settings from Azure Config file? How to get all configuration settings from Azure Config file? azure azure

How to get all configuration settings from Azure Config file?


The short answer is 'no' the RoleEnvironment does not support getting all the configuration setting values.

A slightly longer answer is that getting configuration settings from the role environment in the current implementation is done through a call to native code. The separation of Windows Azure Application from Windows Azure Configuration and the ability to swap settings on a running application is at the root of this somehow. This is done inside of msshrtmi.dll (which should mean something like Microsoft Shared Runtime Managed Interop). This is the only reference Microsoft.WindowsAzure.ServiceRuntime.dll has apart from standard references to .NET.

Here is the method call to native code (I have not gone further than this):

[MethodImpl(MethodImplOptions.Unmanaged, MethodCodeType=MethodCodeType.Native), SuppressUnmanagedCodeSecurity, DllImport("", EntryPoint="", CallingConvention=CallingConvention.StdCall, SetLastError=true)]internal static extern unsafe int modopt(IsLong) modopt(CallConvStdcall) RdGetApplicationConfigurationSetting(ushort modopt(IsConst), ushort*);


It might seem like a slightly round-about way of doing it, but if you want to get the configurations for all the roles in a deployment you can use the management api.


Kudu has an API for this.

You get to Kudu like via App Services > Advanced Details > Go

https://{app-service-name}.scm.azurewebsites.net/orhttps://{app-service-name}-{slot-name}.scm.azurewebsites.net/

The Url for the settings API is:

https://{app-service-name}.azurewebsites.net/api/settings or https://{app-service-name}-{slot-name}.scm.azurewebsites.net/