use of com.microsoft.azure.management.storage.StorageAccountKey in project azure-sdk-for-java by Azure.
the class Utils method print.
/**
* Print storage account keys.
* @param storageAccountKeys a list of storage account keys
*/
public static void print(List<StorageAccountKey> storageAccountKeys) {
for (int i = 0; i < storageAccountKeys.size(); i++) {
StorageAccountKey storageAccountKey = storageAccountKeys.get(i);
System.out.println("Key (" + i + ") " + storageAccountKey.keyName() + "=" + storageAccountKey.value());
}
}
use of com.microsoft.azure.management.storage.StorageAccountKey in project azure-sdk-for-java by Azure.
the class FunctionAppImpl method submitAppSettings.
@Override
Observable<SiteInner> submitAppSettings(final SiteInner site) {
if (storageAccountCreatable != null && createdResource(storageAccountCreatable.key()) != null) {
storageAccountToSet = (StorageAccount) createdResource(storageAccountCreatable.key());
}
if (storageAccountToSet == null) {
return super.submitAppSettings(site);
} else {
return storageAccountToSet.getKeysAsync().flatMapIterable(new Func1<List<StorageAccountKey>, Iterable<StorageAccountKey>>() {
@Override
public Iterable<StorageAccountKey> call(List<StorageAccountKey> storageAccountKeys) {
return storageAccountKeys;
}
}).first().flatMap(new Func1<StorageAccountKey, Observable<SiteInner>>() {
@Override
public Observable<SiteInner> call(StorageAccountKey storageAccountKey) {
String connectionString = String.format("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s", storageAccountToSet.name(), storageAccountKey.value());
withAppSetting("AzureWebJobsStorage", connectionString);
withAppSetting("AzureWebJobsDashboard", connectionString);
withAppSetting("WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", connectionString);
withAppSetting("WEBSITE_CONTENTSHARE", SdkContext.randomResourceName(name(), 32));
return FunctionAppImpl.super.submitAppSettings(site);
}
}).doOnCompleted(new Action0() {
@Override
public void call() {
currentStorageAccount = storageAccountToSet;
storageAccountToSet = null;
storageAccountCreatable = null;
}
});
}
}
Aggregations