pulumi-azure-native
pulumi-azure-native copied to clipboard
Unable to deploy appsettings for azure static webapp
From Slack conversation:
Kevin Rich Today at 2:34 PM I'm looking at the typescript @pulumi/azure-native web.StaticSite and would like to deploy some appsettings along with the static site, but don't see a way to set them in the web.StaticSiteArgs object. Is there any guidance for this?
3 replies
Mikhail Shilkov 2 hours ago I checked and the app settings endpoint only have a PUT (create/update) operation but no GET. We depend on being able to read the state of any resource so we couldn’t map it to a Pulumi resource yet. (edited)
Mikhail Shilkov 2 hours ago Actually, there is POST endpoint that lists the settings, so we could do that even though this is a non-standard model.
Mikhail Shilkov 2 hours ago Could you please open an issue?
Any update on this issue? I am missing this as well
Same here, currently i can't add any Environment variables to the StaticSite.
@stack72 @mikhailshilkov missing this feature as well. No coverage for
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/StaticSites.json
This is very annoying.. I was able to set variables using this workaround. Hope it helps any of you too.
new Pulumi.AzureNative.Resources.Deployment("spa-configuration",
new DeploymentArgs
{
ResourceGroupName = resourceGroup.Name,
Properties = new DeploymentPropertiesArgs
{
Mode = DeploymentMode.Incremental,
Template = new Dictionary<string, object>
{
{ "$schema", "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" },
{ "contentVersion", "1.0.0.0" },
{
"resources", new List<Dictionary<string, object>>()
{
new()
{
{ "type", "Microsoft.Web/staticSites/config" },
{ "apiVersion", "2020-10-01" },
{ "name", spa.Name.Apply(c => $"{c}/appsettings") },
{ "kind", "string" },
{
"properties", new Dictionary<string, object>()
{
{ "SPA_AUTH0_DOMAIN", Config.Auth0Domain },
{ "SPA_AUTH0_CLIENT_ID", webFrontendAuth0Client.ClientId.Apply(c => c) }
}
},
}
}
}
}
}
});
@klyse Honestly, such things should simply not be necessary. But great that you shared a workaround 👍🏼
Any updates on this?
Isn´t the staticSites basically missing resources from "Microsoft.Web/staticSites/config@x" ?