-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
cloudSupport/src/main/scala/cromwell/cloudsupport/azure/AzureConfiguration.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cromwell.cloudsupport.azure | ||
|
||
import com.azure.core.management.AzureEnvironment | ||
import com.typesafe.config.ConfigFactory | ||
import net.ceedubs.ficus.Ficus._ | ||
|
||
object AzureConfiguration { | ||
private val conf = ConfigFactory.load().getConfig("azure") | ||
val azureEnvironment = AzureEnvironmentConverter.fromString(conf.as[Option[String]]("azure-environment").getOrElse("AZURE")) | ||
val azureTokenScopeManagement = conf.as[String]("token-scope-management") | ||
} | ||
|
||
object AzureEnvironmentConverter { | ||
val Azure: String = "AZURE" | ||
val AzureGov: String = "AZURE_GOV" | ||
|
||
def fromString(s: String): AzureEnvironment = s match { | ||
case AzureGov => AzureEnvironment.AZURE_US_GOVERNMENT | ||
// a bit redundant, but I want to have a explicit case for Azure for clarity, even though it's the default | ||
case Azure => AzureEnvironment.AZURE | ||
case _ => AzureEnvironment.AZURE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters