Skip to content

Instantly share code, notes, and snippets.

@rmirabelli
Created January 21, 2022 18:59
Show Gist options
  • Save rmirabelli/6e1445125dca8a5bb511ddbcf4eef50d to your computer and use it in GitHub Desktop.
Save rmirabelli/6e1445125dca8a5bb511ddbcf4eef50d to your computer and use it in GitHub Desktop.
Implementation of AzureAppConfiguration using the AzureAppConfiguration-Swift package.
let endpoint = "https://OBTAINED-FROM-DASHBOARD.azconfig.io"
let secret = "PASTE-SECRET-HERE"
let credential = "PASTE-CREDENTIAL-HERE"
// Fetch and decode the configuration
let request = try AzureAppConfiguration.prepareRequest(endpoint: endpoint, secret: secret, credential: credential)
let (data, _) = try await URLSession.shared.data(for: request)
let dictionary = try AzureAppConfiguration.decodeResponse(data: data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment