I'm doing a PoC for Azure App Configuration. I created a free instance in our Azure env and added a couple of feature flags. The Issue I am having is with the JavaScript SDK when attempting to fetch feature flags from the App Configuration. Here's the snippet of code that I am using. (NOTE: the app is a React app w/ Typescript)
import { AppConfigurationClient } from '@azure/app-configuration';
import { GetConfigurationSettingResponse } from '@azure/app-configuration';
const appConfigClient = new AppConfigurationClient(process.env.REACT_APP_APPCONFIG_CONNECTION_STRING);
const requestFeatureFlags = async (): Promise<GetConfigurationSettingResponse> => {
const featureFlags = await appConfigClient.getConfigurationSetting({ key: '', label: 'my_feature_flags' });
console.log(featureFlags);
return featureFlags;
}
requestFeatureFlags().then((response) => { alert('I am here'); console.log(response) });
In the above I can see the request being made in the browser dev console and response with the feature flags, but the Promise
is never returned from the await appConfigClient.getConfigurationSetting({ key: '', label: 'my_feature_flags' });
call. The console log of featureFlags
yields this in the browser console ->
The alert
inside the then()
is never fired. So at this point I'm a loss lol. The SDK can be found here -> npm https://www.npmjs.com/package/@azure/app-configuration/v/1.1.0
If anyone else has come across this issue and help would be most appreciated!