Hi everyone. I still can't add a Linked Backend o...
# azure
m
Hi everyone. I still can't add a Linked Backend on an Azure Static Web App: When I use direct the Azure REST API it works properly :
Copy code
PUT <https://management.azure.com/subscriptions/******-****-***-****/resourceGroups/rg-test-dev/providers/Microsoft.Web/staticSites/stapp-test-dev/linkedBackends/wapp-test-dev?api-version=2024-04-01>
Authorization: Bearer *******
Content-type: application/json

{
"properties": {
"/subscriptions/****-*****-****/resourceGroups/rg-test-dev/providers/Microsoft.Web/sites/wapp-test-dev",
"region": "West Europe"
}
When I do the same thing using Pulumi (I intentionnaly hard coded the values), it does not :
Copy code
var staticSiteLinkedBackend = new Pulumi.AzureNative.Web.V20240401.StaticSiteLinkedBackend("stapp-test-dev-an-e352ae82", new()
{
    BackendResourceId= "/subscriptions/****-*****-****/resourceGroups/rg-test-dev/providers/Microsoft.Web/sites/wapp-test-dev",
    LinkedBackendName = "wapp-test-dev",
    Name = "stapp-test-dev",
    ResourceGroupName = "rg-test-dev",
});
The pulumi up fails with a 500 internal Server Error / ERROR CODE UNAVAILABLE Anyone can help me with the matter?
m
If you can run
pulumi up
with
--logtostderr --logflow -v*=9*
(see here) we can see the request that Pulumi sends to Azure, and compare it to the successful one using the API directly. You can look for
HTTP Request Begin
in the output.
m
I will try that. Thanks
@melodic-tomato-39005 the request is the same in the logs, except the "region" property that is missing for Puumi. If I remove it from the the REST API requests I indeed get a http 500. By providing the region propery it works fine, but I must say it is weird to have to do that, knowing that for other resources the default location is used. I don't know if it's a provider issue or not. Thanks for the help anyway
m
That does seems like a provider bug. Could I bother you to file a bug? Thanks for investigating!
m
Not sure it's really a bug because maybe azure API needs the region of the associated backend. Anyway the error should be better handled. Here is the issue https://github.com/pulumi/pulumi-azure-native/issues/3757
I saw you made the fix and created the issue for Microsoft @melodic-tomato-39005 . Thanks!